From 8a62b884cc6bdbce162d25c4cfecc15eb5e8bf84 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Fri, 22 Sep 2023 20:37:52 +0200 Subject: [PATCH] port: make crosshair sway resolution independent this might suck --- src/game/bondmove.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/game/bondmove.c b/src/game/bondmove.c index 173452f00..1e2cb6f0c 100644 --- a/src/game/bondmove.c +++ b/src/game/bondmove.c @@ -2029,14 +2029,15 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i x = g_Vars.currentplayer->speedtheta * 0.3f + g_Vars.currentplayer->gunextraaimx; y = -g_Vars.currentplayer->speedverta * 0.1f + g_Vars.currentplayer->gunextraaimy; #else - f32 scale; + f32 xscale, yscale; if (movedata.freelookdx || movedata.freelookdy) { - scale = g_PlayerCrosshairSway * 240.f / (f32)videoGetHeight(); + xscale = g_PlayerCrosshairSway * 0.20f; + yscale = g_PlayerCrosshairSway * 0.30f; } else { - scale = g_PlayerCrosshairSway; + xscale = yscale = g_PlayerCrosshairSway; } - x = g_Vars.currentplayer->speedtheta * 0.3f * scale + g_Vars.currentplayer->gunextraaimx; - y = -g_Vars.currentplayer->speedverta * 0.1f * scale + g_Vars.currentplayer->gunextraaimy; + x = g_Vars.currentplayer->speedtheta * 0.3f * xscale + g_Vars.currentplayer->gunextraaimx; + y = -g_Vars.currentplayer->speedverta * 0.1f * yscale + g_Vars.currentplayer->gunextraaimy; #endif bgunSwivelWithDamp(x, y, PAL ? 0.955f : 0.963f);