src/haptic/SDL_haptic.c
branchgsoc2008_force_feedback
changeset 2479 b9eb2cfe16cd
parent 2478 4fd783e0f34b
child 2480 b883974445fc
--- a/src/haptic/SDL_haptic.c	Mon Jun 30 17:28:34 2008 +0000
+++ b/src/haptic/SDL_haptic.c	Mon Jun 30 21:38:29 2008 +0000
@@ -273,6 +273,13 @@
    if (!ValidHaptic(&haptic)) {
       return -1;
    }
+
+   /* Run the effect */
+   if (SDL_SYS_HapticRunEffect(haptic,&haptic->effects[effect]) < 0) {
+      return -1;
+   }
+
+   return 0;
 }
 
 /*
@@ -284,6 +291,13 @@
    if (!ValidHaptic(&haptic)) {
       return;
    }
+
+   /* Not allocated */
+   if (haptic->effects[effect].hweffect == NULL) {
+      return;
+   }
+
+   SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]);
 }