# HG changeset patch # User Sam Lantinga # Date 1218423092 0 # Node ID e8a54b6fd5120235dc96797f616ace5e0c46e319 # Parent 668fee3b268a83394c9be4fda94354e5ca45262f Fixed force feedback detection of joystick devices diff -r 668fee3b268a -r e8a54b6fd512 src/joystick/darwin/SDL_sysjoystick.c --- 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;