From df415605ae2e875912acbf9d19770ed42a378318 Mon Sep 17 00:00:00 2001 From: nukeykt Date: Thu, 24 Oct 2019 23:51:55 +0900 Subject: [PATCH] Use gameHandleEvents for time updating # Conflicts: # source/blood/src/gui.cpp --- source/blood/src/blood.cpp | 2 -- source/blood/src/credits.cpp | 9 +++++---- source/blood/src/network.cpp | 1 - source/blood/src/view.cpp | 3 +-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index bf09a4920..47d436999 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -1763,10 +1763,8 @@ RESTART: break; faketimerhandler(); ProcessFrame(); - timerUpdateClock(); gameUpdate = true; } - timerUpdateClock(); } if (gameUpdate) { diff --git a/source/blood/src/credits.cpp b/source/blood/src/credits.cpp index 0ccd436a7..ebb8ed80e 100644 --- a/source/blood/src/credits.cpp +++ b/source/blood/src/credits.cpp @@ -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(); diff --git a/source/blood/src/network.cpp b/source/blood/src/network.cpp index 293156658..695889aa4 100644 --- a/source/blood/src/network.cpp +++ b/source/blood/src/network.cpp @@ -1375,7 +1375,6 @@ void netUpdate(void) void faketimerhandler(void) { - timerUpdateClock(); #ifndef NETCODE_DISABLE if (gNetMode != NETWORK_NONE && gNetENetInit) netUpdate(); diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 799ca7b39..9df6d49a5 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -3023,8 +3023,7 @@ void viewDrawScreen(void) #ifdef USE_OPENGL polymostcenterhoriz = defaultHoriz; #endif - - timerUpdateClock(); + gameHandleEvents(); ClockTicks delta = totalclock - lastUpdate; if (delta < 0) delta = 0;