From c5648be2bde9c4b148eac1ac4166442342a3930b Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 14 Sep 2020 19:29:12 +1000 Subject: [PATCH] - SW: Properly scale controller input. --- source/sw/src/input.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/sw/src/input.cpp b/source/sw/src/input.cpp index 27a69a885..f4c6fb594 100644 --- a/source/sw/src/input.cpp +++ b/source/sw/src/input.cpp @@ -220,8 +220,7 @@ static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool if (strafeKey) { - svel -= xs_CRoundToInt(hidInput->mousex * 4.); - svel -= hidInput->dyaw * keymove; + svel -= xs_CRoundToInt((hidInput->mousex * 4.) + (scaleAdjust * (hidInput->dyaw * keymove))); } else { @@ -237,15 +236,18 @@ static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool q16horz = -q16horz; q16horz -= FloatToFixed(scaleAdjust * hidInput->dpitch); - svel -= hidInput->dx * keymove; - fvel -= hidInput->dz * keymove; + svel -= xs_CRoundToInt(scaleAdjust * (hidInput->dx * keymove)); + fvel -= xs_CRoundToInt(scaleAdjust * (hidInput->dz * keymove)); if (strafeKey) { - if (buttonMap.ButtonDown(gamefunc_Turn_Left)) - svel += keymove; - if (buttonMap.ButtonDown(gamefunc_Turn_Right)) - svel -= keymove; + if (abs(svel) < keymove) + { + if (buttonMap.ButtonDown(gamefunc_Turn_Left)) + svel += keymove; + if (buttonMap.ButtonDown(gamefunc_Turn_Right)) + svel -= keymove; + } } else {