From f1e67616a9d701cc3e3b75f89dea62650d655991 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 10 Aug 2019 23:29:31 +0000 Subject: [PATCH] Fix how analog axis values are used by the game code, part 1: movement. Turning and looking will require me to disentangle CONTROL_GetMouseDelta from the rest of CONTROL_PollDevices. git-svn-id: https://svn.eduke32.com/eduke32@7946 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/player.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index d5e41118b..4960e361a 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -2926,6 +2926,9 @@ void P_GetInput(int const playerNum) CONTROL_GetInput(&info); +#if 0 + // these don't seem to have an on switch + if (ud.config.MouseDeadZone) { if (info.dpitch > 0) @@ -2945,6 +2948,7 @@ void P_GetInput(int const playerNum) info.dpitch = tabledivide32_noinline(info.dpitch, ud.config.MouseBias); else info.dyaw = tabledivide32_noinline(info.dyaw, ud.config.MouseBias); } +#endif // JBF: Run key behaviour is selectable int const playerRunning = (ud.runkey_mode) ? (BUTTON(gamefunc_Run) | ud.auto_run) : (ud.auto_run ^ BUTTON(gamefunc_Run)); @@ -2965,12 +2969,12 @@ void P_GetInput(int const playerNum) if (ud.mouseflip) input.q16horz = -input.q16horz; - input.svel -= info.dx; - input.fvel = -info.dz >> 6; - int const turnAmount = playerRunning ? (NORMALTURN << 1) : NORMALTURN; int const keyMove = playerRunning ? (NORMALKEYMOVE << 1) : NORMALKEYMOVE; + input.svel -= (info.dx * keyMove / 10000); + input.fvel = -(info.dz * keyMove / 10000); + if (BUTTON(gamefunc_Strafe)) { if (BUTTON(gamefunc_Turn_Left) && !(pPlayer->movement_lock&4))