Merge branch 'fix-reset-interpolation' into 'master'

P_Ticker: update view interpolation at the start of a tic

See merge request KartKrew/Kart!1192
This commit is contained in:
Sal 2023-04-25 01:50:51 +00:00
commit 0fb691022b
7 changed files with 10 additions and 11 deletions

View file

@ -2091,8 +2091,6 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive)
camerap = &camera[viewnum-1];
P_ResetCamera(&players[(*displayplayerp)], camerap);
// Why does it need to be done twice?
R_ResetViewInterpolation(viewnum);
R_ResetViewInterpolation(viewnum);
}

View file

@ -150,7 +150,6 @@ public:
// all into its new position -- just snap
// instantly into place.
R_ResetViewInterpolation(1 + i);
R_ResetViewInterpolation(1 + i); // (Why does it need to be called twice?)
}
r_splitscreen = size() - 1;

View file

@ -8119,7 +8119,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
if (rendermode != render_none && reloadinggamestate == false)
{
R_ResetViewInterpolation(0);
R_ResetViewInterpolation(0);
R_UpdateMobjInterpolators();

View file

@ -2853,11 +2853,7 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
y = args[3] << FRACBITS;
z = args[4] << FRACBITS;
P_UnsetThingPosition(mo);
mo->x += x;
mo->y += y;
mo->z += z;
P_SetThingPosition(mo);
P_SetOrigin(mo, mo->x + x, mo->y + y, mo->z + z);
if (mo->player)
{

View file

@ -169,6 +169,8 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
P_ResetCamera(thing->player, &camera[i]);
}
R_ResetViewInterpolation(1 + i);
break;
}
}

View file

@ -646,6 +646,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())
@ -982,7 +989,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

View file

@ -3603,7 +3603,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);