summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Narr the Reg2024-01-21 16:44:03 -0600
committerGravatar Narr the Reg2024-01-21 16:44:31 -0600
commita7a77207529b5976574f3a427d55fe85224a1193 (patch)
tree80d1d1b9560e348fac8b14065ad098165e16c5c5
parentMerge pull request #12720 from t895/return-to-global (diff)
downloadyuzu-a7a77207529b5976574f3a427d55fe85224a1193.tar.gz
yuzu-a7a77207529b5976574f3a427d55fe85224a1193.tar.xz
yuzu-a7a77207529b5976574f3a427d55fe85224a1193.zip
core: hid: Allow to disable vibration
-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
1240 if (!output_devices[index]) { 1240 if (!output_devices[index]) {
1241 return false; 1241 return false;
1242 } 1242 }
1243
1244 last_vibration_value = vibration;
1245
1246 if (!Settings::values.vibration_enabled) {
1247 return false;
1248 }
1249
1243 const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); 1250 const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type);
1244 const auto& player = Settings::values.players.GetValue()[player_index]; 1251 const auto& player = Settings::values.players.GetValue()[player_index];
1245 const f32 strength = static_cast<f32>(player.vibration_strength) / 100.0f; 1252 const f32 strength = static_cast<f32>(player.vibration_strength) / 100.0f;
1246 1253
1247 last_vibration_value = vibration;
1248
1249 if (!player.vibration_enabled) { 1254 if (!player.vibration_enabled) {
1250 return false; 1255 return false;
1251 } 1256 }