Patched to compile on Windows.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 08 Apr 2015 02:24:17 -0400
changeset 947740d5259af023
parent 9476 2928e95ffcaf
child 9478 ab2fd840ba25
Patched to compile on Windows.
src/joystick/windows/SDL_dinputjoystick.c
     1.1 --- a/src/joystick/windows/SDL_dinputjoystick.c	Wed Apr 08 02:22:28 2015 -0400
     1.2 +++ b/src/joystick/windows/SDL_dinputjoystick.c	Wed Apr 08 02:24:17 2015 -0400
     1.3 @@ -340,16 +340,16 @@
     1.4  {
     1.5      JoyStick_DeviceData *pNewJoystick;
     1.6      JoyStick_DeviceData *pPrevJoystick = NULL;
     1.7 +    const DWORD devtype = (pdidInstance->dwDevType & 0xFF);
     1.8 +
     1.9 +    if ((devtype != DI8DEVTYPE_JOYSTICK) && (devtype != DI8DEVTYPE_GAMEPAD)) {
    1.10 +        return DIENUM_CONTINUE;  /* Ignore touchpads, etc. */
    1.11 +    }
    1.12  
    1.13      if (SDL_IsXInputDevice(&pdidInstance->guidProduct)) {
    1.14          return DIENUM_CONTINUE;  /* ignore XInput devices here, keep going. */
    1.15      }
    1.16  
    1.17 -    const DWORD devtype = (pdidInstance->dwDevType & 0xFF);
    1.18 -    if ((devtype != DI8DEVTYPE_JOYSTICK) && (devtype != DI8DEVTYPE_GAMEPAD)) {
    1.19 -        return DIENUM_CONTINUE;  /* Ignore touchpads, etc. */
    1.20 -    }
    1.21 -
    1.22      pNewJoystick = *(JoyStick_DeviceData **)pContext;
    1.23      while (pNewJoystick) {
    1.24          if (!SDL_memcmp(&pNewJoystick->dxdevice.guidInstance, &pdidInstance->guidInstance, sizeof(pNewJoystick->dxdevice.guidInstance))) {