Add support for using custom SDL2 mappings

This commit is contained in:
NepDisk authored and Alug committed 2026-04-14 20:25:03 +02:00
1 parent f70f7daa7b
commit b7ac1625d5
1 file changed
+12
+12
View File
@@ -981,6 +981,18 @@ void I_InitJoystick(UINT8 index)
if (M_CheckParm("-nojoy"))
return;
{
char dbpath[1024];
sprintf(dbpath, "%s" PATHSEP "gamecontrollerdb.txt", srb2path);
SDL_GameControllerAddMappingsFromFile(dbpath);
}
{
char dbpath[1024];
sprintf(dbpath, "%s" PATHSEP "gamecontrollerdb_user.txt", srb2home);
SDL_GameControllerAddMappingsFromFile(dbpath);
}
if (M_CheckParm("-noxinput"))
SDL_SetHintWithPriority("SDL_XINPUT_ENABLED", "0", SDL_HINT_OVERRIDE);