aboutsummaryrefslogtreecommitdiff
path: root/src/hid_core/frontend/emulated_controller.cpp
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-01-21 19:15:46 -0500
committerGitHub <noreply@github.com>2024-01-21 19:15:46 -0500
commitc8d8a53bf2db906ab75500f9773d98efc635d979 (patch)
tree1a7d19205aebdea48bd6b843f899f3b3e9478ba9 /src/hid_core/frontend/emulated_controller.cpp
parentc573e4a2f424e014297b2033ee7327a5729a6a5a (diff)
parent0748704ca68562ec548e96f0e3fe17bd1ad35ef7 (diff)
Merge pull request #12735 from german77/disable-vibration
core: hid: Allow to disable vibration
Diffstat (limited to 'src/hid_core/frontend/emulated_controller.cpp')
-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 f2499502dd..e12e5a77ea 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;
}