diff options
| author | Narr the Reg <juangerman-13@hotmail.com> | 2023-01-25 13:16:52 -0600 | 
|---|---|---|
| committer | Narr the Reg <juangerman-13@hotmail.com> | 2023-01-25 13:52:50 -0600 | 
| commit | cc821bfae1b02ec3e86b85097f71a2e38c12f8a5 (patch) | |
| tree | 3da326ee41f9e5831f92a9bbbe6aa80f246aa39a /src/core/hid | |
| parent | 44b981fd3eb3db5c15bcc24e61bae45607223ee6 (diff) | |
Revert 9617 and fix it on input_common
Diffstat (limited to 'src/core/hid')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 12 | 
1 files changed, 2 insertions, 10 deletions
| diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 6e9812e6e..0e06468da 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp @@ -11,7 +11,6 @@  namespace Core::HID {  constexpr s32 HID_JOYSTICK_MAX = 0x7fff; -constexpr s32 HID_JOYSTICK_MIN = 0x7ffe;  constexpr s32 HID_TRIGGER_MAX = 0x7fff;  // Use a common UUID for TAS and Virtual Gamepad  constexpr Common::UUID TAS_UUID = @@ -864,16 +863,9 @@ void EmulatedController::SetStick(const Common::Input::CallbackStatus& callback,          return;      } -    const auto FloatToShort = [](float a) { -        if (a > 0) { -            return static_cast<s32>(a * HID_JOYSTICK_MAX); -        } -        return static_cast<s32>(a * HID_JOYSTICK_MIN); -    }; -      const AnalogStickState stick{ -        .x = FloatToShort(controller.stick_values[index].x.value), -        .y = FloatToShort(controller.stick_values[index].y.value), +        .x = static_cast<s32>(controller.stick_values[index].x.value * HID_JOYSTICK_MAX), +        .y = static_cast<s32>(controller.stick_values[index].y.value * HID_JOYSTICK_MAX),      };      switch (index) { | 
