comparison src/haptic/SDL_haptic.c @ 3080:4094b4f1c3a1

More verbosity and error checking.
author Edgar Simo <bobbens@gmail.com>
date Sat, 21 Feb 2009 18:03:22 +0000
parents 0906692aa6a4
children aa8de4b80772
comparison
equal deleted inserted replaced
3079:cfc8b35ad6b1 3080:4094b4f1c3a1
64 { 64 {
65 int i; 65 int i;
66 int valid; 66 int valid;
67 67
68 valid = 0; 68 valid = 0;
69 for (i = 0; i < SDL_numhaptics; i++) { 69 if (haptic != NULL) {
70 if (SDL_haptics[i] == haptic) { 70 for (i = 0; i < SDL_numhaptics; i++) {
71 valid = 1; 71 if (SDL_haptics[i] == haptic) {
72 break; 72 valid = 1;
73 break;
74 }
73 } 75 }
76 }
77
78 /* Create the error here. */
79 if (valid == 0) {
80 SDL_SetError("Haptic: Invalid haptic device identifier");
74 } 81 }
75 82
76 return valid; 83 return valid;
77 } 84 }
78 85