Revert "Remove game deadzone for Accel/Brake"

This reverts commit 44eeb3a0f3.

# Conflicts:
#	src/m_menu.c
This commit is contained in:
toaster 2022-08-26 21:18:27 +01:00
parent b10c21c504
commit de97c41532
2 changed files with 15 additions and 9 deletions

View file

@ -128,11 +128,11 @@ typedef enum
{ {
AXISNONE = 0, AXISNONE = 0,
AXISTURN, AXISTURN,
AXISMOVE,
AXISBRAKE,
AXISAIM, AXISAIM,
AXISLOOK, AXISLOOK,
AXISDEAD, //Axises that don't want deadzones AXISDEAD, //Axises that don't want deadzones
AXISMOVE,
AXISBRAKE,
AXISFIRE, AXISFIRE,
AXISDRIFT, AXISDRIFT,
AXISLOOKBACK, AXISLOOKBACK,

View file

@ -2627,21 +2627,27 @@ boolean M_Responder(event_t *ev)
accelaxis /= 2; accelaxis /= 2;
if (ev->data1 == accelaxis) if (ev->data1 == accelaxis)
{ {
const INT32 jacceldeadzone = xmode ? jxdeadzone : jydeadzone;
retaxis = xmode ? ev->data2 : ev->data3; retaxis = xmode ? ev->data2 : ev->data3;
if (retaxis != INT32_MAX) if (retaxis != INT32_MAX)
{ {
if (cv_moveaxis.value < 0) if (cv_moveaxis.value < 0)
retaxis = -retaxis; retaxis = -retaxis;
if (joywaitaccel < thistime && retaxis >= pjoyaccel) // only on upwards event if (Joystick.bGamepadStyle || retaxis > jacceldeadzone)
{ {
ch = KEY_ENTER; if (joywaitaccel < thistime)
joywaitaccel = thistime; {
if (pjoyaccel == 0 // no previous input? ch = KEY_ENTER;
|| ((retaxis < 0) == (pjoyaccel < 0))) // same direction as the current one? joywaitaccel = thistime;
joywaitaccel += NEWTICRATE/3; if (pjoyaccel == 0 // no previous input?
|| ((retaxis < 0) == (pjoyaccel > 0))) // same direction as the current one?
joywaitaccel += NEWTICRATE/3;
}
pjoyaccel = retaxis;
} }
pjoyaccel = retaxis; else
pjoyaccel = 0;
} }
} }
} }