diff --git a/src/core/playstation_mouse.cpp b/src/core/playstation_mouse.cpp index f24e1874b..d81a4d8cc 100644 --- a/src/core/playstation_mouse.cpp +++ b/src/core/playstation_mouse.cpp @@ -155,22 +155,20 @@ bool PlayStationMouse::Transfer(const u8 data_in, u8* data_out) case TransferState::DeltaX: { - const float delta_x = - std::clamp(std::floor(m_delta_x * m_sensitivity_x), static_cast(std::numeric_limits::min()), - static_cast(std::numeric_limits::max())); + const float delta_x = std::floor(m_delta_x * m_sensitivity_x); m_delta_x -= delta_x / m_sensitivity_x; - *data_out = static_cast(delta_x); + *data_out = static_cast(std::clamp(delta_x, static_cast(std::numeric_limits::min()), + static_cast(std::numeric_limits::max()))); m_transfer_state = TransferState::DeltaY; return true; } case TransferState::DeltaY: { - const float delta_y = - std::clamp(std::floor(m_delta_y * m_sensitivity_y), static_cast(std::numeric_limits::min()), - static_cast(std::numeric_limits::max())); + const float delta_y = std::floor(m_delta_y * m_sensitivity_y); m_delta_y -= delta_y / m_sensitivity_x; - *data_out = static_cast(delta_y); + *data_out = static_cast(std::clamp(delta_y, static_cast(std::numeric_limits::min()), + static_cast(std::numeric_limits::max()))); m_transfer_state = TransferState::Idle; return false; } @@ -197,9 +195,7 @@ std::unique_ptr PlayStationMouse::Create(u32 index) static const Controller::ControllerBindingInfo s_binding_info[] = { #define BUTTON(name, display_name, icon_name, button, genb) \ - { \ - name, display_name, icon_name, static_cast(button), InputBindingInfo::Type::Button, genb \ - } + {name, display_name, icon_name, static_cast(button), InputBindingInfo::Type::Button, genb} // clang-format off { "Pointer", TRANSLATE_NOOP("PlaystationMouse", "Pointer"), ICON_PF_MOUSE_ANY, static_cast(PlayStationMouse::Binding::PointerX), InputBindingInfo::Type::RelativePointer, GenericInputBinding::Unknown },