Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Only print out the controller mappings if we're not going to test a c…
…ontroller
  • Loading branch information
slouken committed Dec 9, 2016
1 parent 524bf3c commit 70aa2a5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions test/testgamecontroller.c
Expand Up @@ -260,15 +260,17 @@ main(int argc, char *argv[])
SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");

/* Print information about the mappings */
SDL_Log("Supported mappings:\n");
for (i = 0; i < SDL_GameControllerNumMappings(); ++i) {
char *mapping = SDL_GameControllerMappingForIndex(i);
if (mapping) {
SDL_Log("\t%s\n", mapping);
SDL_free(mapping);
if (!argv[1]) {
SDL_Log("Supported mappings:\n");
for (i = 0; i < SDL_GameControllerNumMappings(); ++i) {
char *mapping = SDL_GameControllerMappingForIndex(i);
if (mapping) {
SDL_Log("\t%s\n", mapping);
SDL_free(mapping);
}
}
SDL_Log("\n");
}
SDL_Log("\n");

/* Print information about the controller */
for (i = 0; i < SDL_NumJoysticks(); ++i) {
Expand Down

0 comments on commit 70aa2a5

Please sign in to comment.