summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar liamwhite2023-10-23 10:33:03 -0400
committerGravatar GitHub2023-10-23 10:33:03 -0400
commit6b93b0b08cff8539699c49c41beecdcac5d9de36 (patch)
tree8f869d2f8eeb90dd75232836a2c84e678deef455
parentMerge pull request #11831 from liamwhite/hosversionbetween (diff)
parentyuzu: Fix vibration reseting to 1% (diff)
downloadyuzu-6b93b0b08cff8539699c49c41beecdcac5d9de36.tar.gz
yuzu-6b93b0b08cff8539699c49c41beecdcac5d9de36.tar.xz
yuzu-6b93b0b08cff8539699c49c41beecdcac5d9de36.zip
Merge pull request #11854 from german77/vibration-ui
yuzu: Fix vibration reseting to 1%
-rw-r--r--src/yuzu/configuration/configure_vibration.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/yuzu/configuration/configure_vibration.cpp b/src/yuzu/configuration/configure_vibration.cpp
index d765e808a..68c28b320 100644
--- a/src/yuzu/configuration/configure_vibration.cpp
+++ b/src/yuzu/configuration/configure_vibration.cpp
@@ -89,7 +89,7 @@ void ConfigureVibration::VibrateController(Core::HID::ControllerTriggerType type
89 89
90 auto& player = Settings::values.players.GetValue()[player_index]; 90 auto& player = Settings::values.players.GetValue()[player_index];
91 auto controller = hid_core.GetEmulatedControllerByIndex(player_index); 91 auto controller = hid_core.GetEmulatedControllerByIndex(player_index);
92 const int vibration_strenght = vibration_spinboxes[player_index]->value(); 92 const int vibration_strength = vibration_spinboxes[player_index]->value();
93 const auto& buttons = controller->GetButtonsValues(); 93 const auto& buttons = controller->GetButtonsValues();
94 94
95 bool button_is_pressed = false; 95 bool button_is_pressed = false;
@@ -105,10 +105,10 @@ void ConfigureVibration::VibrateController(Core::HID::ControllerTriggerType type
105 return; 105 return;
106 } 106 }
107 107
108 const int old_vibration_enabled = player.vibration_enabled; 108 const bool old_vibration_enabled = player.vibration_enabled;
109 const bool old_vibration_strenght = player.vibration_strength; 109 const int old_vibration_strength = player.vibration_strength;
110 player.vibration_enabled = true; 110 player.vibration_enabled = true;
111 player.vibration_strength = vibration_strenght; 111 player.vibration_strength = vibration_strength;
112 112
113 const Core::HID::VibrationValue vibration{ 113 const Core::HID::VibrationValue vibration{
114 .low_amplitude = 1.0f, 114 .low_amplitude = 1.0f,
@@ -121,7 +121,7 @@ void ConfigureVibration::VibrateController(Core::HID::ControllerTriggerType type
121 121
122 // Restore previous values 122 // Restore previous values
123 player.vibration_enabled = old_vibration_enabled; 123 player.vibration_enabled = old_vibration_enabled;
124 player.vibration_strength = old_vibration_strenght; 124 player.vibration_strength = old_vibration_strength;
125} 125}
126 126
127void ConfigureVibration::StopVibrations() { 127void ConfigureVibration::StopVibrations() {