changeset 2640:e8a54b6fd512 gsoc2008_force_feedback

Fixed force feedback detection of joystick devices
author Sam Lantinga <slouken@libsdl.org>
date Mon, 11 Aug 2008 02:51:32 +0000
parents 668fee3b268a
children e1e1be935178
files src/joystick/darwin/SDL_sysjoystick.c
diffstat 1 files changed, 9 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/joystick/darwin/SDL_sysjoystick.c	Sun Aug 10 19:53:58 2008 +0000
+++ b/src/joystick/darwin/SDL_sysjoystick.c	Mon Aug 11 02:51:32 2008 +0000
@@ -647,20 +647,6 @@
         if (!device)
             continue;
 
-        /* We have to do some storage of the io_service_t for
-         * SDL_HapticOpenFromJoystick */
-        if (FFIsForceFeedback((io_service_t)device) == FF_OK) {
-           device->ffservice = ioHIDDeviceObject;
-        }
-        else {
-           device->ffservice = 0;
-           /* dump device object, it is no longer needed */
-           result = IOObjectRelease(ioHIDDeviceObject);
-        }
-/*		if (KERN_SUCCESS != result)
-			HIDReportErrorNum ("IOObjectRelease error with ioHIDDeviceObject.", result);
-*/
-
         /* Filter device list to non-keyboard/mouse stuff */
         if ((device->usagePage != kHIDPage_GenericDesktop) ||
             ((device->usage != kHIDUsage_GD_Joystick &&
@@ -673,6 +659,15 @@
             continue;
         }
 
+        /* We have to do some storage of the io_service_t for
+         * SDL_HapticOpenFromJoystick */
+        if (FFIsForceFeedback(ioHIDDeviceObject) == FF_OK) {
+           device->ffservice = ioHIDDeviceObject;
+        }
+        else {
+           device->ffservice = 0;
+        }
+
         /* Add device to the end of the list */
         if (lastDevice)
             lastDevice->pNext = device;