From de5434ea23dc1bad9ab5c2ff49ba560a83aae158 Mon Sep 17 00:00:00 2001 From: NepDisk Date: Fri, 13 Jun 2025 09:40:57 -0400 Subject: [PATCH] Add support for using custom SDL2 mappings --- src/sdl/i_system.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index 925812325..995edc626 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -1294,6 +1294,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);