mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-11-01 20:16:40 +01:00
RMG-Input: load SDL_GameControllerDB
This commit is contained in:
1 parent
4a2c6761fc
commit
eea3ec7f95
1 file changed
+8
@@ -476,6 +476,8 @@ static unsigned char data_crc(unsigned char *data, int length)
|
||||
|
||||
void sdl_init()
|
||||
{
|
||||
std::filesystem::path gameControllerDbPath;
|
||||
|
||||
for (int subsystem : {SDL_INIT_GAMECONTROLLER, SDL_INIT_VIDEO, SDL_INIT_HAPTIC})
|
||||
{
|
||||
if (!SDL_WasInit(subsystem))
|
||||
@@ -483,6 +485,12 @@ void sdl_init()
|
||||
SDL_InitSubSystem(subsystem);
|
||||
}
|
||||
}
|
||||
|
||||
gameControllerDbPath = CoreGetSharedDataDirectory();
|
||||
gameControllerDbPath += "/gamecontrollerdb.txt";
|
||||
|
||||
// load mappings from file
|
||||
SDL_GameControllerAddMappingsFromFile(gameControllerDbPath.string().c_str());
|
||||
}
|
||||
|
||||
void sdl_quit()
|
||||
|
||||
Reference in new issue
Block a user