src/haptic/linux/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2646 9408be170bff
parent 2645 269ba4f28d0e
child 2647 e871cff1e3d2
--- a/src/haptic/linux/SDL_syshaptic.c	Sun Aug 24 17:17:45 2008 +0000
+++ b/src/haptic/linux/SDL_syshaptic.c	Sun Aug 24 17:32:50 2008 +0000
@@ -910,4 +910,24 @@
 }
 
 
+/*
+ * Stops all the currently playing effects.
+ */
+int
+SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
+{
+   int i, ret;;
+
+   for (i=0; i<haptic->neffects; i++) {
+      ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]);
+      if (ret < 0) {
+         SDL_SetError("Haptic: Error while trying to stop all playing effects.");
+         return -1;
+      }
+   }
+
+   return 0;
+}
+
+
 #endif /* SDL_HAPTIC_LINUX */