diff options
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 83ced5635..916368c68 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -251,7 +251,8 @@ void EmulatedController::RestoreConfig() { | |||
| 251 | ReloadFromSettings(); | 251 | ReloadFromSettings(); |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(DeviceIndex device_index) const { | 254 | std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices( |
| 255 | DeviceIndex device_index) const { | ||
| 255 | std::vector<Common::ParamPackage> devices; | 256 | std::vector<Common::ParamPackage> devices; |
| 256 | for (const auto& param : button_params) { | 257 | for (const auto& param : button_params) { |
| 257 | if (!param.Has("engine")) { | 258 | if (!param.Has("engine")) { |
| @@ -658,6 +659,10 @@ bool EmulatedController::SetVibration(std::size_t device_index, VibrationValue v | |||
| 658 | const auto& player = Settings::values.players.GetValue()[player_index]; | 659 | const auto& player = Settings::values.players.GetValue()[player_index]; |
| 659 | const f32 strength = static_cast<f32>(player.vibration_strength) / 100.0f; | 660 | const f32 strength = static_cast<f32>(player.vibration_strength) / 100.0f; |
| 660 | 661 | ||
| 662 | if (!player.vibration_enabled) { | ||
| 663 | return false; | ||
| 664 | } | ||
| 665 | |||
| 661 | // Exponential amplification is too strong at low amplitudes. Switch to a linear | 666 | // Exponential amplification is too strong at low amplitudes. Switch to a linear |
| 662 | // amplification if strength is set below 0.7f | 667 | // amplification if strength is set below 0.7f |
| 663 | const Input::VibrationAmplificationType type = | 668 | const Input::VibrationAmplificationType type = |
| @@ -860,6 +865,9 @@ AnalogSticks EmulatedController::GetSticks() const { | |||
| 860 | } | 865 | } |
| 861 | // Some drivers like stick from buttons need constant refreshing | 866 | // Some drivers like stick from buttons need constant refreshing |
| 862 | for (auto& device : stick_devices) { | 867 | for (auto& device : stick_devices) { |
| 868 | if (!device) { | ||
| 869 | continue; | ||
| 870 | } | ||
| 863 | device->SoftUpdate(); | 871 | device->SoftUpdate(); |
| 864 | } | 872 | } |
| 865 | return controller.analog_stick_state; | 873 | return controller.analog_stick_state; |