summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-01-22 01:15:46 +0100
committerGitHub <noreply@github.com>2024-01-22 01:15:46 +0100
commit92ce9273ee14127ff6b0adb61b4ac84b8f5f4ea7 (patch)
tree1a7d19205aebdea48bd6b843f899f3b3e9478ba9
parentMerge pull request #12733 from german77/settings_services (diff)
parentcore: hid: Allow to disable vibration (diff)
downloadyuzu-92ce9273ee14127ff6b0adb61b4ac84b8f5f4ea7.tar
yuzu-92ce9273ee14127ff6b0adb61b4ac84b8f5f4ea7.tar.gz
yuzu-92ce9273ee14127ff6b0adb61b4ac84b8f5f4ea7.tar.bz2
yuzu-92ce9273ee14127ff6b0adb61b4ac84b8f5f4ea7.tar.lz
yuzu-92ce9273ee14127ff6b0adb61b4ac84b8f5f4ea7.tar.xz
yuzu-92ce9273ee14127ff6b0adb61b4ac84b8f5f4ea7.tar.zst
yuzu-92ce9273ee14127ff6b0adb61b4ac84b8f5f4ea7.zip
-rw-r--r--src/hid_core/frontend/emulated_controller.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp
index f2499502d..e12e5a77e 100644
--- a/src/hid_core/frontend/emulated_controller.cpp
+++ b/src/hid_core/frontend/emulated_controller.cpp
@@ -1240,12 +1240,17 @@ bool EmulatedController::SetVibration(DeviceIndex device_index, const VibrationV
if (!output_devices[index]) {
return false;
}
+
+ last_vibration_value = vibration;
+
+ if (!Settings::values.vibration_enabled) {
+ return false;
+ }
+
const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type);
const auto& player = Settings::values.players.GetValue()[player_index];
const f32 strength = static_cast<f32>(player.vibration_strength) / 100.0f;
- last_vibration_value = vibration;
-
if (!player.vibration_enabled) {
return false;
}