src/haptic/darwin/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2646 9408be170bff
parent 2645 269ba4f28d0e
     1.1 --- a/src/haptic/darwin/SDL_syshaptic.c	Sun Aug 24 17:17:45 2008 +0000
     1.2 +++ b/src/haptic/darwin/SDL_syshaptic.c	Sun Aug 24 17:32:50 2008 +0000
     1.3 @@ -1233,7 +1233,7 @@
     1.4     HRESULT ret;
     1.5  
     1.6     ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
     1.7 -         FFSFFC_PAUSE);
     1.8 +                                          FFSFFC_PAUSE);
     1.9     if (ret != FF_OK) {
    1.10        SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
    1.11        return -1;
    1.12 @@ -1252,7 +1252,7 @@
    1.13     HRESULT ret;
    1.14  
    1.15     ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
    1.16 -         FFSFFC_CONTINUE);
    1.17 +                                          FFSFFC_CONTINUE);
    1.18     if (ret != FF_OK) {
    1.19        SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
    1.20        return -1;
    1.21 @@ -1262,4 +1262,23 @@
    1.22  }
    1.23  
    1.24  
    1.25 +/*
    1.26 + * Stops all currently playing effects.
    1.27 + */
    1.28 +int
    1.29 +SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
    1.30 +{
    1.31 +   HRESULT ret;
    1.32 +
    1.33 +   ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
    1.34 +                                          FFSFFC_STOPALL); 
    1.35 +   if (ret != FF_OK) {
    1.36 +      SDL_SetError("Haptic: Error stopping device: %s.", FFStrError(ret));
    1.37 +      return -1;
    1.38 +   }
    1.39 +
    1.40 +   return 0;
    1.41 +}
    1.42 +
    1.43 +
    1.44  #endif /* SDL_HAPTIC_IOKIT */