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
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user