Use a single hint for both Xbox 360 and Xbox One controllers, since they are often the same driver.
authorSam Lantinga <slouken@libsdl.org>
Wed, 15 Aug 2018 23:35:54 -0700
changeset 12119648377d0e573
parent 12118 2b80f9635ee5
child 12120 0131b11bd03f
Use a single hint for both Xbox 360 and Xbox One controllers, since they are often the same driver.
include/SDL_hints.h
src/joystick/hidapi/SDL_hidapi_xbox360.c
src/joystick/hidapi/SDL_hidapi_xboxone.c
     1.1 --- a/include/SDL_hints.h	Wed Aug 15 23:14:45 2018 -0700
     1.2 +++ b/include/SDL_hints.h	Wed Aug 15 23:35:54 2018 -0700
     1.3 @@ -510,7 +510,7 @@
     1.4  #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH"
     1.5  
     1.6  /**
     1.7 - *  \brief  A variable controlling whether the HIDAPI driver for XBox 360 controllers should be used.
     1.8 + *  \brief  A variable controlling whether the HIDAPI driver for XBox controllers should be used.
     1.9   *
    1.10   *  This variable can be set to the following values:
    1.11   *    "0"       - HIDAPI driver is not used
    1.12 @@ -518,18 +518,7 @@
    1.13   *
    1.14   *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
    1.15   */
    1.16 -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX360 "SDL_JOYSTICK_HIDAPI_XBOX360"
    1.17 -
    1.18 -/**
    1.19 - *  \brief  A variable controlling whether the HIDAPI driver for XBox One controllers should be used.
    1.20 - *
    1.21 - *  This variable can be set to the following values:
    1.22 - *    "0"       - HIDAPI driver is not used
    1.23 - *    "1"       - HIDAPI driver is used
    1.24 - *
    1.25 - *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
    1.26 - */
    1.27 -#define SDL_HINT_JOYSTICK_HIDAPI_XBOXONE "SDL_JOYSTICK_HIDAPI_XBOXONE"
    1.28 +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX   "SDL_JOYSTICK_HIDAPI_XBOX"
    1.29  
    1.30  /**
    1.31   *  \brief  A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
     2.1 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c	Wed Aug 15 23:14:45 2018 -0700
     2.2 +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c	Wed Aug 15 23:35:54 2018 -0700
     2.3 @@ -444,7 +444,7 @@
     2.4  
     2.5  SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360 =
     2.6  {
     2.7 -    SDL_HINT_JOYSTICK_HIDAPI_XBOX360,
     2.8 +    SDL_HINT_JOYSTICK_HIDAPI_XBOX,
     2.9      SDL_TRUE,
    2.10      HIDAPI_DriverXbox360_IsSupportedDevice,
    2.11      HIDAPI_DriverXbox360_GetDeviceName,
     3.1 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c	Wed Aug 15 23:14:45 2018 -0700
     3.2 +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c	Wed Aug 15 23:35:54 2018 -0700
     3.3 @@ -301,7 +301,7 @@
     3.4  
     3.5  SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXboxOne =
     3.6  {
     3.7 -    SDL_HINT_JOYSTICK_HIDAPI_XBOXONE,
     3.8 +    SDL_HINT_JOYSTICK_HIDAPI_XBOX,
     3.9      SDL_TRUE,
    3.10      HIDAPI_DriverXboxOne_IsSupportedDevice,
    3.11      HIDAPI_DriverXboxOne_GetDeviceName,