mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-19 10:31:08 +00:00
Load controllers from txt file
This commit is contained in:
parent
c1a0b4f854
commit
0a563fdb38
1 changed files with 12 additions and 0 deletions
|
@ -364,6 +364,18 @@ void IN_Init (void)
|
|||
Cvar_RegisterVariable( &joy_function );
|
||||
Cvar_RegisterVariable( &joy_swapmovelook );
|
||||
|
||||
char controllerdb[MAX_OSPATH];
|
||||
int mappings_added;
|
||||
q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", com_basedir);
|
||||
mappings_added = SDL_GameControllerAddMappingsFromFile(controllerdb);
|
||||
Con_Printf("Added %d controller mappings from '%s'", mappings_added, controllerdb);
|
||||
if (host_parms->userdir != host_parms->basedir)
|
||||
{
|
||||
q_snprintf (controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", host_parms->userdir);
|
||||
mappings_added = SDL_GameControllerAddMappingsFromFile(controllerdb);
|
||||
Con_Printf("Added %d controller mappings from '%s'", mappings_added, controllerdb);
|
||||
}
|
||||
|
||||
if ( SDL_InitSubSystem( SDL_INIT_GAMECONTROLLER ) == -1 ) {
|
||||
Con_Printf( "WARNING: Could not initialize SDL Game Controller\n" );
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue