From c0cf31a28c78205930f9e4c7cfd732c9d0e0e523 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 17 Aug 2019 22:33:33 +0000 Subject: [PATCH] Re-enable mouse dead zone and mouse bias in input code, follow-up to r8028 git-svn-id: https://svn.eduke32.com/eduke32@8037 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/player.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index d4f379ff4..ab09cf15d 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -2918,29 +2918,26 @@ 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) - info.dpitch = max(info.dpitch - ud.config.MouseDeadZone, 0); - else if (info.dpitch < 0) - info.dpitch = min(info.dpitch + ud.config.MouseDeadZone, 0); + if (info.mousey > 0) + info.mousey = max(info.mousey - ud.config.MouseDeadZone, 0); + else if (info.mousey < 0) + info.mousey = min(info.mousey + ud.config.MouseDeadZone, 0); - if (info.dyaw > 0) - info.dyaw = max(info.dyaw - ud.config.MouseDeadZone, 0); - else if (info.dyaw < 0) - info.dyaw = min(info.dyaw + ud.config.MouseDeadZone, 0); + if (info.mousex > 0) + info.mousex = max(info.mousex - ud.config.MouseDeadZone, 0); + else if (info.mousex < 0) + info.mousex = min(info.mousex + ud.config.MouseDeadZone, 0); } if (ud.config.MouseBias) { - if (klabs(info.dyaw) > klabs(info.dpitch)) - info.dpitch = tabledivide32_noinline(info.dpitch, ud.config.MouseBias); - else info.dyaw = tabledivide32_noinline(info.dyaw, ud.config.MouseBias); + if (klabs(info.mousex) > klabs(info.mousey)) + info.mousey = tabledivide32_noinline(info.mousey, ud.config.MouseBias); + else + info.mousex = tabledivide32_noinline(info.mousex, 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));