diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-10-17 15:38:12 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2020-11-16 05:33:20 +0100 |
commit | 38110dd485e329fa39e2e4c02b91a89dfebcbc88 (patch) | |
tree | 096a87673779267eaf711e4ae77ba7a995845327 /src/core/hle/service | |
parent | settings: Remove global vibration strength modifier (diff) | |
download | yuzu-38110dd485e329fa39e2e4c02b91a89dfebcbc88.tar yuzu-38110dd485e329fa39e2e4c02b91a89dfebcbc88.tar.gz yuzu-38110dd485e329fa39e2e4c02b91a89dfebcbc88.tar.bz2 yuzu-38110dd485e329fa39e2e4c02b91a89dfebcbc88.tar.lz yuzu-38110dd485e329fa39e2e4c02b91a89dfebcbc88.tar.xz yuzu-38110dd485e329fa39e2e4c02b91a89dfebcbc88.tar.zst yuzu-38110dd485e329fa39e2e4c02b91a89dfebcbc88.zip |
Diffstat (limited to 'src/core/hle/service')
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index ba20d3f59..dc9954377 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -680,11 +680,19 @@ bool Controller_NPad::VibrateControllerAtIndex(std::size_t npad_index, return false; } + const auto& player = Settings::values.players.GetValue()[npad_index]; + + if (!player.vibration_enabled) { + return false; + } + using namespace Settings::NativeButton; const auto& button_state = buttons[npad_index]; return button_state[A - BUTTON_HID_BEGIN]->SetRumblePlay( - vibration_value.amp_low, vibration_value.freq_low, vibration_value.amp_high, + std::min(vibration_value.amp_low * player.vibration_strength / 100.0f, 1.0f), + vibration_value.freq_low, + std::min(vibration_value.amp_high * player.vibration_strength / 100.0f, 1.0f), vibration_value.freq_high); } @@ -728,7 +736,8 @@ void Controller_NPad::VibrateControllers(const std::vector<DeviceHandle>& vibrat } // Filter out non-zero vibrations that are within 0.015625 absolute amplitude of each other. - if ((vibration_values[i].amp_low != 0.0f || vibration_values[i].amp_high != 0.0f) && + if (!Settings::values.enable_accurate_vibrations.GetValue() && + (vibration_values[i].amp_low != 0.0f || vibration_values[i].amp_high != 0.0f) && (latest_vibration_values[npad_index][device_index].amp_low != 0.0f || latest_vibration_values[npad_index][device_index].amp_high != 0.0f) && (abs(vibration_values[i].amp_low - |