| 114 | } |
| 115 | |
| 116 | int |
| 117 | SDLTest_CommonArg(SDLTest_CommonState * state, int index) |
| 118 | { |
| 119 | char **argv = state->argv; |
| 120 | |
| 121 | if (SDL_strcasecmp(argv[index], "--video") == 0) { |
| 122 | ++index; |
| 123 | if (!argv[index]) { |
| 124 | return -1; |
| 125 | } |
| 126 | state->videodriver = argv[index]; |
| 127 | return 2; |
| 128 | } |
| 129 | if (SDL_strcasecmp(argv[index], "--renderer") == 0) { |
| 130 | ++index; |
| 131 | if (!argv[index]) { |
| 132 | return -1; |
| 133 | } |
| 134 | state->renderdriver = argv[index]; |
| 135 | return 2; |
| 136 | } |
| 137 | if (SDL_strcasecmp(argv[index], "--gldebug") == 0) { |
| 138 | state->gl_debug = 1; |
| 139 | return 1; |
| 140 | } |
| 141 | if (SDL_strcasecmp(argv[index], "--info") == 0) { |
| 142 | ++index; |
| 143 | if (!argv[index]) { |
| 144 | return -1; |
| 145 | } |
| 146 | if (SDL_strcasecmp(argv[index], "all") == 0) { |
| 147 | state->verbose |= |
| 148 | (VERBOSE_VIDEO | VERBOSE_MODES | VERBOSE_RENDER | |
| 149 | VERBOSE_EVENT); |
| 150 | return 2; |
| 151 | } |
| 152 | if (SDL_strcasecmp(argv[index], "video") == 0) { |
| 153 | state->verbose |= VERBOSE_VIDEO; |
| 154 | return 2; |
| 155 | } |
| 156 | if (SDL_strcasecmp(argv[index], "modes") == 0) { |
| 157 | state->verbose |= VERBOSE_MODES; |
| 158 | return 2; |
| 159 | } |
| 160 | if (SDL_strcasecmp(argv[index], "render") == 0) { |
| 161 | state->verbose |= VERBOSE_RENDER; |
| 162 | return 2; |
| 163 | } |
| 164 | if (SDL_strcasecmp(argv[index], "event") == 0) { |
| 165 | state->verbose |= VERBOSE_EVENT; |
| 166 | return 2; |
| 167 | } |
| 168 | return -1; |
| 169 | } |
| 170 | if (SDL_strcasecmp(argv[index], "--log") == 0) { |
| 171 | ++index; |
| 172 | if (!argv[index]) { |
| 173 | return -1; |
no test coverage detected