diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2020-05-13 18:27:34 -0400 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2021-03-23 07:13:23 -0400 |
commit | a5324787c80ebc55b123ab19db2b23404b1241ec (patch) | |
tree | a2e06d3fe9c9d0388d3d6803ff6a343a80fa9f80 /core/input/input.cpp | |
parent | 10d7fccb549a743a867b92f12a6d64717c45ba86 (diff) |
Rename some more global enums (Key, Joy, MIDI)
Diffstat (limited to 'core/input/input.cpp')
-rw-r--r-- | core/input/input.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp index 09a5c5ef32..627944210f 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -907,7 +907,7 @@ void Input::joy_button(int p_device, int p_button, bool p_pressed) { // no event? } -void Input::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) { +void Input::joy_axis(int p_device, int p_axis, const JoyAxisValue &p_value) { _THREAD_SAFE_METHOD_; ERR_FAIL_INDEX(p_axis, JOY_AXIS_MAX); @@ -921,12 +921,12 @@ void Input::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) { //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) { - JoyAxis jx; + JoyAxisValue jx; jx.min = p_value.min; jx.value = p_value.value < 0.5 ? 0.6 : 0.4; joy_axis(p_device, p_axis, jx); } else if (ABS(last) > 0.5 && last * p_value.value <= 0) { - JoyAxis jx; + JoyAxisValue jx; jx.min = p_value.min; jx.value = last > 0 ? 0.1 : -0.1; joy_axis(p_device, p_axis, jx); @@ -1206,22 +1206,22 @@ void Input::_get_mapped_hat_events(const JoyDeviceMapping &mapping, int p_hat, J } } -JoyButtonList Input::_get_output_button(String output) { +JoyButton Input::_get_output_button(String output) { for (int i = 0; i < JOY_BUTTON_SDL_MAX; i++) { if (output == _joy_buttons[i]) { - return JoyButtonList(i); + return JoyButton(i); } } - return JoyButtonList::JOY_BUTTON_INVALID; + return JoyButton::JOY_BUTTON_INVALID; } -JoyAxisList Input::_get_output_axis(String output) { +JoyAxis Input::_get_output_axis(String output) { for (int i = 0; i < JOY_AXIS_SDL_MAX; i++) { if (output == _joy_axes[i]) { - return JoyAxisList(i); + return JoyAxis(i); } } - return JoyAxisList::JOY_AXIS_INVALID; + return JoyAxis::JOY_AXIS_INVALID; } void Input::parse_mapping(String p_mapping) { @@ -1279,8 +1279,8 @@ void Input::parse_mapping(String p_mapping) { input = input.left(input.length() - 1); } - JoyButtonList output_button = _get_output_button(output); - JoyAxisList output_axis = _get_output_axis(output); + JoyButton output_button = _get_output_button(output); + JoyAxis output_axis = _get_output_axis(output); ERR_CONTINUE_MSG(output_button == JOY_BUTTON_INVALID && output_axis == JOY_AXIS_INVALID, String(entry[idx] + "\nUnrecognised output string: " + output)); ERR_CONTINUE_MSG(output_button != JOY_BUTTON_INVALID && output_axis != JOY_AXIS_INVALID, |