From 198d27b6fbfd683acc8d067f3e79e9808fd23586 Mon Sep 17 00:00:00 2001 From: ewasylishen Date: Thu, 3 Mar 2016 23:01:44 +0000 Subject: [PATCH] in_sdl.c: IN_StartupJoystick: do SDL_INIT_GAMECONTROLLER before SDL_GameControllerAddMappingsFromFile, to match the sdl testgamecontroller tool git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1296 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/in_sdl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quakespasm/Quake/in_sdl.c b/quakespasm/Quake/in_sdl.c index 84981e81..2d1ac707 100644 --- a/quakespasm/Quake/in_sdl.c +++ b/quakespasm/Quake/in_sdl.c @@ -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); @@ -297,12 +303,6 @@ void IN_StartupJoystick (void) if (nummappings > 0) 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++) {