Mercurial > sdl-ios-xcode
comparison 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 |
comparison
equal
deleted
inserted
replaced
2645:269ba4f28d0e | 2646:9408be170bff |
---|---|
25 | 25 |
26 #include "SDL_haptic.h" | 26 #include "SDL_haptic.h" |
27 #include "../SDL_syshaptic.h" | 27 #include "../SDL_syshaptic.h" |
28 | 28 |
29 | 29 |
30 static int | |
31 SDL_SYS_LogicError(void) | |
32 { | |
33 SDL_SetError("Logic error: No haptic devices available.");; | |
34 } | |
35 | |
36 | |
30 int | 37 int |
31 SDL_SYS_HapticInit(void) | 38 SDL_SYS_HapticInit(void) |
32 { | 39 { |
33 return 0; | 40 return 0; |
34 } | 41 } |
35 | 42 |
36 | 43 |
37 const char * | 44 const char * |
38 SDL_SYS_HapticName(int index) | 45 SDL_SYS_HapticName(int index) |
39 { | 46 { |
40 SDL_SetError("Logic error: No haptic devices available."); | 47 SDL_SYS_LogicError(); |
41 return NULL; | 48 return NULL; |
42 } | 49 } |
43 | 50 |
44 | 51 |
45 int | 52 int |
46 SDL_SYS_HapticOpen(SDL_Haptic * haptic) | 53 SDL_SYS_HapticOpen(SDL_Haptic * haptic) |
47 { | 54 { |
48 SDL_SetError("Logic error: No haptic devices available."); | 55 SDL_SYS_LogicError(); |
49 return -1; | 56 return -1; |
50 } | 57 } |
51 | 58 |
52 | 59 |
53 int | 60 int |
65 | 72 |
66 | 73 |
67 int | 74 int |
68 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) | 75 SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) |
69 { | 76 { |
70 SDL_SetError("Logic error: No haptic devices available."); | 77 SDL_SYS_LogicError(); |
71 return -1; | 78 return -1; |
72 } | 79 } |
73 | 80 |
74 | 81 |
75 int | 82 int |
96 int | 103 int |
97 SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, | 104 SDL_SYS_HapticNewEffect(SDL_Haptic * haptic, |
98 struct haptic_effect * effect, | 105 struct haptic_effect * effect, |
99 SDL_HapticEffect * base) | 106 SDL_HapticEffect * base) |
100 { | 107 { |
101 SDL_SetError("Logic error: No haptic devices available."); | 108 SDL_SYS_LogicError(); |
102 return -1; | 109 return -1; |
103 } | 110 } |
104 | 111 |
105 | 112 |
106 int | 113 int |
107 SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, | 114 SDL_SYS_HapticUpdateEffect(SDL_Haptic * haptic, |
108 struct haptic_effect * effect, | 115 struct haptic_effect * effect, |
109 SDL_HapticEffect * data) | 116 SDL_HapticEffect * data) |
110 { | 117 { |
111 SDL_SetError("Logic error: No haptic devices available."); | 118 SDL_SYS_LogicError(); |
112 return -1; | 119 return -1; |
113 } | 120 } |
114 | 121 |
115 | 122 |
116 int | 123 int |
117 SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect * effect, Uint32 iterations) | 124 SDL_SYS_HapticRunEffect(SDL_Haptic * haptic, struct haptic_effect * effect, Uint32 iterations) |
118 { | 125 { |
119 SDL_SetError("Logic error: No haptic devices available."); | 126 SDL_SYS_LogicError(); |
120 return -1; | 127 return -1; |
121 } | 128 } |
122 | 129 |
123 | 130 |
124 int | 131 int |
125 SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect * effect) | 132 SDL_SYS_HapticStopEffect(SDL_Haptic * haptic, struct haptic_effect * effect) |
126 { | 133 { |
127 SDL_SetError("Logic error: No haptic devices available."); | 134 SDL_SYS_LogicError(); |
128 return -1; | 135 return -1; |
129 } | 136 } |
130 | 137 |
131 | 138 |
132 void | 139 void |
133 SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect * effect) | 140 SDL_SYS_HapticDestroyEffect(SDL_Haptic * haptic, struct haptic_effect * effect) |
134 { | 141 { |
135 SDL_SetError("Logic error: No haptic devices available."); | 142 SDL_SYS_LogicError(); |
136 return; | 143 return; |
137 } | 144 } |
138 | 145 |
139 | 146 |
140 int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect * effect) | 147 int SDL_SYS_HapticGetEffectStatus(SDL_Haptic * haptic, struct haptic_effect * effect) |
141 { | 148 { |
142 SDL_SetError("Logic error: No Haptic devices available."); | 149 SDL_SYS_LogicError(); |
143 return -1; | 150 return -1; |
144 } | 151 } |
145 | 152 |
146 | 153 |
147 int | 154 int |
148 SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) | 155 SDL_SYS_HapticSetGain(SDL_Haptic * haptic, int gain) |
149 { | 156 { |
150 SDL_SetError("Logic error: No haptic devices available."); | 157 SDL_SYS_LogicError(); |
151 return -1; | 158 return -1; |
152 } | 159 } |
153 | 160 |
154 | 161 |
155 int | 162 int |
156 SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) | 163 SDL_SYS_HapticSetAutocenter(SDL_Haptic * haptic, int autocenter) |
157 { | 164 { |
158 SDL_SetError("Logic error: No haptic devices available."); | 165 SDL_SYS_LogicError(); |
159 return -1; | 166 return -1; |
160 } | 167 } |
161 | 168 |
162 int | 169 int |
163 SDL_SYS_HapticPause(SDL_Haptic * haptic) | 170 SDL_SYS_HapticPause(SDL_Haptic * haptic) |
164 { | 171 { |
165 SDL_SetError("Logic error: No haptic devices available."); | 172 SDL_SYS_LogicError(); |
166 return -1; | 173 return -1; |
167 } | 174 } |
168 | 175 |
169 int | 176 int |
170 SDL_SYS_HapticUnpause(SDL_Haptic * haptic) | 177 SDL_SYS_HapticUnpause(SDL_Haptic * haptic) |
171 { | 178 { |
172 SDL_SetError("Logic error: No haptic devices available."); | 179 SDL_SYS_LogicError(); |
180 return -1; | |
181 } | |
182 | |
183 int | |
184 SDL_SYS_HapticStopAll(SDL_Haptic * haptic) | |
185 { | |
186 SDL_SYS_LogicError(); | |
173 return -1; | 187 return -1; |
174 } | 188 } |
175 | 189 |
176 | 190 |
191 | |
177 #endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */ | 192 #endif /* SDL_HAPTIC_DUMMY || SDL_HAPTIC_DISABLED */ |