aboutsummaryrefslogtreecommitdiff
path: root/platform/osx/joypad_osx.cpp
diff options
context:
space:
mode:
authorAndreas Haas2017-03-26 15:59:13 +0200
committerAndreas Haas2017-03-26 15:59:32 +0200
commitc0b67568757ccc22811e16348713ef3119e18f3e (patch)
treec2f13f324454478a76c623141611f79628d52ce6 /platform/osx/joypad_osx.cpp
parenta0b0dff6fdbdc4be78087aa572f3da5dbb8daa01 (diff)
downloadgodot-c0b67568757ccc22811e16348713ef3119e18f3e.tar.gz
godot-c0b67568757ccc22811e16348713ef3119e18f3e.tar.zst
godot-c0b67568757ccc22811e16348713ef3119e18f3e.zip
Input: Remove usage of platform dependent event IDs.
The ID property for InputEvents is set by `SceneTree` when sending the event down the tree. So there's no need for the platform specific code to set this value when it will later be overriden anyway...
Diffstat (limited to 'platform/osx/joypad_osx.cpp')
-rw-r--r--platform/osx/joypad_osx.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/platform/osx/joypad_osx.cpp b/platform/osx/joypad_osx.cpp
index c2b0e1f05..7b77f3bb6 100644
--- a/platform/osx/joypad_osx.cpp
+++ b/platform/osx/joypad_osx.cpp
@@ -458,7 +458,7 @@ static const InputDefault::JoyAxis axis_correct(int p_value, int p_min, int p_ma
return jx;
}
-uint32_t JoypadOSX::process_joypads(uint32_t p_last_id) {
+void JoypadOSX::process_joypads() {
poll_joypads();
for (int i = 0; i < device_list.size(); i++) {
@@ -467,17 +467,17 @@ uint32_t JoypadOSX::process_joypads(uint32_t p_last_id) {
for (int j = 0; j < joy.axis_elements.size(); j++) {
rec_element &elem = joy.axis_elements[j];
int value = joy.get_hid_element_state(&elem);
- p_last_id = input->joy_axis(p_last_id, joy.id, j, axis_correct(value, elem.min, elem.max));
+ input->joy_axis(joy.id, j, axis_correct(value, elem.min, elem.max));
}
for (int j = 0; j < joy.button_elements.size(); j++) {
int value = joy.get_hid_element_state(&joy.button_elements[j]);
- p_last_id = input->joy_button(p_last_id, joy.id, j, (value >= 1));
+ input->joy_button(joy.id, j, (value >= 1));
}
for (int j = 0; j < joy.hat_elements.size(); j++) {
rec_element &elem = joy.hat_elements[j];
int value = joy.get_hid_element_state(&elem);
int hat_value = process_hat_value(elem.min, elem.max, value);
- p_last_id = input->joy_hat(p_last_id, joy.id, hat_value);
+ input->joy_hat(joy.id, hat_value);
}
if (joy.ffservice) {
@@ -494,7 +494,6 @@ uint32_t JoypadOSX::process_joypads(uint32_t p_last_id) {
}
}
}
- return p_last_id;
}
void JoypadOSX::joypad_vibration_start(int p_id, float p_magnitude, float p_duration, uint64_t p_timestamp) {