Adjust joystick axis enum

This commit is contained in:
SwitchKaze 2021-03-26 02:03:52 -05:00
parent 5a247bf375
commit 0db07cef0e
2 changed files with 4 additions and 4 deletions

View file

@ -887,7 +887,7 @@ INT32 JoyAxis(joyaxis_e axissel)
if (retaxis > (+JOYAXISRANGE)) if (retaxis > (+JOYAXISRANGE))
retaxis = +JOYAXISRANGE; retaxis = +JOYAXISRANGE;
if (!Joystick.bGamepadStyle && axissel > JA_DIGITAL) if (!Joystick.bGamepadStyle && axissel >= JA_DIGITAL)
{ {
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_digitaldeadzone.value) >> FRACBITS; const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_digitaldeadzone.value) >> FRACBITS;
if (-jdeadzone < retaxis && retaxis < jdeadzone) if (-jdeadzone < retaxis && retaxis < jdeadzone)
@ -962,7 +962,7 @@ INT32 Joy2Axis(joyaxis_e axissel)
if (retaxis > (+JOYAXISRANGE)) if (retaxis > (+JOYAXISRANGE))
retaxis = +JOYAXISRANGE; retaxis = +JOYAXISRANGE;
if (!Joystick2.bGamepadStyle && axissel > JA_DIGITAL) if (!Joystick2.bGamepadStyle && axissel >= JA_DIGITAL)
{ {
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_digitaldeadzone2.value) >> FRACBITS; const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_digitaldeadzone2.value) >> FRACBITS;
if (-jdeadzone < retaxis && retaxis < jdeadzone) if (-jdeadzone < retaxis && retaxis < jdeadzone)

View file

@ -93,9 +93,9 @@ typedef enum
JA_LOOK, JA_LOOK,
JA_STRAFE, JA_STRAFE,
JA_DIGITAL, // axes below this use digital deadzone JA_DIGITAL, // axes henceforth use digital deadzone
JA_JUMP, JA_JUMP = JA_DIGITAL,
JA_SPIN, JA_SPIN,
JA_FIRE, JA_FIRE,
JA_FIRENORMAL, JA_FIRENORMAL,