Merge pull request #72964 from AThousandShips/input_early_exit
Perform early exit in Input::is_anything_pressed
This commit is contained in:
commit
91409fe0c8
|
@ -231,14 +231,17 @@ Input::VelocityTrack::VelocityTrack() {
|
||||||
bool Input::is_anything_pressed() const {
|
bool Input::is_anything_pressed() const {
|
||||||
_THREAD_SAFE_METHOD_
|
_THREAD_SAFE_METHOD_
|
||||||
|
|
||||||
|
if (!keys_pressed.is_empty() || !joy_buttons_pressed.is_empty() || !mouse_button_mask.is_empty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
for (const KeyValue<StringName, Input::Action> &E : action_state) {
|
for (const KeyValue<StringName, Input::Action> &E : action_state) {
|
||||||
if (E.value.pressed) {
|
if (E.value.pressed) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return !keys_pressed.is_empty() ||
|
|
||||||
!joy_buttons_pressed.is_empty() ||
|
return false;
|
||||||
!mouse_button_mask.is_empty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Input::is_key_pressed(Key p_keycode) const {
|
bool Input::is_key_pressed(Key p_keycode) const {
|
||||||
|
|
Loading…
Reference in New Issue