mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
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:
parent
dfcaa52260
commit
f8ccd07420
1 changed files with 6 additions and 6 deletions
|
@ -283,6 +283,12 @@ void IN_StartupJoystick (void)
|
||||||
if (COM_CheckParm("-nojoy"))
|
if (COM_CheckParm("-nojoy"))
|
||||||
return;
|
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
|
// Load additional SDL2 controller definitions from gamecontrollerdb.txt
|
||||||
q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", com_basedir);
|
q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", com_basedir);
|
||||||
nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb);
|
nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb);
|
||||||
|
@ -297,12 +303,6 @@ void IN_StartupJoystick (void)
|
||||||
if (nummappings > 0)
|
if (nummappings > 0)
|
||||||
Con_Printf("%d mappings loaded from gamecontrollerdb.txt\n", nummappings);
|
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++)
|
for (i = 0; i < SDL_NumJoysticks(); i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue