mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Do the alternative interp failsafe CORRECTLY.
This commit is contained in:
parent
d00f2e0622
commit
12353c2d6f
1 changed files with 5 additions and 9 deletions
14
src/d_main.c
14
src/d_main.c
|
|
@ -791,23 +791,19 @@ void D_SRB2Loop(void)
|
||||||
if (interp && !(paused || P_AutoPause()))
|
if (interp && !(paused || P_AutoPause()))
|
||||||
{
|
{
|
||||||
static float tictime = 0.0f;
|
static float tictime = 0.0f;
|
||||||
|
static float prevtime = 0.0f;
|
||||||
float entertime = I_GetTimeFrac();
|
float entertime = I_GetTimeFrac();
|
||||||
fixed_t entertimefrac;
|
fixed_t entertimefrac;
|
||||||
|
|
||||||
#if 1
|
|
||||||
(void)ticked;
|
|
||||||
//CONS_Printf("Avg FPS: %f, diff: %f\n========\n", averageFPS, entertime - tictime);
|
|
||||||
entertimefrac = min(FRACUNIT, FLOAT_TO_FIXED(entertime - tictime));
|
|
||||||
tictime = entertime;
|
|
||||||
#else
|
|
||||||
if (ticked)
|
if (ticked)
|
||||||
tictime = entertime;
|
tictime = entertime;
|
||||||
|
|
||||||
if (averageFPS < 35.0) // Not convinced it should be doing it this way, but couldn't figure out anything better...
|
if (entertime - prevtime >= 1.0f) // Lagged for more frames than a gametic... shut off interpolation.
|
||||||
entertimefrac = FRACUNIT;
|
entertimefrac = FRACUNIT;
|
||||||
else
|
else
|
||||||
entertimefrac = FLOAT_TO_FIXED(entertime - tictime);
|
entertimefrac = min(FRACUNIT, FLOAT_TO_FIXED(entertime - tictime));
|
||||||
#endif
|
|
||||||
|
prevtime = entertime;
|
||||||
|
|
||||||
// renderdeltatics is a bit awkard to evaluate, since the system time interface is whole tic-based
|
// renderdeltatics is a bit awkard to evaluate, since the system time interface is whole tic-based
|
||||||
renderdeltatics = realtics * FRACUNIT;
|
renderdeltatics = realtics * FRACUNIT;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue