From 44eeb3a0f380f81a6e61d01eda2762160ff1ec4d Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 26 Aug 2022 19:44:00 +0100 Subject: [PATCH] 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. --- src/g_game.h | 4 ++-- src/m_menu.c | 20 +++++++------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/g_game.h b/src/g_game.h index 0dcc69c3..410577da 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -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; diff --git a/src/m_menu.c b/src/m_menu.c index 29585827..4519a6a8 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2623,27 +2623,21 @@ 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 && (abs(retaxis) >= abs(pjoyaccel))) // only on upwards event { - if (joywaitaccel < thistime) - { - ch = KEY_ENTER; - joywaitaccel = thistime; - if (pjoyaccel == 0 // no previous input? - || ((retaxis < 0) == (pjoyaccel > 0))) // same direction as the current one? - joywaitaccel += NEWTICRATE/3; - } - pjoyaccel = retaxis; + ch = KEY_ENTER; + joywaitaccel = thistime; + if (pjoyaccel == 0 // no previous input? + || ((retaxis < 0) == (pjoyaccel < 0))) // same direction as the current one? + joywaitaccel += NEWTICRATE/3; } - else - pjoyaccel = 0; + pjoyaccel = retaxis; } } }