Revert "test: revert all the view interp stuff"

This reverts commit 1a836031a7.
This commit is contained in:
Alug committed 2025-03-23 15:28:59 +01:00
1 parent 1a836031a7
commit 2306d4b59b
8 files changed
+16 -10

No files matched your search

-1
View File
@@ -900,7 +900,6 @@ static void G_BuildLocalTiccmd(ticcmd_t *cmd, UINT8 ssplayer, boolean freecam)
displayplayers[0] = consoleplayer;
R_ResetViewInterpolation(0);
R_ResetViewInterpolation(0);
camera[0].reset_aiming = true;
}
}
-1
View File
@@ -3185,7 +3185,6 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
if (rendermode != render_none && !reloadinggamestate)
{
R_ResetViewInterpolation(0);
R_ResetViewInterpolation(0);
R_UpdateMobjInterpolators();
}
-1
View File
@@ -2455,7 +2455,6 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
if (displayplayers[i] == (mo->player - players))
{
R_ResetViewInterpolation(i + 1);
R_ResetViewInterpolation(i + 1);
}
}
}
-2
View File
@@ -89,7 +89,6 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
P_ResetCamera(thing->player, &camera[i]);
R_ResetViewInterpolation(i + 1);
R_ResetViewInterpolation(i + 1);
}
// don't run in place after a teleport
@@ -166,7 +165,6 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
if (camera[i].chase)
P_ResetCamera(thing->player, &camera[i]);
R_ResetViewInterpolation(i + 1);
R_ResetViewInterpolation(i + 1);
break;
}
+7 -1
View File
@@ -541,6 +541,13 @@ void P_Ticker(boolean run)
}
}
if (run)
{
// Update old view state BEFORE ticking so resetting
// the old interpolation state from game logic works.
R_UpdateViewInterpolation();
}
if (objectplacing)
{
if (OP_FreezeObjectplace())
@@ -772,7 +779,6 @@ void P_Ticker(boolean run)
if (run)
{
R_UpdateLevelInterpolators();
R_UpdateViewInterpolation();
// Hack: ensure newview is assigned every tic.
// Ensures view interpolation is T-1 to T in poor network conditions
-1
View File
@@ -4068,7 +4068,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
{
P_MoveChaseCamera(player, thiscam, false);
R_ResetViewInterpolation(num + 1);
R_ResetViewInterpolation(num + 1);
}
return (x == thiscam->x && y == thiscam->y && z == thiscam->z && angle == thiscam->aiming);
+9 -2
View File
@@ -80,6 +80,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];
@@ -213,21 +214,27 @@ void R_UpdateViewInterpolation(void)
if (oldview_invalid[i]) 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;
}
}
-1
View File
@@ -1215,7 +1215,6 @@ void R_SetupFrame(int s, boolean skybox)
R_SetViewContext(VIEWCONTEXT_PLAYER1 + s);
if (thiscam->reset)
{
R_ResetViewInterpolation(s);
R_ResetViewInterpolation(s);
thiscam->reset = false;
}