src/haptic/darwin/SDL_syshaptic.c
branchgsoc2008_force_feedback
changeset 2637 2f826c229d77
parent 2633 6b0d1f494c10
child 2639 668fee3b268a
--- 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);
 }