From 806252320efb444b8369b4414003296cb00005c9 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Tue, 25 Oct 2022 19:32:28 -0500 Subject: [PATCH] Ensure view interpolates between T-1 to T --- src/p_tick.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/p_tick.c b/src/p_tick.c index 16fb069b..fcc09ea6 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -23,6 +23,7 @@ #include "lua_script.h" #include "lua_hook.h" #include "k_kart.h" +#include "r_main.h" #include "r_fps.h" // Object place @@ -813,6 +814,20 @@ void P_Ticker(boolean run) { R_UpdateLevelInterpolators(); R_UpdateViewInterpolation(); + + // Hack: ensure newview is assigned every tic. + // Ensures view interpolation is T-1 to T in poor network conditions + // We need a better way to assign view state decoupled from game logic + for (i = 0; i <= splitscreen; i++) + { + player_t *player = &players[displayplayers[i]]; + BOOL skyVisible = skyVisiblePerPlayer[i]; + if (skyVisible && skyboxmo[0] && cv_skybox.value) + { + R_SkyboxFrame(player); + } + R_SetupFrame(player, (skyboxmo[0] && cv_skybox.value)); + } } P_MapEnd();