src/haptic/SDL_haptic.c
branchgsoc2008_force_feedback
changeset 2479 b9eb2cfe16cd
parent 2478 4fd783e0f34b
child 2480 b883974445fc
     1.1 --- a/src/haptic/SDL_haptic.c	Mon Jun 30 17:28:34 2008 +0000
     1.2 +++ b/src/haptic/SDL_haptic.c	Mon Jun 30 21:38:29 2008 +0000
     1.3 @@ -273,6 +273,13 @@
     1.4     if (!ValidHaptic(&haptic)) {
     1.5        return -1;
     1.6     }
     1.7 +
     1.8 +   /* Run the effect */
     1.9 +   if (SDL_SYS_HapticRunEffect(haptic,&haptic->effects[effect]) < 0) {
    1.10 +      return -1;
    1.11 +   }
    1.12 +
    1.13 +   return 0;
    1.14  }
    1.15  
    1.16  /*
    1.17 @@ -284,6 +291,13 @@
    1.18     if (!ValidHaptic(&haptic)) {
    1.19        return;
    1.20     }
    1.21 +
    1.22 +   /* Not allocated */
    1.23 +   if (haptic->effects[effect].hweffect == NULL) {
    1.24 +      return;
    1.25 +   }
    1.26 +
    1.27 +   SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]);
    1.28  }
    1.29  
    1.30