mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-22 01:01:45 +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 interp;
|
||||
boolean doDisplay = false;
|
||||
boolean frameCap = false;
|
||||
|
||||
if (dedicated)
|
||||
server = true;
|
||||
|
@ -803,11 +804,25 @@ void D_SRB2Loop(void)
|
|||
doDisplay = false;
|
||||
ticked = false;
|
||||
|
||||
if (!realtics && !singletics && !interp)
|
||||
frameCap = false;
|
||||
if (interp)
|
||||
{
|
||||
// Non-interp sleep
|
||||
I_Sleep();
|
||||
continue;
|
||||
frameCap = D_CheckFrameCap();
|
||||
}
|
||||
|
||||
if (!realtics && !singletics)
|
||||
{
|
||||
if (interp)
|
||||
{
|
||||
if (frameCap)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Non-interp sleep
|
||||
I_Sleep();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HW3SOUND
|
||||
|
@ -869,7 +884,7 @@ void D_SRB2Loop(void)
|
|||
// TryRunTics needs ran if possible to prevent lagged map changes,
|
||||
// (and if that runs, the code above needs to also run)
|
||||
// so this is done here after TryRunTics.
|
||||
if (D_CheckFrameCap())
|
||||
if (frameCap)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue