Move stuff around

# Conflicts:
#	platform/Windows/nmapedit.vcxproj
#	platform/Windows/nmapedit.vcxproj.filters
#	source/blood/src/config.cpp
#	source/blood/src/config.h
#	source/blood/src/mapedit.cpp
#	source/blood/src/screen.cpp
#	source/blood/src/screen.h
This commit is contained in:
nukeykt 2019-06-28 21:45:39 +09:00 committed by Christoph Oelckers
parent 381f5dcac2
commit 57e9ff2fbc
10 changed files with 69 additions and 66 deletions

View file

@ -199,8 +199,6 @@ void QuitGame(void)
exit(0); exit(0);
} }
int nPrecacheCount;
void PrecacheDude(spritetype *pSprite) void PrecacheDude(spritetype *pSprite)
{ {
DUDEINFO *pDudeInfo = &dudeInfo[pSprite->type-kDudeBase]; DUDEINFO *pDudeInfo = &dudeInfo[pSprite->type-kDudeBase];
@ -379,7 +377,6 @@ void PreloadTiles(void)
G_HandleAsync(); G_HandleAsync();
} }
char precachehightile[2][(MAXTILES+7)>>3];
#ifdef USE_OPENGL #ifdef USE_OPENGL
void PrecacheExtraTextureMaps(int nTile) void PrecacheExtraTextureMaps(int nTile)
{ {
@ -2399,3 +2396,26 @@ bool VanillaMode() {
bool fileExistsRFF(int id, const char *ext) { bool fileExistsRFF(int id, const char *ext) {
return gSysRes.Lookup(id, ext); return gSysRes.Lookup(id, ext);
} }
int sndTryPlaySpecialMusic(int nMusic)
{
int nEpisode = nMusic/kMaxLevels;
int nLevel = nMusic%kMaxLevels;
if (!sndPlaySong(gEpisodeInfo[nEpisode].at28[nLevel].atd0, true))
{
strncpy(gGameOptions.zLevelSong, gEpisodeInfo[nEpisode].at28[nLevel].atd0, BMAX_PATH);
return 0;
}
return 1;
}
void sndPlaySpecialMusicOrNothing(int nMusic)
{
int nEpisode = nMusic/kMaxLevels;
int nLevel = nMusic%kMaxLevels;
if (sndTryPlaySpecialMusic(nMusic))
{
sndStopSong();
strncpy(gGameOptions.zLevelSong, gEpisodeInfo[nEpisode].at28[nLevel].atd0, BMAX_PATH);
}
}

View file

@ -79,3 +79,5 @@ void LoadExtraArts(void);
bool DemoRecordStatus(void); bool DemoRecordStatus(void);
bool VanillaMode(void); bool VanillaMode(void);
bool fileExistsRFF(int id, const char* ext); bool fileExistsRFF(int id, const char* ext);
int sndTryPlaySpecialMusic(int nMusic);
void sndPlaySpecialMusicOrNothing(int nMusic);

View file

@ -30,9 +30,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "renderlayer.h" #include "renderlayer.h"
#include "function.h" #include "function.h"
#include "blood.h" #include "blood.h"
#include "config.h"
#include "gamedefs.h" #include "gamedefs.h"
#include "globals.h" #include "globals.h"
#include "config.h" #include "screen.h"
#include "sound.h"
#include "tile.h"
#include "view.h" #include "view.h"
#ifdef __ANDROID__ #ifdef __ANDROID__
@ -51,8 +54,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
hashtable_t h_gamefuncs = { NUMGAMEFUNCTIONS<<1, NULL }; hashtable_t h_gamefuncs = { NUMGAMEFUNCTIONS<<1, NULL };
int32_t MAXCACHE1DSIZE = (96*1024*1024);
int32_t MouseDeadZone, MouseBias; int32_t MouseDeadZone, MouseBias;
int32_t SmoothInput; int32_t SmoothInput;
int32_t MouseFunctions[MAXMOUSEBUTTONS][2]; int32_t MouseFunctions[MAXMOUSEBUTTONS][2];
@ -68,19 +69,6 @@ int32_t JoystickAnalogueSaturate[MAXJOYAXES];
uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2]; uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
int32_t scripthandle; int32_t scripthandle;
int32_t setupread; int32_t setupread;
int32_t SoundToggle;
int32_t MusicToggle;
int32_t MusicRestartsOnLoadToggle;
int32_t CDAudioToggle;
int32_t FXVolume;
int32_t MusicVolume;
int32_t CDVolume;
int32_t NumVoices;
int32_t NumChannels;
int32_t NumBits;
int32_t MixRate;
int32_t ReverseStereo;
int32_t MusicDevice;
int32_t configversion; int32_t configversion;
int32_t CheckForUpdates; int32_t CheckForUpdates;
int32_t LastUpdateCheck; int32_t LastUpdateCheck;
@ -117,7 +105,6 @@ bool gNoClip;
bool gInfiniteAmmo; bool gInfiniteAmmo;
bool gFullMap; bool gFullMap;
int32_t gUpscaleFactor; int32_t gUpscaleFactor;
int32_t gBrightness;
int32_t gLevelStats; int32_t gLevelStats;
int32_t gPowerupDuration; int32_t gPowerupDuration;
int32_t gShowMapTitle; int32_t gShowMapTitle;

View file

@ -50,19 +50,6 @@ extern int32_t JoystickAnalogueSaturate[MAXJOYAXES];
extern uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2]; extern uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
extern int32_t scripthandle; extern int32_t scripthandle;
extern int32_t setupread; extern int32_t setupread;
extern int32_t SoundToggle;
extern int32_t MusicToggle;
extern int32_t MusicRestartsOnLoadToggle;
extern int32_t CDAudioToggle;
extern int32_t FXVolume;
extern int32_t MusicVolume;
extern int32_t CDVolume;
extern int32_t NumVoices;
extern int32_t NumChannels;
extern int32_t NumBits;
extern int32_t MixRate;
extern int32_t ReverseStereo;
extern int32_t MusicDevice;
extern int32_t configversion; extern int32_t configversion;
extern int32_t CheckForUpdates; extern int32_t CheckForUpdates;
extern int32_t LastUpdateCheck; extern int32_t LastUpdateCheck;
@ -99,11 +86,7 @@ extern bool gInfiniteAmmo;
extern bool gFullMap; extern bool gFullMap;
extern hashtable_t h_gamefuncs; extern hashtable_t h_gamefuncs;
extern int32_t gUpscaleFactor; extern int32_t gUpscaleFactor;
extern int32_t gBrightness;
extern int32_t gLevelStats; extern int32_t gLevelStats;
extern int32_t gPowerupDuration;
extern int32_t gShowMapTitle;
extern int32_t MAXCACHE1DSIZE;
extern int32_t gFov; extern int32_t gFov;
extern int32_t gCenterHoriz; extern int32_t gCenterHoriz;
extern int32_t gDeliriumBlur; extern int32_t gDeliriumBlur;

View file

@ -69,6 +69,7 @@ static int curPalette;
static int curGamma; static int curGamma;
int gGammaLevels; int gGammaLevels;
bool gFogMode = false; bool gFogMode = false;
int32_t gBrightness;
void scrResetPalette(void) void scrResetPalette(void)
{ {

View file

@ -39,6 +39,8 @@ extern RGB curDAC[256];
extern RGB baseDAC[256]; extern RGB baseDAC[256];
extern int gGammaLevels; extern int gGammaLevels;
extern bool gFogMode; extern bool gFogMode;
extern int32_t gBrightness;
void scrCreateStdColors(void);
void scrResetPalette(void); void scrResetPalette(void);
void gSetDacRange(int start, int end, RGB *pPal); void gSetDacRange(int start, int end, RGB *pPal);
void scrLoadPLUs(void); void scrLoadPLUs(void);

View file

@ -31,6 +31,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "sound.h" #include "sound.h"
#include "renderlayer.h" #include "renderlayer.h"
int32_t SoundToggle;
int32_t MusicToggle;
int32_t CDAudioToggle;
int32_t FXVolume;
int32_t MusicVolume;
int32_t CDVolume;
int32_t NumVoices;
int32_t NumChannels;
int32_t NumBits;
int32_t MixRate;
int32_t ReverseStereo;
int32_t MusicDevice;
Resource gSoundRes; Resource gSoundRes;
int soundRates[13] = { int soundRates[13] = {
@ -185,29 +198,6 @@ int sndPlaySong(const char *songName, bool bLoop)
return 0; return 0;
} }
int sndTryPlaySpecialMusic(int nMusic)
{
int nEpisode = nMusic/kMaxLevels;
int nLevel = nMusic%kMaxLevels;
if (!sndPlaySong(gEpisodeInfo[nEpisode].at28[nLevel].atd0, true))
{
strncpy(gGameOptions.zLevelSong, gEpisodeInfo[nEpisode].at28[nLevel].atd0, BMAX_PATH);
return 0;
}
return 1;
}
void sndPlaySpecialMusicOrNothing(int nMusic)
{
int nEpisode = nMusic/kMaxLevels;
int nLevel = nMusic%kMaxLevels;
if (sndTryPlaySpecialMusic(nMusic))
{
sndStopSong();
strncpy(gGameOptions.zLevelSong, gEpisodeInfo[nEpisode].at28[nLevel].atd0, BMAX_PATH);
}
}
bool sndIsSongPlaying(void) bool sndIsSongPlaying(void)
{ {
//return MUSIC_SongPlaying(); //return MUSIC_SongPlaying();

View file

@ -40,10 +40,21 @@ struct SFX
char rawName[9]; char rawName[9];
}; };
extern int32_t SoundToggle;
extern int32_t MusicToggle;
extern int32_t CDAudioToggle;
extern int32_t FXVolume;
extern int32_t MusicVolume;
extern int32_t CDVolume;
extern int32_t NumVoices;
extern int32_t NumChannels;
extern int32_t NumBits;
extern int32_t MixRate;
extern int32_t ReverseStereo;
extern int32_t MusicDevice;
int sndGetRate(int format); int sndGetRate(int format);
int sndPlaySong(const char *songName, bool bLoop); int sndPlaySong(const char *songName, bool bLoop);
int sndTryPlaySpecialMusic(int nMusic);
void sndPlaySpecialMusicOrNothing(int nMusic);
bool sndIsSongPlaying(void); bool sndIsSongPlaying(void);
void sndFadeSong(int nTime); void sndFadeSong(int nTime);
void sndSetMusicVolume(int nVolume); void sndSetMusicVolume(int nVolume);

View file

@ -82,6 +82,8 @@ short voxelIndex[kMaxTiles];
const char *pzBaseFileName = "TILES%03i.ART"; //"TILES%03i.ART"; const char *pzBaseFileName = "TILES%03i.ART"; //"TILES%03i.ART";
int32_t MAXCACHE1DSIZE = (96*1024*1024);
int tileInit(char a1, const char *a2) int tileInit(char a1, const char *a2)
{ {
UNREFERENCED_PARAMETER(a1); UNREFERENCED_PARAMETER(a1);
@ -208,8 +210,8 @@ void tilePreloadTile(int nTile)
} }
} }
extern int nPrecacheCount; int nPrecacheCount;
extern char precachehightile[2][(MAXTILES+7)>>3]; char precachehightile[2][(MAXTILES+7)>>3];
void tilePrecacheTile(int nTile, int nType) void tilePrecacheTile(int nTile, int nType)
{ {

View file

@ -48,6 +48,11 @@ extern char surfType[kMaxTiles];
extern signed char tileShade[kMaxTiles]; extern signed char tileShade[kMaxTiles];
extern short voxelIndex[kMaxTiles]; extern short voxelIndex[kMaxTiles];
extern int nPrecacheCount;
extern char precachehightile[2][(MAXTILES+7)>>3];
extern int32_t MAXCACHE1DSIZE;
void qloadvoxel(int32_t nVoxel); void qloadvoxel(int32_t nVoxel);
void CalcPicsiz(int a1, int a2, int a3); void CalcPicsiz(int a1, int a2, int a3);
int tileInit(char a1, const char *a2); int tileInit(char a1, const char *a2);