diff options
author | german77 <juangerman-13@hotmail.com> | 2021-10-11 07:43:11 +0200 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2021-11-25 03:30:24 +0100 |
commit | 06a5ef5874144a70e30e577a83ba68d1dad79e78 (patch) | |
tree | 867fa1153c7285c858cdb5bd7f60f08266532a88 /src/input_common/drivers/sdl_driver.cpp | |
parent | core: Update input interpreter (diff) | |
download | yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.gz yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.bz2 yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.lz yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.xz yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.tar.zst yuzu-06a5ef5874144a70e30e577a83ba68d1dad79e78.zip |
Diffstat (limited to '')
-rw-r--r-- | src/input_common/drivers/sdl_driver.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index efb4a2106..f7f03c5f2 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -506,7 +506,8 @@ std::vector<Common::ParamPackage> SDLDriver::GetInputDevices() const { } return devices; } -bool SDLDriver::SetRumble(const PadIdentifier& identifier, const Input::VibrationStatus vibration) { +Input::VibrationError SDLDriver::SetRumble(const PadIdentifier& identifier, + const Input::VibrationStatus vibration) { const auto joystick = GetSDLJoystickByGUID(identifier.guid.Format(), static_cast<int>(identifier.port)); const auto process_amplitude = [](f32 amplitude) { @@ -519,7 +520,10 @@ bool SDLDriver::SetRumble(const PadIdentifier& identifier, const Input::Vibratio .high_frequency = vibration.high_frequency, }; - return joystick->RumblePlay(new_vibration); + if (!joystick->RumblePlay(new_vibration)) { + return Input::VibrationError::Unknown; + } + return Input::VibrationError::None; } Common::ParamPackage SDLDriver::BuildAnalogParamPackageForButton(int port, std::string guid, s32 axis, float value) const { |