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 7f43d9ff8b
commit 03c58caaaa

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;
}