Fix compiling errors

# Conflicts:
#	platform/Windows/pcexhumed.vcxproj
#	source/platform/win32/startwin.game.cpp
This commit is contained in:
nukeykt 2019-11-23 00:57:42 +09:00 committed by Christoph Oelckers
parent a55ea9a55c
commit af5f5aad77
4 changed files with 48 additions and 39 deletions

View file

@ -511,6 +511,8 @@ int32_t g_noAutoLoad = 0;
int g_useCwd; int g_useCwd;
int32_t g_groupFileHandle; int32_t g_groupFileHandle;
static struct strllist *CommandPaths, *CommandGrps;
void G_ExtPreInit(int32_t argc,char const * const * argv) void G_ExtPreInit(int32_t argc,char const * const * argv)
{ {
g_useCwd = G_CheckCmdSwitch(argc, argv, "-usecwd"); g_useCwd = G_CheckCmdSwitch(argc, argv, "-usecwd");
@ -738,8 +740,6 @@ void G_LoadGroups(int32_t autoload)
////////// //////////
struct strllist *CommandPaths, *CommandGrps;
void G_AddGroup(const char *buffer) void G_AddGroup(const char *buffer)
{ {
char buf[BMAX_PATH]; char buf[BMAX_PATH];
@ -789,7 +789,7 @@ void G_LoadGroupsInDir(const char *dirname)
for (auto & extension : extensions) for (auto & extension : extensions)
{ {
CACHE1D_FIND_REC *rec; BUILDVFS_FIND_REC *rec;
fnlist_getnames(&fnlist, dirname, extension, -1, 0); fnlist_getnames(&fnlist, dirname, extension, -1, 0);
@ -1253,13 +1253,13 @@ void timerhandler()
nCDTrackLength--; nCDTrackLength--;
} }
} }
if (!bInMove)
OSD_DispatchQueued();
} }
void HandleAsync() void HandleAsync()
{ {
handleevents(); handleevents();
if (!bInMove)
OSD_DispatchQueued();
} }
int MyGetStringWidth(const char *str) int MyGetStringWidth(const char *str)
@ -2206,7 +2206,7 @@ int app_main(int argc, char const* const* argv)
char tempbuf[256]; char tempbuf[256];
#ifdef _WIN32 #ifdef _WIN32
#ifndef DEBUGGINGAIDS #ifndef DEBUGGINGAIDS
if (!G_CheckCmdSwitch(argc, argv, "-noinstancechecking") && win_checkinstance()) if (!G_CheckCmdSwitch(argc, argv, "-noinstancechecking") && !windowsCheckAlreadyRunning())
{ {
#ifdef EDUKE32_STANDALONE #ifdef EDUKE32_STANDALONE
if (!wm_ynbox(APPNAME, "It looks like " APPNAME " is already running.\n\n" if (!wm_ynbox(APPNAME, "It looks like " APPNAME " is already running.\n\n"
@ -2218,8 +2218,6 @@ int app_main(int argc, char const* const* argv)
} }
#endif #endif
backgroundidle = 0;
#ifndef USE_PHYSFS #ifndef USE_PHYSFS
#ifdef DEBUGGINGAIDS #ifdef DEBUGGINGAIDS
extern int32_t (*check_filename_casing_fn)(void); extern int32_t (*check_filename_casing_fn)(void);
@ -3009,9 +3007,17 @@ LOOP3:
} }
else else
{ {
static bool frameJustDrawn;
bInMove = kTrue; bInMove = kTrue;
if (!bPause && totalclock >= tclocks + 4) if (!bPause && totalclock >= tclocks + 4)
{ {
do
{
if (!frameJustDrawn)
break;
frameJustDrawn = false;
GetLocalInput(); GetLocalInput();
sPlayerInput[nLocalPlayer].xVel = lPlayerXVel; sPlayerInput[nLocalPlayer].xVel = lPlayerXVel;
@ -3029,11 +3035,12 @@ LOOP3:
do do
{ {
timerUpdate(); // timerUpdate();
tclocks += 4; tclocks += 4;
GameMove(); GameMove();
timerUpdate(); // timerUpdate();
} while (levelnew < 0 && totalclock >= tclocks + 4); } while (levelnew < 0 && totalclock >= tclocks + 4);
} while (0);
} }
bInMove = kFalse; bInMove = kFalse;
@ -3042,6 +3049,7 @@ LOOP3:
if (G_FPSLimit()) if (G_FPSLimit())
{ {
GameDisplay(); GameDisplay();
frameJustDrawn = true;
} }
} }
if (!bInDemo) if (!bInDemo)

View file

@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h" #include "compat.h"
#include "cache1d.h" #include "cache1d.h"
#include "vfs.h"
#include "grpscan.h" #include "grpscan.h"
#define kTimerTicks 120 #define kTimerTicks 120

View file

@ -174,9 +174,9 @@ static void LoadGameList(void)
#else #else
static char const base[] = "/"; static char const base[] = "/";
#endif #endif
CACHE1D_FIND_REC * const srch = klistpath(base, "*.grpinfo", CACHE1D_FIND_FILE); BUILDVFS_FIND_REC * const srch = klistpath(base, "*.grpinfo", BUILDVFS_FIND_FILE);
for (CACHE1D_FIND_REC *sidx = srch; sidx; sidx = sidx->next) for (BUILDVFS_FIND_REC *sidx = srch; sidx; sidx = sidx->next)
LoadList(sidx->name); LoadList(sidx->name);
klistfree(srch); klistfree(srch);
@ -298,9 +298,9 @@ static grpinfo_t const * FindGrpInfo(int32_t crcval, int32_t size)
return NULL; return NULL;
} }
static void ProcessGroups(CACHE1D_FIND_REC *srch) static void ProcessGroups(BUILDVFS_FIND_REC *srch)
{ {
CACHE1D_FIND_REC *sidx; BUILDVFS_FIND_REC *sidx;
struct grpcache *fg, *fgg; struct grpcache *fg, *fgg;
char *fn; char *fn;
struct Bstat st; struct Bstat st;
@ -409,7 +409,7 @@ int32_t ScanGroups(void)
for (char const *extension : extensions) for (char const *extension : extensions)
{ {
CACHE1D_FIND_REC *srch = klistpath("/", extension, CACHE1D_FIND_FILE); BUILDVFS_FIND_REC *srch = klistpath("/", extension, BUILDVFS_FIND_FILE);
ProcessGroups(srch); ProcessGroups(srch);
klistfree(srch); klistfree(srch);
} }

View file

@ -511,7 +511,7 @@ int LoadSound(const char *sound)
int nSize = kfilelength(hVoc); int nSize = kfilelength(hVoc);
SoundLock[i] = 255; // TODO: implement cache lock properly SoundLock[i] = 255; // TODO: implement cache lock properly
SoundLen[i] = nSize; SoundLen[i] = nSize;
cacheAllocateBlock((intptr_t*)&SoundBuf[i], nSize, &SoundLock[i]); g_cache.allocateBlock((intptr_t*)&SoundBuf[i], nSize, &SoundLock[i]);
if (!SoundBuf[i]) if (!SoundBuf[i])
bail2dos("Error allocating buf '%s' to %lld (size=%ld)!\n", buffer, (intptr_t)&SoundBuf[i], nSize); bail2dos("Error allocating buf '%s' to %lld (size=%ld)!\n", buffer, (intptr_t)&SoundBuf[i], nSize);
@ -662,7 +662,7 @@ void SoundBigEntrance(void)
CalcASSPan(63-(i&1)*127, 200, &nLeft, &nRight); CalcASSPan(63-(i&1)*127, 200, &nLeft, &nRight);
if (pASound->f_e >= 0) if (pASound->f_e >= 0)
FX_StopSound(pASound->f_e); FX_StopSound(pASound->f_e);
pASound->f_e = FX_Play(SoundBuf[kSoundTorchOn], SoundLen[kSoundTorchOn], -1, 0, 0, max(nLeft, nRight), nLeft, nRight, 0, 1.f, i); pASound->f_e = FX_Play(SoundBuf[kSoundTorchOn], SoundLen[kSoundTorchOn], -1, 0, 0, max(nLeft, nRight), nLeft, nRight, 0, fix16_one, i);
if (pASound->f_e > -1) if (pASound->f_e > -1)
FX_SetFrequency(pASound->f_e, 11000+nPitch); FX_SetFrequency(pASound->f_e, 11000+nPitch);
} }
@ -693,7 +693,7 @@ void StartSwirly(int nActiveSound)
CalcASSPan(nPan, nVolume, &nLeft, &nRight); CalcASSPan(nPan, nVolume, &nLeft, &nRight);
if (pASound->f_e >= 0) if (pASound->f_e >= 0)
FX_StopSound(pASound->f_e); FX_StopSound(pASound->f_e);
pASound->f_e = FX_Play(SoundBuf[StaticSound[kSound67]], SoundLen[StaticSound[kSound67]], -1, 0, 0, max(nLeft, nRight), nLeft, nRight, 0, 1.f, nActiveSound); pASound->f_e = FX_Play(SoundBuf[StaticSound[kSound67]], SoundLen[StaticSound[kSound67]], -1, 0, 0, max(nLeft, nRight), nLeft, nRight, 0, fix16_one, nActiveSound);
if (pASound->f_e > -1) if (pASound->f_e > -1)
FX_SetFrequency(pASound->f_e, nPitch); FX_SetFrequency(pASound->f_e, nPitch);
@ -922,7 +922,7 @@ void PlaySound(int nSound)
if (handle >= 0) if (handle >= 0)
FX_StopSound(handle); FX_StopSound(handle);
handle = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, gFXVolume, gFXVolume, gFXVolume, 0, 1.f, -1); handle = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, gFXVolume, gFXVolume, gFXVolume, 0, fix16_one, -1);
#if 0 #if 0
AIL_init_sample(handle); AIL_init_sample(handle);
@ -956,7 +956,7 @@ void PlayLocalSound(short nSound, short nRate)
if (pASound->f_e >= 0) if (pASound->f_e >= 0)
FX_StopSound(pASound->f_e); FX_StopSound(pASound->f_e);
pASound->f_e = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, gFXVolume, gFXVolume, gFXVolume, 0, 1.f, nLocalChan); pASound->f_e = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, gFXVolume, gFXVolume, gFXVolume, 0, fix16_one, nLocalChan);
if (nRate) if (nRate)
{ {
@ -1165,7 +1165,7 @@ short PlayFX2(unsigned short nSound, short nSprite)
CalcASSPan(nPan, nVolume>>1, &nLeft, &nRight); CalcASSPan(nPan, nVolume>>1, &nLeft, &nRight);
vdi->f_e = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, max(nLeft, nRight), nLeft, nRight, 0, 1.f, vdi-sActiveSound); vdi->f_e = FX_Play(SoundBuf[nSound], SoundLen[nSound], bLoop ? 0 : -1, 0, 0, max(nLeft, nRight), nLeft, nRight, 0, fix16_one, vdi-sActiveSound);
if (nPitch) if (nPitch)
{ {