Sdl gamecontrollerdb.txt fix (#356)
sdl: load gamecontrollerdb.txt before calling SDL_InitSubSystem
This commit is contained in:
parent
17348dae8a
commit
22947af854
|
@ -158,9 +158,6 @@ void input_sdl_init()
|
|||
SDL_SetHint(SDL_HINT_XINPUT_ENABLED, "0");
|
||||
}
|
||||
#endif
|
||||
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0)
|
||||
die("SDL: error initializing Joystick subsystem");
|
||||
|
||||
std::string db = get_readonly_data_path("gamecontrollerdb.txt");
|
||||
int rv = SDL_GameControllerAddMappingsFromFile(db.c_str());
|
||||
if (rv < 0)
|
||||
|
@ -170,6 +167,10 @@ void input_sdl_init()
|
|||
}
|
||||
if (rv > 0)
|
||||
DEBUG_LOG(INPUT ,"%d mappings loaded from %s", rv, db.c_str());
|
||||
|
||||
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0)
|
||||
die("SDL: error initializing Joystick subsystem");
|
||||
|
||||
}
|
||||
if (SDL_WasInit(SDL_INIT_HAPTIC) == 0)
|
||||
SDL_InitSubSystem(SDL_INIT_HAPTIC);
|
||||
|
|
Loading…
Reference in New Issue