You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Rename some more global enums (Key, Joy, MIDI)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user