Don't re-read the hints when opening the game controller. Instead use SDL_GameControllerAddMapping() to add hints after initialization.
authorSam Lantinga <slouken@libsdl.org>
Fri, 08 Mar 2013 10:09:51 -0800
changeset 6980 1d3565d686f1
parent 6979 8d6ab3bdc08b
child 6981 8925ae6ab499
Don't re-read the hints when opening the game controller. Instead use SDL_GameControllerAddMapping() to add hints after initialization.
include/SDL_hints.h
src/joystick/SDL_gamecontroller.c
--- a/include/SDL_hints.h	Fri Mar 08 11:30:25 2013 -0300
+++ b/include/SDL_hints.h	Fri Mar 08 10:09:51 2013 -0800
@@ -209,6 +209,9 @@
  *  \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"
 
--- a/src/joystick/SDL_gamecontroller.c	Fri Mar 08 11:30:25 2013 -0300
+++ b/src/joystick/SDL_gamecontroller.c	Fri Mar 08 10:09:51 2013 -0800
@@ -879,8 +879,6 @@
     }
 
 	// 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 );