mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-22 09:11:21 +00:00
Adjust how FPS cap is checked to improve FPS stability
This commit is contained in:
parent
6e5e74b25f
commit
53c71d35bc
1 changed files with 20 additions and 5 deletions
25
src/d_main.c
25
src/d_main.c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue