From 0682b31044f2681ff8a5d7b8069e784605c72bb3 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 19 Aug 2020 00:19:50 +1000 Subject: [PATCH] libretro: Set both strong and weak rumble motors --- src/duckstation-libretro/libretro_host_interface.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/duckstation-libretro/libretro_host_interface.cpp b/src/duckstation-libretro/libretro_host_interface.cpp index b788874f9..a7b14545b 100644 --- a/src/duckstation-libretro/libretro_host_interface.cpp +++ b/src/duckstation-libretro/libretro_host_interface.cpp @@ -761,13 +761,10 @@ void LibretroHostInterface::UpdateControllersAnalogController(u32 index) if (m_rumble_interface_valid) { - const u32 motor_count = controller->GetVibrationMotorCount(); - for (u32 i = 0; i < motor_count; i++) - { - const float strength = controller->GetVibrationMotorStrength(i); - m_rumble_interface.set_rumble_state(index, RETRO_RUMBLE_STRONG, - static_cast(static_cast(strength * 65565.0f))); - } + const u16 strong = static_cast(static_cast(controller->GetVibrationMotorStrength(0) * 65565.0f)); + const u16 weak = static_cast(static_cast(controller->GetVibrationMotorStrength(1) * 65565.0f)); + m_rumble_interface.set_rumble_state(index, RETRO_RUMBLE_STRONG, strong); + m_rumble_interface.set_rumble_state(index, RETRO_RUMBLE_WEAK, weak); } }