diff options
| author | 2021-10-21 13:56:52 -0500 | |
|---|---|---|
| committer | 2021-11-24 20:30:25 -0600 | |
| commit | b5e72de753ae4de5c5fae7087abb00dc4242451d (patch) | |
| tree | ac1f2b56814bbaaa1a5432c4e1d79c12dd16296d /src/core/hid/emulated_controller.cpp | |
| parent | service/hid: Use ring buffer for gestures (diff) | |
| download | yuzu-b5e72de753ae4de5c5fae7087abb00dc4242451d.tar.gz yuzu-b5e72de753ae4de5c5fae7087abb00dc4242451d.tar.xz yuzu-b5e72de753ae4de5c5fae7087abb00dc4242451d.zip | |
kraken: Address comments from review
review fixes
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 1ff3022c5..d59758e99 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -2,8 +2,6 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included | 3 | // Refer to the license.txt file included |
| 4 | 4 | ||
| 5 | #include <fmt/format.h> | ||
| 6 | |||
| 7 | #include "core/hid/emulated_controller.h" | 5 | #include "core/hid/emulated_controller.h" |
| 8 | #include "core/hid/input_converter.h" | 6 | #include "core/hid/input_converter.h" |
| 9 | 7 | ||
| @@ -635,6 +633,9 @@ void EmulatedController::SetBattery(Input::CallbackStatus callback, std::size_t | |||
| 635 | } | 633 | } |
| 636 | 634 | ||
| 637 | bool EmulatedController::SetVibration(std::size_t device_index, VibrationValue vibration) { | 635 | bool EmulatedController::SetVibration(std::size_t device_index, VibrationValue vibration) { |
| 636 | if (device_index >= output_devices.size()) { | ||
| 637 | return false; | ||
| 638 | } | ||
| 638 | if (!output_devices[device_index]) { | 639 | if (!output_devices[device_index]) { |
| 639 | return false; | 640 | return false; |
| 640 | } | 641 | } |
| @@ -659,6 +660,9 @@ bool EmulatedController::SetVibration(std::size_t device_index, VibrationValue v | |||
| 659 | } | 660 | } |
| 660 | 661 | ||
| 661 | bool EmulatedController::TestVibration(std::size_t device_index) { | 662 | bool EmulatedController::TestVibration(std::size_t device_index) { |
| 663 | if (device_index >= output_devices.size()) { | ||
| 664 | return false; | ||
| 665 | } | ||
| 662 | if (!output_devices[device_index]) { | 666 | if (!output_devices[device_index]) { |
| 663 | return false; | 667 | return false; |
| 664 | } | 668 | } |
| @@ -733,7 +737,9 @@ bool EmulatedController::IsConnected(bool temporary) const { | |||
| 733 | } | 737 | } |
| 734 | 738 | ||
| 735 | bool EmulatedController::IsVibrationEnabled() const { | 739 | bool EmulatedController::IsVibrationEnabled() const { |
| 736 | return is_vibration_enabled; | 740 | const auto player_index = NpadIdTypeToIndex(npad_id_type); |
| 741 | const auto& player = Settings::values.players.GetValue()[player_index]; | ||
| 742 | return player.vibration_enabled; | ||
| 737 | } | 743 | } |
| 738 | 744 | ||
| 739 | NpadIdType EmulatedController::GetNpadIdType() const { | 745 | NpadIdType EmulatedController::GetNpadIdType() const { |