Haptic: Let XInput update effects while they're still running.

This commit is contained in:
Ryan C. Gordon 2013-08-10 13:46:19 -04:00
parent de6d6a5554
commit d4f386f5e3

View file

@ -1275,6 +1275,11 @@ SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic,
SDL_assert(data->type == SDL_HAPTIC_LEFTRIGHT);
vib->wLeftMotorSpeed = data->leftright.large_magnitude;
vib->wRightMotorSpeed = data->leftright.small_magnitude;
SDL_LockMutex(haptic->hwdata->mutex);
if (haptic->hwdata->stopTicks) { /* running right now? Update it. */
XINPUTSETSTATE(haptic->hwdata->userid, vib);
}
SDL_UnlockMutex(haptic->hwdata->mutex);
return 0;
}