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;
faketimerhandler();
ProcessFrame();
timerUpdateClock();
gameUpdate = true;
}
timerUpdateClock();
}
if (gameUpdate)
{

View file

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

View file

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

View file

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