Merge pull request #43234 from madmiraal/fix-42876-3.2

[3.2] Remove unneeded filter on joy_axis()
This commit is contained in:
Rémi Verschelde 2020-11-16 22:41:49 +01:00 committed by GitHub
commit d0a5ef9c7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 13 deletions

View file

@ -776,17 +776,6 @@ void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
return; return;
} }
if (p_value.value > joy.last_axis[p_axis]) {
if (p_value.value < joy.last_axis[p_axis] + joy.filter) {
return;
}
} else if (p_value.value > joy.last_axis[p_axis] - joy.filter) {
return;
}
//when changing direction quickly, insert fake event to release pending inputmap actions //when changing direction quickly, insert fake event to release pending inputmap actions
float last = joy.last_axis[p_axis]; float last = joy.last_axis[p_axis];
if (p_value.min == 0 && (last < 0.25 || last > 0.75) && (last - 0.5) * (p_value.value - 0.5) < 0) { if (p_value.min == 0 && (last < 0.25 || last > 0.75) && (last - 0.5) * (p_value.value - 0.5) < 0) {

View file

@ -85,7 +85,6 @@ class InputDefault : public Input {
bool connected; bool connected;
bool last_buttons[JOY_BUTTON_MAX + 19]; //apparently SDL specifies 35 possible buttons on android bool last_buttons[JOY_BUTTON_MAX + 19]; //apparently SDL specifies 35 possible buttons on android
float last_axis[JOY_AXIS_MAX]; float last_axis[JOY_AXIS_MAX];
float filter;
int last_hat; int last_hat;
int mapping; int mapping;
int hat_current; int hat_current;
@ -101,7 +100,6 @@ class InputDefault : public Input {
} }
connected = false; connected = false;
last_hat = HAT_MASK_CENTER; last_hat = HAT_MASK_CENTER;
filter = 0.01f;
mapping = -1; mapping = -1;
hat_current = 0; hat_current = 0;
} }