Mercurial > sdl-ios-xcode
diff src/haptic/darwin/SDL_syshaptic.c @ 2637:2f826c229d77 gsoc2008_force_feedback
First draft of darwin haptic<->joystick stuff.
author | Edgar Simo <bobbens@gmail.com> |
---|---|
date | Sun, 10 Aug 2008 19:45:38 +0000 |
parents | 6b0d1f494c10 |
children | 668fee3b268a |
line wrap: on
line diff
--- a/src/haptic/darwin/SDL_syshaptic.c Wed Aug 06 17:14:54 2008 +0000 +++ b/src/haptic/darwin/SDL_syshaptic.c Sun Aug 10 19:45:38 2008 +0000 @@ -447,6 +447,8 @@ int SDL_SYS_JoystickIsHaptic(SDL_Joystick * joystick) { + if (joystick->hwdata->ffservice != 0) + return SDL_TRUE; return SDL_FALSE; } @@ -457,6 +459,8 @@ int SDL_SYS_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick) { + if (IOObjectIsEqualTo(haptic->hwdata->device, joystick->hwdata->ffservice)) + return 1; return 0; } @@ -467,7 +471,8 @@ int SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick) { - return -1; + return SDL_SYS_HapticOpenFromService(haptic, + joystick->hwdata->ffservice); }