Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Don't re-read the hints when opening the game controller. Instead use…
Browse files Browse the repository at this point in the history
… SDL_GameControllerAddMapping() to add hints after initialization.
  • Loading branch information
slouken committed Mar 8, 2013
1 parent a2a777e commit 15296eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions include/SDL_hints.h
Expand Up @@ -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"

Expand Down
2 changes: 0 additions & 2 deletions src/joystick/SDL_gamecontroller.c
Expand Up @@ -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 );
Expand Down

0 comments on commit 15296eb

Please sign in to comment.