From c0b67568757ccc22811e16348713ef3119e18f3e Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Sun, 26 Mar 2017 15:59:13 +0200 Subject: 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... --- platform/windows/joypad.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'platform/windows/joypad.cpp') diff --git a/platform/windows/joypad.cpp b/platform/windows/joypad.cpp index 2472940ef3..86f7033d40 100644 --- a/platform/windows/joypad.cpp +++ b/platform/windows/joypad.cpp @@ -319,7 +319,7 @@ void JoypadWindows::probe_joypads() { } } -unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { +void JoypadWindows::process_joypads() { HRESULT hr; @@ -337,16 +337,16 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { int button_mask = XINPUT_GAMEPAD_DPAD_UP; for (int i = 0; i <= 16; i++) { - p_last_id = input->joy_button(p_last_id, joy.id, i, joy.state.Gamepad.wButtons & button_mask); + input->joy_button(joy.id, i, joy.state.Gamepad.wButtons & button_mask); button_mask = button_mask * 2; } - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_0, axis_correct(joy.state.Gamepad.sThumbLX, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_1, axis_correct(joy.state.Gamepad.sThumbLY, true, false, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_2, axis_correct(joy.state.Gamepad.sThumbRX, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_3, axis_correct(joy.state.Gamepad.sThumbRY, true, false, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_4, axis_correct(joy.state.Gamepad.bLeftTrigger, true, true)); - p_last_id = input->joy_axis(p_last_id, joy.id, JOY_AXIS_5, axis_correct(joy.state.Gamepad.bRightTrigger, true, true)); + input->joy_axis(joy.id, JOY_AXIS_0, axis_correct(joy.state.Gamepad.sThumbLX, true)); + input->joy_axis(joy.id, JOY_AXIS_1, axis_correct(joy.state.Gamepad.sThumbLY, true, false, true)); + input->joy_axis(joy.id, JOY_AXIS_2, axis_correct(joy.state.Gamepad.sThumbRX, true)); + input->joy_axis(joy.id, JOY_AXIS_3, axis_correct(joy.state.Gamepad.sThumbRY, true, false, true)); + input->joy_axis(joy.id, JOY_AXIS_4, axis_correct(joy.state.Gamepad.bLeftTrigger, true, true)); + input->joy_axis(joy.id, JOY_AXIS_5, axis_correct(joy.state.Gamepad.bRightTrigger, true, true)); joy.last_packet = joy.state.dwPacketNumber; } uint64_t timestamp = input->get_joy_vibration_timestamp(joy.id); @@ -384,7 +384,7 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { continue; } - p_last_id = post_hat(p_last_id, joy->id, js.rgdwPOV[0]); + post_hat(joy->id, js.rgdwPOV[0]); for (int j = 0; j < 128; j++) { @@ -392,14 +392,14 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { if (!joy->last_buttons[j]) { - p_last_id = input->joy_button(p_last_id, joy->id, j, true); + input->joy_button(joy->id, j, true); joy->last_buttons[j] = true; } } else { if (joy->last_buttons[j]) { - p_last_id = input->joy_button(p_last_id, joy->id, j, false); + input->joy_button(joy->id, j, false); joy->last_buttons[j] = false; } } @@ -414,16 +414,16 @@ unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { for (int k = 0; k < count; k++) { if (joy->joy_axis[j] == axes[k]) { - p_last_id = input->joy_axis(p_last_id, joy->id, j, axis_correct(values[k])); + input->joy_axis(joy->id, j, axis_correct(values[k])); break; }; }; }; } - return p_last_id; + return; } -unsigned int JoypadWindows::post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad) { +void JoypadWindows::post_hat(int p_device, DWORD p_dpad) { int dpad_val = 0; @@ -462,7 +462,7 @@ unsigned int JoypadWindows::post_hat(unsigned int p_last_id, int p_device, DWORD dpad_val = (InputDefault::HAT_MASK_LEFT | InputDefault::HAT_MASK_UP); } - return input->joy_hat(p_last_id, p_device, dpad_val); + input->joy_hat(p_device, dpad_val); }; InputDefault::JoyAxis JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const { -- cgit v1.2.3