dbf_amiga

view src/opt.cc @ 0:87dfe0e10235

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 31 Aug 2015 07:38:37 +0300
parents
children
line source
1 #include <stdio.h>
2 #include "opt.h"
4 Options opt;
6 bool init_options(int argc, char **argv)
7 {
8 opt.xres = 1280;
9 opt.yres = 800;
10 opt.fullscreen = false;
11 opt.shadows = true;
12 opt.reflections = true;
14 for(int i=1; i<argc; i++) {
15 if(argv[i][0] == '-') {
16 if(strcmp(argv[i], "-noshadows") == 0) {
17 opt.shadows = false;
18 } else if(strcmp(argv[i], "-fullscreen") == 0) {
19 opt.fullscreen = true;
20 } else {
21 fprintf(stderr, "invalid option: %s\n", argv[i]);
22 return false;
23 }
24 } else {
25 fprintf(stderr, "unexpected argument: %s\n", argv[i]);
26 return false;
27 }
28 }
30 return true;
31 }