From 95216563a6980576d31f219eb770adc72c134a9d Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 18 Mar 2024 04:15:49 -0700 Subject: [PATCH] Interp: do not update view interpolation state during sped-up tics - If you called R_ResetViewInterpolation once but G_Ticker got called more than once, then the effect of R_ResetViewInterpolation would be cancelled - This should be a comprehensive solution to the titlemap camera bug - Multiple tests: - -skipintro - -warp, then exit to title - map command, then exit to title - Wait for attract demo, then skip and exit to title --- src/d_clisrv.c | 15 ++++++++++++++- src/p_tick.c | 7 ------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 1beef9bd4..d337632db 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -66,6 +66,7 @@ #include "music.h" #include "k_bans.h" #include "sanitize.h" +#include "r_fps.h" // cl loading screen #include "v_video.h" @@ -6045,6 +6046,8 @@ boolean TryRunTics(tic_t realtics) if (ticking) { + boolean tickInterp = true; + // run the count * tics while (neededtic > gametic) { @@ -6073,7 +6076,17 @@ boolean TryRunTics(tic_t realtics) P_PostLoadLevel(); } - G_Ticker((gametic % NEWTICRATERATIO) == 0); + 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); } if (Playing() && netgame && (gametic % TICRATE == 0)) diff --git a/src/p_tick.c b/src/p_tick.c index b550310f9..ed89f563b 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -852,13 +852,6 @@ 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())