X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fopt.cc;h=f9bcf53df04d42544dabe42e9de3f275efba1e7e;hp=18d73f2f3bd5c743054ca3301cfb661c1bc9eb94;hb=8b3ce77b133bbac9979e75a6c88f6b86559d2705;hpb=fb11663a3654acd0132e71e5652e35b0ea72d544 diff --git a/src/opt.cc b/src/opt.cc index 18d73f2..f9bcf53 100644 --- a/src/opt.cc +++ b/src/opt.cc @@ -10,7 +10,8 @@ Options def_opt = { 1280, 800, false, // vr false, // fullscreen - 0 // scene file + 0, // scene file + true // music }; enum { @@ -19,6 +20,7 @@ enum { OPT_FULLSCREEN, OPT_WINDOWED, OPT_SCENEFILE, + OPT_MUSIC, OPT_HELP }; @@ -29,6 +31,7 @@ static optcfg_option options[] = { {'f', "fullscreen", OPT_FULLSCREEN, "run in fullscreen mode"}, {'w', "windowed", OPT_WINDOWED, "run in windowed mode"}, {0, "scene", OPT_SCENEFILE, "scene file to open"}, + {'m', "music", OPT_MUSIC, "play background audio"}, {'h', "help", OPT_HELP, "print usage and exit"}, OPTCFG_OPTIONS_END }; @@ -95,8 +98,12 @@ static int opt_handler(optcfg *oc, int optid, void *cls) opt.scenefile = strdup(optcfg_next_value(oc)); break; + case OPT_MUSIC: + opt.music = is_enabled(oc); + break; + case OPT_HELP: - printf("Usage: vrfileman [options]\nOptions:\n"); + printf("Usage: demo [options]\nOptions:\n"); optcfg_print_options(oc); exit(0); }