Fixed SDL_HapticRumblePlay() maybe working because of SDL_HapticUpdateEffect().
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sat, 27 Jul 2013 13:52:16 +0200
changeset 7531 a117b90a3a12
parent 7530 7f26fd1df927
child 7532 2c54272792e2
Fixed SDL_HapticRumblePlay() maybe working because of SDL_HapticUpdateEffect().
src/haptic/SDL_haptic.c
--- a/src/haptic/SDL_haptic.c	Sat Jul 27 13:39:43 2013 +0200
+++ b/src/haptic/SDL_haptic.c	Sat Jul 27 13:52:16 2013 +0200
@@ -781,7 +781,6 @@
 int
 SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length)
 {
-    int ret;
     SDL_HapticPeriodic *efx;
 
     if (!ValidHaptic(haptic)) {
@@ -804,9 +803,8 @@
     efx = &haptic->rumble_effect.periodic;
     efx->magnitude = (Sint16)(32767.0f*strength);
     efx->length = length;
-    ret = SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect);
-    if (ret) {
-        return ret;
+    if (SDL_HapticUpdateEffect(haptic, haptic->rumble_id, &haptic->rumble_effect) < 0) {
+        return -1;
     }
 
     return SDL_HapticRunEffect(haptic, haptic->rumble_id, 1);