From 2f55c10ce3d9e7201b6ec4694654a3b0abf2e459 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 17 Jun 2024 12:52:00 +0200 Subject: [PATCH] Revert "more interp fixes" This reverts commit 3a1a58bcfc7e26147d79454898a77987167887a0. --- src/d_clisrv.c | 17 ++--------------- src/g_game.c | 1 - src/p_spec.c | 7 ++++++- src/p_telept.c | 20 ++++++++------------ src/p_tick.c | 7 +++++++ 5 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 0174dc484..69c87a157 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -48,7 +48,6 @@ #include "s_sound.h" // sfx_syfail #include "m_perfstats.h" #include "d_main.h" -#include "r_fps.h" #ifdef CLIENT_LOADINGSCREEN // cl loading screen @@ -6084,8 +6083,6 @@ boolean TryRunTics(tic_t realtics) if (ticking) { - boolean tickInterp = true; - // run the count * tics while (neededtic > gametic) { @@ -6096,20 +6093,10 @@ boolean TryRunTics(tic_t realtics) if (update_stats) PS_START_TIMING(ps_tictime); - boolean run = (gametic % NEWTICRATERATIO) == 0; - - if (run && tickInterp) - { - // Update old view state BEFORE ticking so resetting - // the old interpolation state from game logic works. - R_UpdateViewInterpolation(); - tickInterp = false; // do not update again in sped-up tics - } - - G_Ticker(run); + G_Ticker((gametic % NEWTICRATERATIO) == 0); ExtraDataTicker(); gametic++; - consistancy[gametic % TICQUEUE] = Consistancy(); + consistancy[gametic%TICQUEUE] = Consistancy(); if (update_stats) { diff --git a/src/g_game.c b/src/g_game.c index 2ce7bd6d1..8352d0b98 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2131,7 +2131,6 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive) (*displayplayerp) = G_FindView(0, viewd, onlyactive, false); P_ResetCamera(&players[(*displayplayerp)], camerap); - R_ResetViewInterpolation(viewd); } } diff --git a/src/p_spec.c b/src/p_spec.c index aace89a2a..9fb1953ee 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2371,7 +2371,11 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) y = sides[line->sidenum[0]].rowoffset; z = line->frontsector->ceilingheight; - P_SetOrigin(mo, mo->x + x, mo->y + y, mo->z + z); + P_UnsetThingPosition(mo); + mo->x += x; + mo->y += y; + mo->z += z; + P_SetThingPosition(mo); if (mo->player) { @@ -2390,6 +2394,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) camera[i].reset = true; camera[i].subsector = R_PointInSubsector(camera[i].x, camera[i].y); R_RelativeTeleportViewInterpolation(i, x, y, z, 0); + R_ResetViewInterpolation(i + 1); // reset view interp as well break; } } diff --git a/src/p_telept.c b/src/p_telept.c index 4e7747315..9229079c9 100644 --- a/src/p_telept.c +++ b/src/p_telept.c @@ -84,10 +84,8 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, { if (thing->player != &players[displayplayers[i]]) continue; - if (camera[i].chase) P_ResetCamera(thing->player, &camera[i]); - R_ResetViewInterpolation(i + 1); break; } @@ -159,16 +157,14 @@ boolean P_Teleport(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; - - localangle[i] = angle; - - if (camera[i].chase) - P_ResetCamera(thing->player, &camera[i]); - - R_ResetViewInterpolation(i + 1); - break; + if (thing->player == &players[displayplayers[i]]) + { + localangle[i] = angle; + if (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 e9c550bc0..6416142ce 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -581,6 +581,13 @@ 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())