Only print out the controller mappings if we're not going to test a controller
authorSam Lantinga <slouken@libsdl.org>
Fri, 09 Dec 2016 04:17:10 -0800
changeset 10691c02fe6ba1cfd
parent 10690 23a825f341e6
child 10692 11a38cbeb30e
Only print out the controller mappings if we're not going to test a controller
test/testgamecontroller.c
     1.1 --- a/test/testgamecontroller.c	Fri Dec 09 01:47:43 2016 -0800
     1.2 +++ b/test/testgamecontroller.c	Fri Dec 09 04:17:10 2016 -0800
     1.3 @@ -260,15 +260,17 @@
     1.4      SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt");
     1.5  
     1.6      /* Print information about the mappings */
     1.7 -    SDL_Log("Supported mappings:\n");
     1.8 -    for (i = 0; i < SDL_GameControllerNumMappings(); ++i) {
     1.9 -        char *mapping = SDL_GameControllerMappingForIndex(i);
    1.10 -        if (mapping) {
    1.11 -            SDL_Log("\t%s\n", mapping);
    1.12 -            SDL_free(mapping);
    1.13 +    if (!argv[1]) {
    1.14 +        SDL_Log("Supported mappings:\n");
    1.15 +        for (i = 0; i < SDL_GameControllerNumMappings(); ++i) {
    1.16 +            char *mapping = SDL_GameControllerMappingForIndex(i);
    1.17 +            if (mapping) {
    1.18 +                SDL_Log("\t%s\n", mapping);
    1.19 +                SDL_free(mapping);
    1.20 +            }
    1.21          }
    1.22 +        SDL_Log("\n");
    1.23      }
    1.24 -    SDL_Log("\n");
    1.25  
    1.26      /* Print information about the controller */
    1.27      for (i = 0; i < SDL_NumJoysticks(); ++i) {