Use gameHandleEvents for time updating

# Conflicts:
#	source/blood/src/gui.cpp
This commit is contained in:
nukeykt 2019-10-24 23:51:55 +09:00 committed by Christoph Oelckers
parent 01d63d19e9
commit df415605ae
4 changed files with 6 additions and 9 deletions

View file

@ -1763,10 +1763,8 @@ RESTART:
break; break;
faketimerhandler(); faketimerhandler();
ProcessFrame(); ProcessFrame();
timerUpdateClock();
gameUpdate = true; gameUpdate = true;
} }
timerUpdateClock();
} }
if (gameUpdate) if (gameUpdate)
{ {

View file

@ -47,7 +47,7 @@ char Wait(int nTicks)
totalclock = 0; totalclock = 0;
while (totalclock < nTicks) while (totalclock < nTicks)
{ {
timerUpdateClock(); gameHandleEvents();
char key = keyGetScan(); char key = keyGetScan();
if (key) if (key)
{ {
@ -67,7 +67,7 @@ char DoFade(char r, char g, char b, int nTicks)
totalclock = gFrameClock = 0; totalclock = gFrameClock = 0;
do do
{ {
while (totalclock < gFrameClock) { timerUpdateClock();}; while (totalclock < gFrameClock) { gameHandleEvents();};
gFrameClock += 2; gFrameClock += 2;
scrNextPage(); scrNextPage();
scrFadeAmount(divscale16(ClipHigh((int)totalclock, nTicks), nTicks)); scrFadeAmount(divscale16(ClipHigh((int)totalclock, nTicks), nTicks));
@ -86,7 +86,8 @@ char DoUnFade(int nTicks)
totalclock = gFrameClock = 0; totalclock = gFrameClock = 0;
do do
{ {
while (totalclock < gFrameClock) { timerUpdateClock(); }; while (totalclock < gFrameClock) { gameHandleEvents(); };
gFrameClock += 2;
scrNextPage(); scrNextPage();
scrFadeAmount(0x10000-divscale16(ClipHigh((int)totalclock, nTicks), nTicks)); scrFadeAmount(0x10000-divscale16(ClipHigh((int)totalclock, nTicks), nTicks));
if (keyGetScan()) if (keyGetScan())
@ -250,7 +251,7 @@ void credPlaySmk(const char *_pzSMK, const char *_pzWAV, int nWav)
UpdateDacs(0, true); UpdateDacs(0, true);
timerUpdateClock(); gameHandleEvents();
ClockTicks nStartTime = totalclock; ClockTicks nStartTime = totalclock;
ctrlClearAllInput(); ctrlClearAllInput();

View file

@ -1375,7 +1375,6 @@ void netUpdate(void)
void faketimerhandler(void) void faketimerhandler(void)
{ {
timerUpdateClock();
#ifndef NETCODE_DISABLE #ifndef NETCODE_DISABLE
if (gNetMode != NETWORK_NONE && gNetENetInit) if (gNetMode != NETWORK_NONE && gNetENetInit)
netUpdate(); netUpdate();

View file

@ -3023,8 +3023,7 @@ void viewDrawScreen(void)
#ifdef USE_OPENGL #ifdef USE_OPENGL
polymostcenterhoriz = defaultHoriz; polymostcenterhoriz = defaultHoriz;
#endif #endif
gameHandleEvents();
timerUpdateClock();
ClockTicks delta = totalclock - lastUpdate; ClockTicks delta = totalclock - lastUpdate;
if (delta < 0) if (delta < 0)
delta = 0; delta = 0;