Allow dedicated to use precise sleep timing again

Instead of only using one old sleep, just enforce framerate cap to match TICRATE.
This commit is contained in:
Sally Coolatta 2022-04-27 17:31:52 -04:00 committed by Eidolon
parent c3340959de
commit eb6b1f375a
2 changed files with 8 additions and 6 deletions

View file

@ -892,15 +892,10 @@ void D_SRB2Loop(void)
LUA_Step();
// Fully completed frame made.
if (!singletics && !dedicated)
if (!singletics)
{
I_FrameCapSleep(frameEnd);
}
else if (dedicated)
{
// Preserve the pre-interp sleeping behavior for dedicated mode
I_Sleep();
}
// I_FinishUpdate is now here instead of D_Display,
// because it synchronizes it more closely with the frame counter.

View file

@ -42,6 +42,13 @@ consvar_t cv_fpscap = CVAR_INIT ("fpscap", "Match refresh rate", CV_SAVE, fpscap
UINT32 R_GetFramerateCap(void)
{
if (rendermode == render_none)
{
// If we're not rendering (dedicated server),
// we shouldn't be using any interpolation.
return TICRATE;
}
if (cv_fpscap.value == 0)
{
// 0: Match refresh rate