diff src/haptic/SDL_haptic.c @ 2513:55fd9103a330 gsoc2008_force_feedback

Prefixed all haptic errors with "Haptic:" for easier readability.
author Edgar Simo <bobbens@gmail.com>
date Thu, 10 Jul 2008 11:39:28 +0000
parents ef147ee4896c
children 840e1b6325c0
line wrap: on
line diff
--- a/src/haptic/SDL_haptic.c	Thu Jul 10 08:38:08 2008 +0000
+++ b/src/haptic/SDL_haptic.c	Thu Jul 10 11:39:28 2008 +0000
@@ -67,7 +67,7 @@
    int valid;
    
    if (*haptic == NULL) {
-      SDL_SetError("Haptic device hasn't been opened yet");
+      SDL_SetError("Haptic: Device hasn't been opened yet");
       valid = 0;
    } else {
       valid = 1;
@@ -93,7 +93,7 @@
 SDL_HapticName(int device_index)
 {
    if ((device_index < 0) || (device_index >= SDL_numhaptics)) {
-      SDL_SetError("There are %d haptic devices available", SDL_numhaptics);
+      SDL_SetError("Haptic: There are %d haptic devices available", SDL_numhaptics);
       return NULL;
    }
    return SDL_SYS_HapticName(device_index);
@@ -110,7 +110,7 @@
    SDL_Haptic *haptic;
 
    if ((device_index < 0) || (device_index >= SDL_numhaptics)) {
-      SDL_SetError("There are %d haptic devices available", SDL_numhaptics);
+      SDL_SetError("Haptic: There are %d haptic devices available", SDL_numhaptics);
       return NULL;
    }
 
@@ -210,7 +210,7 @@
    device_index = SDL_SYS_HapticMouse();
 
    if (device_index < 0) {
-      SDL_SetError("Mouse isn't a haptic device.");
+      SDL_SetError("Haptic: Mouse isn't a haptic device.");
       return NULL;
    }
 
@@ -401,7 +401,7 @@
 
    /* Check to see if effect is supported */
    if (SDL_HapticEffectSupported(haptic,effect)==SDL_FALSE) {
-      SDL_SetError("Haptic effect not supported by haptic device.");
+      SDL_SetError("Haptic: Effect not supported by haptic device.");
       return -1;
    }
 
@@ -417,7 +417,7 @@
       }
    }
 
-   SDL_SetError("Haptic device has no free space left.");
+   SDL_SetError("Haptic: Device has no free space left.");
    return -1;
 }
 
@@ -428,7 +428,7 @@
 ValidEffect(SDL_Haptic * haptic, int effect)
 {
    if ((effect < 0) || (effect >= haptic->neffects)) {
-      SDL_SetError("Invalid haptic effect identifier.");
+      SDL_SetError("Haptic: Invalid effect identifier.");
       return 0;
    }
    return 1;
@@ -518,7 +518,7 @@
    }
 
    if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) {
-      SDL_SetError("Haptic device does not support status queries.");
+      SDL_SetError("Haptic: Device does not support status queries.");
       return -1;
    }
 
@@ -539,12 +539,12 @@
    }
 
    if ((haptic->supported & SDL_HAPTIC_GAIN) == 0) {
-      SDL_SetError("Haptic device does not support setting gain.");
+      SDL_SetError("Haptic: Device does not support setting gain.");
       return -1;
    }
 
    if ((gain < 0) || (gain > 100)) {
-      SDL_SetError("Haptic gain must be between 0 and 100.");
+      SDL_SetError("Haptic: Gain must be between 0 and 100.");
       return -1;
    }
 
@@ -582,12 +582,12 @@
    }
 
    if ((haptic->supported & SDL_HAPTIC_AUTOCENTER) == 0) {
-      SDL_SetError("Haptic device does not support setting autocenter.");
+      SDL_SetError("Haptic: Device does not support setting autocenter.");
       return -1;
    }
 
    if ((autocenter < 0) || (autocenter > 100)) {
-      SDL_SetError("Haptic autocenter must be between 0 and 100.");
+      SDL_SetError("Haptic: Autocenter must be between 0 and 100.");
       return -1;
    }