mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 07:12:03 +00:00
Remove game deadzone for Accel/Brake
- They're binary inputs as processed by the game. - A mechanism for binary inputs with no deadzone is already used for item and drift. - Generally bound to triggers, not the stick. - SDL still has a minimum deadzone, so won't fire endlessly.
This commit is contained in:
parent
3ef3789f58
commit
44eeb3a0f3
2 changed files with 9 additions and 15 deletions
|
@ -128,11 +128,11 @@ typedef enum
|
|||
{
|
||||
AXISNONE = 0,
|
||||
AXISTURN,
|
||||
AXISMOVE,
|
||||
AXISBRAKE,
|
||||
AXISAIM,
|
||||
AXISLOOK,
|
||||
AXISDEAD, //Axises that don't want deadzones
|
||||
AXISMOVE,
|
||||
AXISBRAKE,
|
||||
AXISFIRE,
|
||||
AXISDRIFT,
|
||||
} axis_input_e;
|
||||
|
|
10
src/m_menu.c
10
src/m_menu.c
|
@ -2623,28 +2623,22 @@ boolean M_Responder(event_t *ev)
|
|||
accelaxis /= 2;
|
||||
if (ev->data1 == accelaxis)
|
||||
{
|
||||
const INT32 jacceldeadzone = xmode ? jxdeadzone : jydeadzone;
|
||||
retaxis = xmode ? ev->data2 : ev->data3;
|
||||
if (retaxis != INT32_MAX)
|
||||
{
|
||||
if (cv_moveaxis.value < 0)
|
||||
retaxis = -retaxis;
|
||||
|
||||
if (Joystick.bGamepadStyle || abs(retaxis) > jacceldeadzone)
|
||||
{
|
||||
if (joywaitaccel < thistime)
|
||||
if (joywaitaccel < thistime && (abs(retaxis) >= abs(pjoyaccel))) // only on upwards event
|
||||
{
|
||||
ch = KEY_ENTER;
|
||||
joywaitaccel = thistime;
|
||||
if (pjoyaccel == 0 // no previous input?
|
||||
|| ((retaxis < 0) == (pjoyaccel > 0))) // same direction as the current one?
|
||||
|| ((retaxis < 0) == (pjoyaccel < 0))) // same direction as the current one?
|
||||
joywaitaccel += NEWTICRATE/3;
|
||||
}
|
||||
pjoyaccel = retaxis;
|
||||
}
|
||||
else
|
||||
pjoyaccel = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue