From 7d3a7ef827ba16bc75d6d839bfe8e540aeaa8099 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 15 Aug 2018 23:35:54 -0700 Subject: [PATCH] Use a single hint for both Xbox 360 and Xbox One controllers, since they are often the same driver. --- include/SDL_hints.h | 15 ++------------- src/joystick/hidapi/SDL_hidapi_xbox360.c | 2 +- src/joystick/hidapi/SDL_hidapi_xboxone.c | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/include/SDL_hints.h b/include/SDL_hints.h index fcfc5152c638b..7b159767d6159 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -510,7 +510,7 @@ extern "C" { #define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH" /** - * \brief A variable controlling whether the HIDAPI driver for XBox 360 controllers should be used. + * \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used. * * This variable can be set to the following values: * "0" - HIDAPI driver is not used @@ -518,18 +518,7 @@ extern "C" { * * The default is the value of SDL_HINT_JOYSTICK_HIDAPI */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOX360 "SDL_JOYSTICK_HIDAPI_XBOX360" - -/** - * \brief A variable controlling whether the HIDAPI driver for XBox One controllers should be used. - * - * This variable can be set to the following values: - * "0" - HIDAPI driver is not used - * "1" - HIDAPI driver is used - * - * The default is the value of SDL_HINT_JOYSTICK_HIDAPI - */ -#define SDL_HINT_JOYSTICK_HIDAPI_XBOXONE "SDL_JOYSTICK_HIDAPI_XBOXONE" +#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX" /** * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360.c b/src/joystick/hidapi/SDL_hidapi_xbox360.c index fbd9f19762787..ac0b9f48996c6 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c @@ -444,7 +444,7 @@ HIDAPI_DriverXbox360_Quit(SDL_Joystick *joystick, hid_device *dev, void *context SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXbox360 = { - SDL_HINT_JOYSTICK_HIDAPI_XBOX360, + SDL_HINT_JOYSTICK_HIDAPI_XBOX, SDL_TRUE, HIDAPI_DriverXbox360_IsSupportedDevice, HIDAPI_DriverXbox360_GetDeviceName, diff --git a/src/joystick/hidapi/SDL_hidapi_xboxone.c b/src/joystick/hidapi/SDL_hidapi_xboxone.c index f71398363b17a..1379f6cfcb9af 100644 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c @@ -301,7 +301,7 @@ HIDAPI_DriverXboxOne_Quit(SDL_Joystick *joystick, hid_device *dev, void *context SDL_HIDAPI_DeviceDriver SDL_HIDAPI_DriverXboxOne = { - SDL_HINT_JOYSTICK_HIDAPI_XBOXONE, + SDL_HINT_JOYSTICK_HIDAPI_XBOX, SDL_TRUE, HIDAPI_DriverXboxOne_IsSupportedDevice, HIDAPI_DriverXboxOne_GetDeviceName,