From 373408ae8c565cc401770e65776cae55a3545572 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sun, 11 Oct 2020 11:25:17 -0400 Subject: controllers/npad: Send an empty vibration on destruction/deactivation This stops all controllers from continuously vibrating when emulation is stopped. --- src/core/hle/service/hid/controllers/npad.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/hid/controllers/npad.h') diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h index c1b19103a..4dc2a974d 100644 --- a/src/core/hle/service/hid/controllers/npad.h +++ b/src/core/hle/service/hid/controllers/npad.h @@ -110,10 +110,10 @@ public: static_assert(sizeof(NpadStyleSet) == 4, "NpadStyleSet is an invalid size"); struct VibrationValue { - f32 amp_low; - f32 freq_low; - f32 amp_high; - f32 freq_high; + f32 amp_low{0.0f}; + f32 freq_low{160.0f}; + f32 amp_high{0.0f}; + f32 freq_high{320.0f}; }; static_assert(sizeof(VibrationValue) == 0x10, "Vibration is an invalid size"); @@ -148,8 +148,10 @@ public: void SetNpadMode(u32 npad_id, NpadAssignments assignment_mode); - void VibrateController(const std::vector& vibration_device_handles, - const std::vector& vibration_values); + bool VibrateControllerAtIndex(std::size_t npad_index, const VibrationValue& vibration_value); + + void VibrateControllers(const std::vector& vibration_device_handles, + const std::vector& vibration_values); VibrationValue GetLastVibration(const DeviceHandle& vibration_device_handle) const; -- cgit v1.2.3