From 4d183299466dd48400ccce22d1da6f2d1e08ec0a Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Thu, 5 May 2022 00:04:14 -0400 Subject: [PATCH] Revert to before screenUpdate boolean was added Was done this way for the sake of an older version of uncapped's timing; now that the new timing is much better, I decided it should remain as close to pre-uncapped as it can be. --- src/d_main.c | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 2ff4bb1f6..3786efd07 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -298,17 +298,17 @@ gamestate_t wipegamestate = GS_LEVEL; INT16 wipetypepre = -1; INT16 wipetypepost = -1; -static boolean D_Display(void) +static void D_Display(void) { boolean forcerefresh = false; static boolean wipe = false; INT32 wipedefindex = 0; if (dedicated) - return false; + return; if (nodrawers) - return false; // for comparative timing/profiling + return; // for comparative timing/profiling // Lactozilla: Switching renderers works by checking // if the game has to do it right when the frame @@ -682,10 +682,10 @@ static boolean D_Display(void) M_DrawPerfStats(); } - return true; // Do I_FinishUpdate in the main loop + PS_START_TIMING(ps_swaptime); + I_FinishUpdate(); // page flip or blit buffer + PS_STOP_TIMING(ps_swaptime); } - - return false; } // ========================================================================= @@ -703,7 +703,6 @@ void D_SRB2Loop(void) boolean interp = false; boolean doDisplay = false; - boolean screenUpdate = false; if (dedicated) server = true; @@ -793,7 +792,7 @@ void D_SRB2Loop(void) #endif interp = R_UsingFrameInterpolation() && !dedicated; - doDisplay = screenUpdate = false; + doDisplay = false; #ifdef HW3SOUND HW3S_BeginFrameUpdate(); @@ -871,10 +870,16 @@ void D_SRB2Loop(void) if (interp || doDisplay) { - screenUpdate = D_Display(); + D_Display(); } - // consoleplayer -> displayplayer (hear sounds from viewpoint) + // Only take screenshots after drawing. + if (moviemode) + M_SaveFrame(); + if (takescreenshot) + M_DoScreenShot(); + + // consoleplayer -> displayplayers (hear sounds from viewpoint) S_UpdateSounds(); // move positional sounds S_UpdateClosedCaptions(); @@ -884,21 +889,6 @@ void D_SRB2Loop(void) LUA_Step(); - // I_FinishUpdate is now here instead of D_Display, - // because it synchronizes it more closely with the frame counter. - if (screenUpdate == true) - { - PS_START_TIMING(ps_swaptime); - I_FinishUpdate(); // page flip or blit buffer - PS_STOP_TIMING(ps_swaptime); - } - - // Only take screenshots after drawing. - if (moviemode) - M_SaveFrame(); - if (takescreenshot) - M_DoScreenShot(); - // Fully completed frame made. finishprecise = I_GetPreciseTime(); if (!singletics)