diff options
| author | untodesu <kirill@untode.su> | 2025-09-11 15:45:26 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-09-11 15:45:26 +0500 |
| commit | b8bbc54c5c920aff1ff1b45a693f50d6d96d61c8 (patch) | |
| tree | 8b2903b313a71f8851705be400fc3e0a8317028f /game/client/io | |
| parent | a6ea7b7bbc66327cc2a957496f65dcfab5361cee (diff) | |
| download | voxelius-b8bbc54c5c920aff1ff1b45a693f50d6d96d61c8.tar.bz2 voxelius-b8bbc54c5c920aff1ff1b45a693f50d6d96d61c8.zip | |
Revise style: split include groups
Diffstat (limited to 'game/client/io')
| -rw-r--r-- | game/client/io/gamepad.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/game/client/io/gamepad.cc b/game/client/io/gamepad.cc index d07ee86..3a71920 100644 --- a/game/client/io/gamepad.cc +++ b/game/client/io/gamepad.cc @@ -68,10 +68,13 @@ static void on_glfw_joystick_event(const io::GlfwJoystickEvent& event) active_gamepad_id = INVALID_GAMEPAD_ID; - for(int i = 0; i < NUM_AXES; io::gamepad::last_state.axes[i++] = 0.0f) - ; - for(int i = 0; i < NUM_BUTTONS; io::gamepad::last_state.buttons[i++] = GLFW_RELEASE) - ; + for(int i = 0; i < NUM_AXES; io::gamepad::last_state.axes[i++] = 0.0f) { + // empty + } + + for(int i = 0; i < NUM_BUTTONS; io::gamepad::last_state.buttons[i++] = GLFW_RELEASE) { + // empty + } spdlog::warn("gamepad: disconnected"); @@ -145,7 +148,7 @@ void io::gamepad::update_late(void) if(glfwGetGamepadState(active_gamepad_id, &io::gamepad::state)) { for(int i = 0; i < NUM_AXES; ++i) { if((math::abs(io::gamepad::state.axes[i]) > GAMEPAD_AXIS_EVENT_THRESHOLD) - && (math::abs(io::gamepad::last_state.axes[i]) <= GAMEPAD_AXIS_EVENT_THRESHOLD)) { + && (math::abs(io::gamepad::last_state.axes[i]) <= GAMEPAD_AXIS_EVENT_THRESHOLD)) { GamepadAxisEvent event; event.action = GLFW_PRESS; event.axis = i; @@ -154,7 +157,7 @@ void io::gamepad::update_late(void) } if((math::abs(io::gamepad::state.axes[i]) <= GAMEPAD_AXIS_EVENT_THRESHOLD) - && (math::abs(io::gamepad::last_state.axes[i]) > GAMEPAD_AXIS_EVENT_THRESHOLD)) { + && (math::abs(io::gamepad::last_state.axes[i]) > GAMEPAD_AXIS_EVENT_THRESHOLD)) { GamepadAxisEvent event; event.action = GLFW_RELEASE; event.axis = i; |
