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 69801d3565d686f1
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
     1.1 --- a/include/SDL_hints.h	Fri Mar 08 11:30:25 2013 -0300
     1.2 +++ b/include/SDL_hints.h	Fri Mar 08 10:09:51 2013 -0800
     1.3 @@ -209,6 +209,9 @@
     1.4   *  \brief  A variable that lets you manually hint extra gamecontroller db entries
     1.5   *
     1.6   *  The variable expected newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
     1.7 + *
     1.8 + *  This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
     1.9 + *  You can update hints after the system is initialized with SDL_GameControllerAddMapping()
    1.10   */
    1.11  #define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
    1.12  
     2.1 --- a/src/joystick/SDL_gamecontroller.c	Fri Mar 08 11:30:25 2013 -0300
     2.2 +++ b/src/joystick/SDL_gamecontroller.c	Fri Mar 08 10:09:51 2013 -0800
     2.3 @@ -879,8 +879,6 @@
     2.4      }
     2.5  
     2.6  	// Find a controller mapping 
     2.7 -    // Check for hints in case someone has changed them recently
     2.8 -    SDL_GameControllerLoadHints();
     2.9  	pSupportedController =  SDL_PrivateGetControllerMapping(device_index);
    2.10  	if ( !pSupportedController ) {
    2.11  		SDL_SetError("Couldn't find mapping for device (%d)", device_index );