Input: refactor vibration

There's no need to deal with vibration levels outside of the handlers.
All we need to know is the 0-255 DS3 range which is given by the u8 type.
This commit is contained in:
Megamouse 2022-10-21 22:35:31 +02:00
parent a1f9ff0aaa
commit ddd261c943
18 changed files with 59 additions and 76 deletions

View file

@ -197,15 +197,15 @@ void pad_thread::Init()
}
}
void pad_thread::SetRumble(const u32 pad, u8 largeMotor, bool smallMotor)
void pad_thread::SetRumble(const u32 pad, u8 large_motor, bool small_motor)
{
if (pad >= m_pads.size())
return;
if (m_pads[pad]->m_vibrateMotors.size() >= 2)
{
m_pads[pad]->m_vibrateMotors[0].m_value = largeMotor;
m_pads[pad]->m_vibrateMotors[1].m_value = smallMotor ? 255 : 0;
m_pads[pad]->m_vibrateMotors[0].m_value = large_motor;
m_pads[pad]->m_vibrateMotors[1].m_value = small_motor ? 255 : 0;
}
}