From b2823c81e46fdc077f38addc2b5b363cbd5ad51e Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 28 Dec 2024 04:09:43 +0100 Subject: [PATCH] fix jitter when toggling freecam off --- src/g_game.c | 4 +--- src/g_game.h | 2 ++ src/p_user.c | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 18c67e4f9..385b7b6cf 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -358,8 +358,6 @@ void SendWeaponPref2(void); void SendWeaponPref3(void); void SendWeaponPref4(void); -static void G_FixCamera(UINT8 view); - // don't mind me putting these here, I was lazy to figure out where else I could put those without blowing up the compiler. // chat timer thingy @@ -1701,7 +1699,7 @@ INT32 G_CountPlayersPotentiallyViewable(boolean active) // Reset camera position, angle and interpolation on a view // after changing state. // -static void G_FixCamera(UINT8 view) +void G_FixCamera(UINT8 view) { player_t *player = &players[displayplayers[view - 1]]; diff --git a/src/g_game.h b/src/g_game.h index 3a957d00a..ba26cd507 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -444,4 +444,6 @@ INT16 G_TOLFlag(INT32 pgametype); INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean ignorebuffer, UINT8 maphell, boolean callagainsoon, INT16 *extbuffer); void G_AddMapToBuffer(INT16 map); +void G_FixCamera(UINT8 view); + #endif diff --git a/src/p_user.c b/src/p_user.c index a91bebd79..ce404866e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3154,6 +3154,7 @@ void P_ToggleDemoCamera(UINT8 viewnum) else // toggle off { cam->freecam = false; + G_FixCamera(viewnum+1); } }