From 15296eb4879649ae61d1e5bd2423df4878df6ed4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 8 Mar 2013 10:09:51 -0800 Subject: [PATCH] Don't re-read the hints when opening the game controller. Instead use SDL_GameControllerAddMapping() to add hints after initialization. --- include/SDL_hints.h | 3 +++ src/joystick/SDL_gamecontroller.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/SDL_hints.h b/include/SDL_hints.h index 66da58f23..a0b21039c 100644 --- a/include/SDL_hints.h +++ b/include/SDL_hints.h @@ -209,6 +209,9 @@ extern "C" { * \brief A variable that lets you manually hint extra gamecontroller db entries * * The variable expected newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + * You can update hints after the system is initialized with SDL_GameControllerAddMapping() */ #define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" diff --git a/src/joystick/SDL_gamecontroller.c b/src/joystick/SDL_gamecontroller.c index 90fb7b903..e4929a30b 100644 --- a/src/joystick/SDL_gamecontroller.c +++ b/src/joystick/SDL_gamecontroller.c @@ -879,8 +879,6 @@ SDL_GameControllerOpen(int device_index) } // Find a controller mapping - // Check for hints in case someone has changed them recently - SDL_GameControllerLoadHints(); pSupportedController = SDL_PrivateGetControllerMapping(device_index); if ( !pSupportedController ) { SDL_SetError("Couldn't find mapping for device (%d)", device_index );