in_sdl.c: IN_StartupJoystick: do SDL_INIT_GAMECONTROLLER before SDL_GameControllerAddMappingsFromFile, to match the sdl testgamecontroller tool

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1296 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Eric Wasylishen 2016-03-03 23:01:44 +00:00
parent dfcaa52260
commit f8ccd07420

View file

@ -283,6 +283,12 @@ void IN_StartupJoystick (void)
if (COM_CheckParm("-nojoy"))
return;
if (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == -1 )
{
Con_Warning("could not initialize SDL Game Controller\n");
return;
}
// Load additional SDL2 controller definitions from gamecontrollerdb.txt
q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", com_basedir);
nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb);
@ -298,12 +304,6 @@ void IN_StartupJoystick (void)
Con_Printf("%d mappings loaded from gamecontrollerdb.txt\n", nummappings);
}
if (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == -1 )
{
Con_Warning("could not initialize SDL Game Controller\n");
return;
}
for (i = 0; i < SDL_NumJoysticks(); i++)
{
const char *joyname = SDL_JoystickNameForIndex(i);