From 11e318b70fe9c0f9691c92e506c8e5094c5acf2d Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 15 Nov 2023 10:32:54 +0100 Subject: [PATCH] port: mouselook speed now independent of framerate --- src/game/bondeyespy.c | 2 -- src/game/bondmove.c | 5 +++-- src/game/player.c | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/game/bondeyespy.c b/src/game/bondeyespy.c index bd9439e0c..fe281cc84 100644 --- a/src/game/bondeyespy.c +++ b/src/game/bondeyespy.c @@ -922,8 +922,6 @@ void eyespyProcessInput(bool allowbuttons) f32 mdx, mdy; inputMouseGetScaledDelta(&mdx, &mdy); if (mdx || mdy) { - mdx *= g_Vars.lvupdate60freal; - mdy *= g_Vars.lvupdate60freal; if (g_Vars.currentplayerstats && !optionsGetForwardPitch(g_Vars.currentplayerstats->mpindex)) { mdy = -mdy; } diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 1a74a6fd2..dcbc70df6 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -714,6 +714,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i #ifndef PLATFORM_N64 const bool allowmlook = (g_Vars.currentplayernum == 0) && (allowc1x || allowc1y); bool allowmcross = false; + const f32 mlookscale = g_Vars.lvupdate240 ? (4.f / (f32)g_Vars.lvupdate240) : 0.25f; #endif controlmode = optionsGetControlMode(g_Vars.currentplayerstats->mpindex); @@ -2017,7 +2018,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } #ifndef PLATFORM_N64 - fVar25 += movedata.freelookdy; + fVar25 += movedata.freelookdy * mlookscale; #endif g_Vars.currentplayer->speedverta = -fVar25 * tmp; @@ -2058,7 +2059,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i } #ifndef PLATFORM_N64 - fVar25 += movedata.freelookdx; + fVar25 += movedata.freelookdx * mlookscale; #endif g_Vars.currentplayer->speedthetacontrol = fVar25 * tmp; diff --git a/src/game/player.c b/src/game/player.c index 8bb27558f..2c8dd90b6 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -3592,8 +3592,8 @@ void playerTick(bool arg0) if (g_Vars.currentplayerstats && !optionsGetForwardPitch(g_Vars.currentplayerstats->mpindex)) { mdy = -mdy; } - sp178 += mdy * LVUPDATE60FREAL() * 0.00025f; - sp174 -= mdx * LVUPDATE60FREAL() * 0.00025f; + sp178 += mdy * 0.00025f; + sp174 -= mdx * 0.00025f; } } #endif