Remove unneeded filter on joy_axis()

This commit is contained in:
Marcel Admiraal 2020-10-31 09:22:52 +00:00
parent 4f908fb671
commit ef2a04bfd7
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;
} }