From c35887f5ee44bccbb68a3e41118107f727114b23 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 17 Jun 2024 12:52:09 +0200 Subject: [PATCH] Revert "fix some interpolation issues" This reverts commit e19f6f6656409b6a487dbb6f761ff3bc90daea33. --- src/g_game.c | 2 -- src/p_telept.c | 6 +----- src/p_tick.c | 8 +------- src/p_user.c | 1 + src/r_fps.c | 13 ++----------- 5 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 8352d0b98..aaa6b6fbe 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2117,8 +2117,6 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive) { camerap = &camera[viewnum-1]; P_ResetCamera(&players[(*displayplayerp)], camerap); - - R_ResetViewInterpolation(viewnum); } if (viewnum > splits) diff --git a/src/p_telept.c b/src/p_telept.c index 9229079c9..7c9da2269 100644 --- a/src/p_telept.c +++ b/src/p_telept.c @@ -82,12 +82,8 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, // move chasecam at new player location for (i = 0; i <= splitscreen; i++) { - if (thing->player != &players[displayplayers[i]]) - continue; - if (camera[i].chase) + if (thing->player == &players[displayplayers[i]] && camera[i].chase) P_ResetCamera(thing->player, &camera[i]); - R_ResetViewInterpolation(i + 1); - break; } // don't run in place after a teleport diff --git a/src/p_tick.c b/src/p_tick.c index 6416142ce..183c42a4b 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -581,13 +581,6 @@ void P_Ticker(boolean run) if (playeringame[i]) ++players[i].jointime; - 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()) @@ -834,6 +827,7 @@ 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 diff --git a/src/p_user.c b/src/p_user.c index 3bee5abcd..de3ac7367 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3962,6 +3962,7 @@ 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); diff --git a/src/r_fps.c b/src/r_fps.c index 52a89098f..48990876a 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -23,8 +23,6 @@ #include "r_state.h" #include "z_zone.h" #include "console.h" // con_startup_loadprogress -#include "i_time.h" - #ifdef HWRENDER #include "hardware/hw_main.h" // for cv_grshearing #endif @@ -82,7 +80,6 @@ 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]; @@ -203,27 +200,21 @@ 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] = t; + oldview_invalid[i]++; } } else { - oldview_invalid[p - 1] = t; + oldview_invalid[p - 1]++; } }