MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / main

Function main

deps/SDL2/test/testintersections.c:267–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267int
268main(int argc, char *argv[])
269{
270 int i;
271 Uint32 then, now, frames;
272
273 /* Enable standard application logging */
274 SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
275
276 /* Initialize parameters */
277 num_objects = NUM_OBJECTS;
278
279 /* Initialize test framework */
280 state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
281 if (!state) {
282 return 1;
283 }
284 for (i = 1; i < argc;) {
285 int consumed;
286
287 consumed = SDLTest_CommonArg(state, i);
288 if (consumed == 0) {
289 consumed = -1;
290 if (SDL_strcasecmp(argv[i], "--blend") == 0) {
291 if (argv[i + 1]) {
292 if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
293 blendMode = SDL_BLENDMODE_NONE;
294 consumed = 2;
295 } else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) {
296 blendMode = SDL_BLENDMODE_BLEND;
297 consumed = 2;
298 } else if (SDL_strcasecmp(argv[i + 1], "add") == 0) {
299 blendMode = SDL_BLENDMODE_ADD;
300 consumed = 2;
301 } else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) {
302 blendMode = SDL_BLENDMODE_MOD;
303 consumed = 2;
304 }
305 }
306 } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) {
307 cycle_color = SDL_TRUE;
308 consumed = 1;
309 } else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) {
310 cycle_alpha = SDL_TRUE;
311 consumed = 1;
312 } else if (SDL_isdigit(*argv[i])) {
313 num_objects = SDL_atoi(argv[i]);
314 consumed = 1;
315 }
316 }
317 if (consumed < 0) {
318 static const char *options[] = { "[--blend none|blend|add|mod]", "[--cyclecolor]", "[--cyclealpha]", NULL };
319 SDLTest_CommonLogUsage(state, argv[0], options);
320 return 1;
321 }
322 i += consumed;
323 }
324 if (!SDLTest_CommonInit(state)) {

Callers

nothing calls this directly

Calls 15

SDL_LogSetPriorityFunction · 0.85
SDLTest_CommonArgFunction · 0.85
SDL_strcasecmpFunction · 0.85
SDL_isdigitFunction · 0.85
SDL_atoiFunction · 0.85
SDLTest_CommonLogUsageFunction · 0.85
SDLTest_CommonInitFunction · 0.85
SDL_SetRenderDrawColorFunction · 0.85
SDL_RenderClearFunction · 0.85
SDLTest_CommonQuitFunction · 0.85

Tested by

no test coverage detected