Adjust how FPS cap is checked to improve FPS stability

This commit is contained in:
Sally Coolatta 2022-04-16 02:58:43 -04:00 committed by Eidolon
parent 6e5e74b25f
commit 53c71d35bc

View file

@ -723,6 +723,7 @@ void D_SRB2Loop(void)
boolean ticked; boolean ticked;
boolean interp; boolean interp;
boolean doDisplay = false; boolean doDisplay = false;
boolean frameCap = false;
if (dedicated) if (dedicated)
server = true; server = true;
@ -803,11 +804,25 @@ void D_SRB2Loop(void)
doDisplay = false; doDisplay = false;
ticked = false; ticked = false;
if (!realtics && !singletics && !interp) frameCap = false;
if (interp)
{ {
// Non-interp sleep frameCap = D_CheckFrameCap();
I_Sleep(); }
continue;
if (!realtics && !singletics)
{
if (interp)
{
if (frameCap)
continue;
}
else
{
// Non-interp sleep
I_Sleep();
continue;
}
} }
#ifdef HW3SOUND #ifdef HW3SOUND
@ -869,7 +884,7 @@ void D_SRB2Loop(void)
// TryRunTics needs ran if possible to prevent lagged map changes, // TryRunTics needs ran if possible to prevent lagged map changes,
// (and if that runs, the code above needs to also run) // (and if that runs, the code above needs to also run)
// so this is done here after TryRunTics. // so this is done here after TryRunTics.
if (D_CheckFrameCap()) if (frameCap)
{ {
continue; continue;
} }