X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fcfgopt.c;h=8f3759baea6ead19ecda1048279608728c9bb04f;hp=ef161674dffef3c9d67d4d2790d737161dd7cae2;hb=c912e59b898fe1ac461a1468e4a2e1937de286d7;hpb=815504923a05c5f22a756b021997983e512474e1 diff --git a/src/cfgopt.c b/src/cfgopt.c index ef16167..8f3759b 100644 --- a/src/cfgopt.c +++ b/src/cfgopt.c @@ -4,12 +4,25 @@ #include #include "cfgopt.h" +#ifdef NDEBUG +/* release build default options */ +struct options opt = { + 0, /* start_scr */ + 1, /* music */ + 0, /* sball */ + 1, /* vsync */ + 0 /* dbginfo */ +}; +#else +/* debug build default options */ struct options opt = { 0, /* start_scr */ 0, /* music */ 0, /* sball */ - 1 /* vsync */ + 1, /* vsync */ + 1 /* dbginfo */ }; +#endif int parse_args(int argc, char **argv) { @@ -30,6 +43,10 @@ int parse_args(int argc, char **argv) opt.vsync = 1; } else if(strcmp(argv[i], "-novsync") == 0) { opt.vsync = 0; + } else if(strcmp(argv[i], "-dbg") == 0) { + opt.dbginfo = 1; + } else if(strcmp(argv[i], "-nodbg") == 0) { + opt.dbginfo = 0; } else { fprintf(stderr, "invalid option: %s\n", argv[i]); return -1; @@ -116,6 +133,8 @@ int load_config(const char *fname) opt.sball = bool_value(value); } else if(strcmp(line, "vsync") == 0) { opt.vsync = bool_value(value); + } else if(strcmp(line, "debug") == 0) { + opt.dbginfo = bool_value(value); } else { fprintf(stderr, "%s:%d invalid option: %s\n", fname, nline, line); return -1;