diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2017-03-26 15:59:13 +0200 |
---|---|---|
committer | Andreas Haas <liu.gam3@gmail.com> | 2017-03-26 15:59:32 +0200 |
commit | c0b67568757ccc22811e16348713ef3119e18f3e (patch) | |
tree | c2f13f324454478a76c623141611f79628d52ce6 /platform/uwp/joypad_uwp.cpp | |
parent | a0b0dff6fdbdc4be78087aa572f3da5dbb8daa01 (diff) |
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/uwp/joypad_uwp.cpp')
-rw-r--r-- | platform/uwp/joypad_uwp.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/platform/uwp/joypad_uwp.cpp b/platform/uwp/joypad_uwp.cpp index dd57ed94ae..7860994a79 100644 --- a/platform/uwp/joypad_uwp.cpp +++ b/platform/uwp/joypad_uwp.cpp @@ -40,7 +40,7 @@ void JoypadUWP::register_events() { ref new EventHandler<Gamepad ^>(this, &JoypadUWP::OnGamepadRemoved); } -uint32_t JoypadUWP::process_controllers(uint32_t p_last_id) { +void JoypadUWP::process_controllers() { for (int i = 0; i < MAX_CONTROLLERS; i++) { @@ -55,23 +55,21 @@ uint32_t JoypadUWP::process_controllers(uint32_t p_last_id) { int button_mask = (int)GamepadButtons::Menu; for (int j = 0; j < 14; j++) { - p_last_id = input->joy_button(p_last_id, controllers[i].id, j, (int)reading.Buttons & button_mask); + input->joy_button(controllers[i].id, j, (int)reading.Buttons & button_mask); button_mask *= 2; } - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_0, axis_correct(reading.LeftThumbstickX)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_1, axis_correct(reading.LeftThumbstickY, true)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_2, axis_correct(reading.RightThumbstickX)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_3, axis_correct(reading.RightThumbstickY, true)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_4, axis_correct(reading.LeftTrigger, false, true)); - p_last_id = input->joy_axis(p_last_id, controllers[i].id, JOY_AXIS_5, axis_correct(reading.RightTrigger, false, true)); + input->joy_axis(controllers[i].id, JOY_AXIS_0, axis_correct(reading.LeftThumbstickX)); + input->joy_axis(controllers[i].id, JOY_AXIS_1, axis_correct(reading.LeftThumbstickY, true)); + input->joy_axis(controllers[i].id, JOY_AXIS_2, axis_correct(reading.RightThumbstickX)); + input->joy_axis(controllers[i].id, JOY_AXIS_3, axis_correct(reading.RightThumbstickY, true)); + input->joy_axis(controllers[i].id, JOY_AXIS_4, axis_correct(reading.LeftTrigger, false, true)); + input->joy_axis(controllers[i].id, JOY_AXIS_5, axis_correct(reading.RightTrigger, false, true)); break; } } } - - return p_last_id; } JoypadUWP::JoypadUWP() { |