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
This commit is contained in:
hendricks266 2019-08-17 22:33:33 +00:00 committed by Christoph Oelckers
parent cbec65be68
commit c0cf31a28c

View file

@ -2918,29 +2918,26 @@ void P_GetInput(int const playerNum)
CONTROL_GetInput(&info); CONTROL_GetInput(&info);
#if 0
// these don't seem to have an on switch
if (ud.config.MouseDeadZone) if (ud.config.MouseDeadZone)
{ {
if (info.dpitch > 0) if (info.mousey > 0)
info.dpitch = max(info.dpitch - ud.config.MouseDeadZone, 0); info.mousey = max(info.mousey - ud.config.MouseDeadZone, 0);
else if (info.dpitch < 0) else if (info.mousey < 0)
info.dpitch = min(info.dpitch + ud.config.MouseDeadZone, 0); info.mousey = min(info.mousey + ud.config.MouseDeadZone, 0);
if (info.dyaw > 0) if (info.mousex > 0)
info.dyaw = max(info.dyaw - ud.config.MouseDeadZone, 0); info.mousex = max(info.mousex - ud.config.MouseDeadZone, 0);
else if (info.dyaw < 0) else if (info.mousex < 0)
info.dyaw = min(info.dyaw + ud.config.MouseDeadZone, 0); info.mousex = min(info.mousex + ud.config.MouseDeadZone, 0);
} }
if (ud.config.MouseBias) if (ud.config.MouseBias)
{ {
if (klabs(info.dyaw) > klabs(info.dpitch)) if (klabs(info.mousex) > klabs(info.mousey))
info.dpitch = tabledivide32_noinline(info.dpitch, ud.config.MouseBias); info.mousey = tabledivide32_noinline(info.mousey, ud.config.MouseBias);
else info.dyaw = tabledivide32_noinline(info.dyaw, ud.config.MouseBias); else
info.mousex = tabledivide32_noinline(info.mousex, ud.config.MouseBias);
} }
#endif
// JBF: Run key behaviour is selectable // JBF: Run key behaviour is selectable
int const playerRunning = (ud.runkey_mode) ? (BUTTON(gamefunc_Run) | ud.auto_run) : (ud.auto_run ^ BUTTON(gamefunc_Run)); int const playerRunning = (ud.runkey_mode) ? (BUTTON(gamefunc_Run) | ud.auto_run) : (ud.auto_run ^ BUTTON(gamefunc_Run));