Mercurial > sdl-ios-xcode
comparison src/haptic/SDL_haptic.c @ 2479:b9eb2cfe16cd gsoc2008_force_feedback
Added some preliminary support for haptic effect control.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Mon, 30 Jun 2008 21:38:29 +0000 |
parents | 4fd783e0f34b |
children | b883974445fc |
comparison
equal
deleted
inserted
replaced
2478:4fd783e0f34b | 2479:b9eb2cfe16cd |
---|---|
271 SDL_HapticRunEffect(SDL_Haptic * haptic, int effect) | 271 SDL_HapticRunEffect(SDL_Haptic * haptic, int effect) |
272 { | 272 { |
273 if (!ValidHaptic(&haptic)) { | 273 if (!ValidHaptic(&haptic)) { |
274 return -1; | 274 return -1; |
275 } | 275 } |
276 | |
277 /* Run the effect */ | |
278 if (SDL_SYS_HapticRunEffect(haptic,&haptic->effects[effect]) < 0) { | |
279 return -1; | |
280 } | |
281 | |
282 return 0; | |
276 } | 283 } |
277 | 284 |
278 /* | 285 /* |
279 * Gets rid of a haptic effect. | 286 * Gets rid of a haptic effect. |
280 */ | 287 */ |
282 SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect) | 289 SDL_HapticDestroyEffect(SDL_Haptic * haptic, int effect) |
283 { | 290 { |
284 if (!ValidHaptic(&haptic)) { | 291 if (!ValidHaptic(&haptic)) { |
285 return; | 292 return; |
286 } | 293 } |
287 } | 294 |
288 | 295 /* Not allocated */ |
289 | 296 if (haptic->effects[effect].hweffect == NULL) { |
297 return; | |
298 } | |
299 | |
300 SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]); | |
301 } | |
302 | |
303 |