diff src/haptic/dummy/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 54b892b6abb5
line wrap: on
line diff
--- a/src/haptic/dummy/SDL_syshaptic.c	Sun Aug 24 17:17:45 2008 +0000
+++ b/src/haptic/dummy/SDL_syshaptic.c	Sun Aug 24 17:32:50 2008 +0000
@@ -27,6 +27,13 @@
 #include "../SDL_syshaptic.h"
 
 
+static int
+SDL_SYS_LogicError(void)
+{
+   SDL_SetError("Logic error: No haptic devices available.");;
+}
+
+
 int
 SDL_SYS_HapticInit(void)
 {
@@ -37,7 +44,7 @@
 const char *
 SDL_SYS_HapticName(int index)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return NULL;
 }
 
@@ -45,7 +52,7 @@
 int
 SDL_SYS_HapticOpen(SDL_Haptic * haptic)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
@@ -67,7 +74,7 @@
 int
 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
@@ -98,7 +105,7 @@
                         struct haptic_effect * effect,
                         SDL_HapticEffect * base)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
@@ -108,7 +115,7 @@
                            struct haptic_effect * effect,
                            SDL_HapticEffect * data)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
@@ -116,7 +123,7 @@
 int
 SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect * effect, Uint32 iterations)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
@@ -124,7 +131,7 @@
 int
 SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
@@ -132,14 +139,14 @@
 void
 SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect * effect)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return;
 }
 
 
 int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect * effect)
 {
-   SDL_SetError("Logic error: No Haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
@@ -147,7 +154,7 @@
 int
 SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
@@ -155,23 +162,31 @@
 int
 SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
 int
 SDL_SYS_HapticPause(SDL_Haptic * haptic)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
    return -1;
 }
 
 int
 SDL_SYS_HapticUnpause(SDL_Haptic * haptic)
 {
-   SDL_SetError("Logic error: No haptic devices available.");
+   SDL_SYS_LogicError();
+   return -1;
+}
+
+int
+SDL_SYS_HapticStopAll(SDL_Haptic * haptic)
+{
+   SDL_SYS_LogicError();
    return -1;
 }
 
 
+
 #endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */