libretro: Set both strong and weak rumble motors

This commit is contained in:
Connor McLaughlin 2020-08-19 00:19:50 +10:00
parent d568c458b8
commit 0682b31044
1 changed files with 4 additions and 7 deletions

View File

@ -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<u16>(static_cast<u32>(strength * 65565.0f)));
}
const u16 strong = static_cast<u16>(static_cast<u32>(controller->GetVibrationMotorStrength(0) * 65565.0f));
const u16 weak = static_cast<u16>(static_cast<u32>(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);
}
}