mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-08 17:22:18 +00:00
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:
parent
c3340959de
commit
eb6b1f375a
2 changed files with 8 additions and 6 deletions
|
@ -892,15 +892,10 @@ void D_SRB2Loop(void)
|
||||||
LUA_Step();
|
LUA_Step();
|
||||||
|
|
||||||
// Fully completed frame made.
|
// Fully completed frame made.
|
||||||
if (!singletics && !dedicated)
|
if (!singletics)
|
||||||
{
|
{
|
||||||
I_FrameCapSleep(frameEnd);
|
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,
|
// I_FinishUpdate is now here instead of D_Display,
|
||||||
// because it synchronizes it more closely with the frame counter.
|
// because it synchronizes it more closely with the frame counter.
|
||||||
|
|
|
@ -42,6 +42,13 @@ consvar_t cv_fpscap = CVAR_INIT ("fpscap", "Match refresh rate", CV_SAVE, fpscap
|
||||||
|
|
||||||
UINT32 R_GetFramerateCap(void)
|
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)
|
if (cv_fpscap.value == 0)
|
||||||
{
|
{
|
||||||
// 0: Match refresh rate
|
// 0: Match refresh rate
|
||||||
|
|
Loading…
Reference in a new issue