mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
R_ResetViewInterpolation: wait an extra tic if R_UpdateViewInterpolation has not run yet, do not add extra time for subsequent calls
This commit is contained in:
parent
7b3010c93d
commit
f2cc5ce36a
1 changed files with 10 additions and 2 deletions
12
src/r_fps.c
12
src/r_fps.c
|
|
@ -22,6 +22,7 @@
|
|||
#include "r_state.h"
|
||||
#include "z_zone.h"
|
||||
#include "console.h" // con_startup_loadprogress
|
||||
#include "i_time.h"
|
||||
|
||||
UINT32 R_GetFramerateCap(void)
|
||||
{
|
||||
|
|
@ -58,6 +59,7 @@ static viewvars_t skyview_old[MAXSPLITSCREENPLAYERS];
|
|||
static viewvars_t skyview_new[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
static viewvars_t *oldview = &pview_old[0];
|
||||
static tic_t last_view_update;
|
||||
static int oldview_invalid[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||
viewvars_t *newview = &pview_new[0];
|
||||
|
||||
|
|
@ -165,21 +167,27 @@ void R_UpdateViewInterpolation(void)
|
|||
skyview_old[i] = skyview_new[i];
|
||||
if (oldview_invalid[i] > 0) oldview_invalid[i]--;
|
||||
}
|
||||
|
||||
last_view_update = I_GetTime();
|
||||
}
|
||||
|
||||
void R_ResetViewInterpolation(UINT8 p)
|
||||
{
|
||||
// Wait an extra tic if the interpolation state hasn't
|
||||
// updated yet.
|
||||
int t = last_view_update == I_GetTime() ? 1 : 2;
|
||||
|
||||
if (p == 0)
|
||||
{
|
||||
UINT8 i;
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
oldview_invalid[i]++;
|
||||
oldview_invalid[i] = t;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oldview_invalid[p - 1]++;
|
||||
oldview_invalid[p - 1] = t;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue