Blood: reduce handleevents calls

This commit is contained in:
nukeykt 2020-01-29 22:19:05 +09:00 committed by Christoph Oelckers
parent 5ebc65a1fb
commit 371b613ebe
3 changed files with 18 additions and 22 deletions

View file

@ -1173,28 +1173,11 @@ RESTART:
ready2send = 1; ready2send = 1;
while (!gQuitGame) while (!gQuitGame)
{ {
handleevents();
netUpdate();
inputState.SetBindsEnabled(gInputMode == kInputGame);
switch (gInputMode)
{
case kInputGame:
LocalKeys();
break;
default:
break;
}
if (gQuitGame)
continue;
OSD_DispatchQueued();
bool bDraw; bool bDraw;
if (gGameStarted) if (gGameStarted)
{ {
char gameUpdate = false; char gameUpdate = false;
double const gameUpdateStartTime = timerGetHiTicks(); double const gameUpdateStartTime = timerGetHiTicks();
gameHandleEvents();
while (gPredictTail < gNetFifoHead[myconnectindex] && !gPaused) while (gPredictTail < gNetFifoHead[myconnectindex] && !gPaused)
{ {
viewUpdatePrediction(&gFifoInput[gPredictTail&255][myconnectindex]); viewUpdatePrediction(&gFifoInput[gPredictTail&255][myconnectindex]);
@ -1246,12 +1229,26 @@ RESTART:
videoClearScreen(0); videoClearScreen(0);
rotatesprite(160<<16,100<<16,65536,0,2518,0,0,0x4a,0,0,xdim-1,ydim-1); rotatesprite(160<<16,100<<16,65536,0,2518,0,0,0x4a,0,0,xdim-1,ydim-1);
} }
gameHandleEvents();
if (gQuitRequest && !gQuitGame) if (gQuitRequest && !gQuitGame)
netBroadcastMyLogoff(gQuitRequest == 2); netBroadcastMyLogoff(gQuitRequest == 2);
} }
if (bDraw) if (bDraw)
{ {
gameHandleEvents();
inputState.SetBindsEnabled(gInputMode == kInputGame);
switch (gInputMode)
{
case kInputGame:
LocalKeys();
break;
default:
break;
}
if (gQuitGame)
continue;
OSD_DispatchQueued();
switch (gInputMode) switch (gInputMode)
{ {
case kInputMessage: case kInputMessage:
@ -1301,9 +1298,9 @@ RESTART:
while (gGameMenuMgr.m_bActive) while (gGameMenuMgr.m_bActive)
{ {
gGameMenuMgr.Process(); gGameMenuMgr.Process();
gameHandleEvents();
if (G_FPSLimit()) if (G_FPSLimit())
{ {
gameHandleEvents();
videoClearScreen(0); videoClearScreen(0);
gGameMenuMgr.Draw(); gGameMenuMgr.Draw();
videoNextPage(); videoNextPage();

View file

@ -316,8 +316,6 @@ void CDemo::Playback(void)
_DEMOPLAYBACK: _DEMOPLAYBACK:
while (at1 && !gQuitGame) while (at1 && !gQuitGame)
{ {
handleevents();
D_ProcessEvents();
while (totalclock >= gNetFifoClock && !gQuitGame) while (totalclock >= gNetFifoClock && !gQuitGame)
{ {
if (!v4) if (!v4)
@ -387,6 +385,8 @@ _DEMOPLAYBACK:
} }
if (G_FPSLimit()) if (G_FPSLimit())
{ {
handleevents();
D_ProcessEvents();
viewDrawScreen(); viewDrawScreen();
videoNextPage(); videoNextPage();
} }

View file

@ -3071,7 +3071,6 @@ void viewDrawScreen(bool sceneonly)
#ifdef USE_OPENGL #ifdef USE_OPENGL
polymostcenterhoriz = defaultHoriz; polymostcenterhoriz = defaultHoriz;
#endif #endif
gameHandleEvents();
ClockTicks delta = totalclock - lastUpdate; ClockTicks delta = totalclock - lastUpdate;
if (delta < 0) if (delta < 0)
delta = 0; delta = 0;