Adjust how deadzones work
Build Dusk / run-tests (push) Failing after 15s
Build Dusk / build-linux (push) Failing after 21s
Build Dusk / build-psp (push) Failing after 17s
Build Dusk / build-gamecube (push) Failing after 17s
Build Dusk / build-wii (push) Failing after 17s

This commit is contained in:
2026-03-11 13:00:11 -05:00
parent 54e8e68f86
commit 7356286fe0
14 changed files with 126 additions and 64 deletions
+2 -3
View File
@@ -88,10 +88,9 @@ float_t inputButtonGetValueSDL2(const inputbutton_t button) {
INPUT.platform.controller, button.gpAxis.axis
);
value = (float_t)axis / 32767.0f;
if(!button.gpAxis.positive) value = -value;
if(value >= INPUT.deadzone) return value;
return 0.0f;
value = inputDeadzone(value, inputGetDeadzoneSDL2(button));
return value;
}
#endif
+9
View File
@@ -49,6 +49,15 @@ typedef struct {
*/
void inputUpdateSDL2(void);
/**
* Returns the deadzone for the given gamepad axis. Requires implementation by
* the host platform.
*
* @param button The button to get the deadzone of.
* @return The deadzone for the given gamepad axis.
*/
float_t inputGetDeadzoneSDL2(const inputbutton_t button);
/**
* Returns the input value (between 0 and 1) of the given button.
*