diff src/haptic/darwin/SDL_syshaptic.c @ 2646:9408be170bff gsoc2008_force_feedback

Added SDL_HapticStopAll. Cleaned up the dummy haptic driver a bit.
author Edgar Simo <bobbens@gmail.com>
date Sun, 24 Aug 2008 17:32:50 +0000
parents 269ba4f28d0e
children
line wrap: on
line diff
--- a/src/haptic/darwin/SDL_syshaptic.c	Sun Aug 24 17:17:45 2008 +0000
+++ b/src/haptic/darwin/SDL_syshaptic.c	Sun Aug 24 17:32:50 2008 +0000
@@ -1233,7 +1233,7 @@
    HRESULT ret;
 
    ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
-         FFSFFC_PAUSE);
+                                          FFSFFC_PAUSE);
    if (ret != FF_OK) {
       SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
       return -1;
@@ -1252,7 +1252,7 @@
    HRESULT ret;
 
    ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
-         FFSFFC_CONTINUE);
+                                          FFSFFC_CONTINUE);
    if (ret != FF_OK) {
       SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
       return -1;
@@ -1262,4 +1262,23 @@
 }
 
 
+/*
+ * Stops all currently playing effects.
+ */
+int
+SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
+{
+   HRESULT ret;
+
+   ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
+                                          FFSFFC_STOPALL); 
+   if (ret != FF_OK) {
+      SDL_SetError("Haptic: Error stopping device: %s.", FFStrError(ret));
+      return -1;
+   }
+
+   return 0;
+}
+
+
 #endif /* SDL_HAPTIC_IOKIT */