Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Don't re-read the hints when opening the game controller. Instead use…

… SDL_GameControllerAddMapping() to add hints after initialization.
  • Loading branch information
slouken committed Mar 8, 2013
1 parent a2a777e commit 15296eb4879649ae61d1e5bd2423df4878df6ed4
Showing with 3 additions and 2 deletions.
  1. +3 −0 include/SDL_hints.h
  2. +0 −2 src/joystick/SDL_gamecontroller.c
@@ -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"

@@ -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 );

0 comments on commit 15296eb

Please sign in to comment.