Haptic: Let XInput update effects while they're still running.
authorRyan C. Gordon
Sat, 10 Aug 2013 13:46:19 -0400
changeset 7623fe1b8a78de0b
parent 7622 d758150805de
child 7624 ac9f3b12c42a
Haptic: Let XInput update effects while they're still running.
src/haptic/windows/SDL_syshaptic.c
     1.1 --- a/src/haptic/windows/SDL_syshaptic.c	Sat Aug 10 13:40:08 2013 -0400
     1.2 +++ b/src/haptic/windows/SDL_syshaptic.c	Sat Aug 10 13:46:19 2013 -0400
     1.3 @@ -1275,6 +1275,11 @@
     1.4          SDL_assert(data->type == SDL_HAPTIC_LEFTRIGHT);
     1.5          vib->wLeftMotorSpeed = data->leftright.large_magnitude;
     1.6          vib->wRightMotorSpeed = data->leftright.small_magnitude;
     1.7 +        SDL_LockMutex(haptic->hwdata->mutex);
     1.8 +        if (haptic->hwdata->stopTicks) {  /* running right now? Update it. */
     1.9 +            XINPUTSETSTATE(haptic->hwdata->userid, vib);
    1.10 +        }
    1.11 +        SDL_UnlockMutex(haptic->hwdata->mutex);
    1.12          return 0;
    1.13      }
    1.14