Skip to content

Commit d4f311d

Browse files
committed
simplified SDL_GameControllerAddMappingsFromFile code
1 parent ec13b6f commit d4f311d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

UnleashedRecomp/hid/driver/sdl_hid.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,9 @@ void hid::Init()
345345

346346
SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER);
347347

348-
// Load SDL_GameControllerDB mappings from file
349-
const char* mappingFile = "gamecontrollerdb.txt";
350-
int mappingsAdded = SDL_GameControllerAddMappingsFromFile(mappingFile);
351-
if (mappingsAdded > 0) {
352-
LOGFN("Loaded {} controller mapping(s) from SDL_GameControllerDB file", mappingsAdded, mappingFile);
348+
// Load controller mappings from SDL_GameControllerDB
349+
if (int mappings = SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt"); mappings > 0) {
350+
LOGFN("Loaded {} controller mappings", mappings);
353351
}
354352
}
355353

0 commit comments

Comments
 (0)