mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-04-10 19:15:14 +00:00
Constant force commands for XInput devices fixed so that they will stop when 0 force is applied.
This commit is contained in:
parent
02c0c32398
commit
fdedc60f84
|
@ -1628,7 +1628,7 @@ bool CDirectInputSystem::ProcessForceFeedbackCmd(int joyNum, int axisNum, ForceF
|
||||||
negForce = ffCmd.force < 0.0f;
|
negForce = ffCmd.force < 0.0f;
|
||||||
absForce = (negForce ? -ffCmd.force : ffCmd.force);
|
absForce = (negForce ? -ffCmd.force : ffCmd.force);
|
||||||
threshold = (float)m_xiConstForceThreshold / 100.0f;
|
threshold = (float)m_xiConstForceThreshold / 100.0f;
|
||||||
if (absForce < threshold)
|
if ((absForce < threshold) && (absForce > 0.001)) // if absForce == 0, must process command to stop controller vibrating
|
||||||
return false;
|
return false;
|
||||||
if (negForce)
|
if (negForce)
|
||||||
vibration.wLeftMotorSpeed = min<WORD>(ffCmd.force * (float)(m_xiConstForceMax * XI_VIBRATE_SCALE), XI_VIBRATE_MAX);
|
vibration.wLeftMotorSpeed = min<WORD>(ffCmd.force * (float)(m_xiConstForceMax * XI_VIBRATE_SCALE), XI_VIBRATE_MAX);
|
||||||
|
|
Loading…
Reference in a new issue