Skip to content

Commit

Permalink
Merge pull request #43234 from madmiraal/fix-42876-3.2
Browse files Browse the repository at this point in the history
[3.2] Remove unneeded filter on joy_axis()
  • Loading branch information
akien-mga authored Nov 16, 2020
2 parents 4d667da + ef2a04b commit d0a5ef9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
11 changes: 0 additions & 11 deletions main/input_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,17 +776,6 @@ void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) {
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
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) {
Expand Down
2 changes: 0 additions & 2 deletions main/input_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class InputDefault : public Input {
bool connected;
bool last_buttons[JOY_BUTTON_MAX + 19]; //apparently SDL specifies 35 possible buttons on android
float last_axis[JOY_AXIS_MAX];
float filter;
int last_hat;
int mapping;
int hat_current;
Expand All @@ -101,7 +100,6 @@ class InputDefault : public Input {
}
connected = false;
last_hat = HAT_MASK_CENTER;
filter = 0.01f;
mapping = -1;
hat_current = 0;
}
Expand Down

0 comments on commit d0a5ef9

Please sign in to comment.