MCPcopy Create free account
hub / github.com/diasurgical/devilution / diablo_parse_flags

Function diablo_parse_flags

Source/diablo.cpp:333–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333void diablo_parse_flags(int argc, char **argv)
334{
335 for (int i = 1; i < argc; i++) {
336 if (strcasecmp("-h", argv[i]) == 0 || strcasecmp("--help", argv[i]) == 0) {
337 print_help_and_exit();
338 } else if (strcasecmp("--version", argv[i]) == 0) {
339 printf("%s v%s\n", PROJECT_NAME, PROJECT_VERSION);
340 exit(0);
341 } else if (strcasecmp("--data-dir", argv[i]) == 0) {
342 basePath = argv[++i];
343#ifdef _WIN32
344 if (basePath.back() != '\\')
345 basePath += '\\';
346#else
347 if (basePath.back() != '/')
348 basePath += '/';
349#endif
350 } else if (strcasecmp("-n", argv[i]) == 0) {
351 showintrodebug = 0;
352 } else if (strcasecmp("-f", argv[i]) == 0) {
353 EnableFrameCount();
354 } else if (strcasecmp("-x", argv[i]) == 0) {
355 fullscreen = FALSE;
356#ifdef _DEBUG
357 } else if (strcasecmp("-^", argv[i]) == 0) {
358 debug_mode_key_inverted_v = 1;
359 } else if (strcasecmp("-$", argv[i]) == 0) {
360 debug_mode_dollar_sign = 1;
361 /*
362 } else if (strcasecmp("-b", argv[i]) == 0) {
363 debug_mode_key_b = 1;
364 */
365 } else if (strcasecmp("-d", argv[i]) == 0) {
366 debug_mode_key_d = 1;
367 } else if (strcasecmp("-i", argv[i]) == 0) {
368 debug_mode_key_i = 1;
369 /*
370 } else if (strcasecmp("-j", argv[i]) == 0) {
371 debug_mode_key_J_trigger = argv[++i];
372 */
373 } else if (strcasecmp("-l", argv[i]) == 0) {
374 setlevel = FALSE;
375 leveldebug = TRUE;
376 leveltype = SDL_atoi(argv[++i]);
377 currlevel = SDL_atoi(argv[++i]);
378 plr[0].plrlevel = currlevel;
379 } else if (strcasecmp("-m", argv[i]) == 0) {
380 monstdebug = TRUE;
381 DebugMonsters[debugmonsttypes++] = SDL_atoi(argv[++i]);
382 } else if (strcasecmp("-q", argv[i]) == 0) {
383 questdebug = SDL_atoi(argv[++i]);
384 } else if (strcasecmp("-r", argv[i]) == 0) {
385 setseed = SDL_atoi(argv[++i]);
386 } else if (strcasecmp("-s", argv[i]) == 0) {
387 debug_mode_key_s = 1;
388 } else if (strcasecmp("-t", argv[i]) == 0) {
389 leveldebug = TRUE;
390 setlevel = TRUE;

Callers 1

DiabloMainFunction · 0.85

Calls 2

print_help_and_exitFunction · 0.85
EnableFrameCountFunction · 0.85

Tested by

no test coverage detected