dungeon_crawler

changeset 42:6d71dd4760f9

added flag to force the use of the fallback renderer
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 30 Aug 2012 05:38:03 +0300
parents acfe0c0110fc
children 3fef65352b0b
files prototype/src/cfg.cc prototype/src/cfg.h prototype/src/main.cc
diffstat 3 files changed, 6 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/prototype/src/cfg.cc	Thu Aug 30 05:35:00 2012 +0300
     1.2 +++ b/prototype/src/cfg.cc	Thu Aug 30 05:38:03 2012 +0300
     1.3 @@ -12,6 +12,7 @@
     1.4  	stereo = false;
     1.5  	level_file = "0.level";
     1.6  	tileset_file = "default.tileset";
     1.7 +	use_deferred = true;
     1.8  }
     1.9  
    1.10  bool Config::parse_args(int argc, char **argv)
    1.11 @@ -29,12 +30,15 @@
    1.12  				level_file = argv[++i];
    1.13  			} else if(strcmp(argv[i], "-tileset") == 0) {
    1.14  				tileset_file = argv[++i];
    1.15 +			} else if(strcmp(argv[i], "-no-deferred") == 0) {
    1.16 +				use_deferred = false;
    1.17  			} else if(strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-help") == 0) {
    1.18  				printf("Usage: %s [options]\n", argv[0]);
    1.19  				printf("  -s WxH              window size (resolution)\n");
    1.20  				printf("  -level <filename>   specify which level file to load\n");
    1.21  				printf("  -tileset <filename> specify which tileset to use\n");
    1.22  				printf("  -stereo             enable stereoscopic rendering\n");
    1.23 +				printf("  -no-deferred        disable deferred renderer\n");
    1.24  				printf("  -h/-help            print usage information and exit\n");
    1.25  				exit(0);
    1.26  
     2.1 --- a/prototype/src/cfg.h	Thu Aug 30 05:35:00 2012 +0300
     2.2 +++ b/prototype/src/cfg.h	Thu Aug 30 05:38:03 2012 +0300
     2.3 @@ -6,6 +6,7 @@
     2.4  	int width, height;
     2.5  	bool stereo;
     2.6  	const char *level_file, *tileset_file;
     2.7 +	bool use_deferred;
     2.8  
     2.9  	Config();
    2.10  
     3.1 --- a/prototype/src/main.cc	Thu Aug 30 05:35:00 2012 +0300
     3.2 +++ b/prototype/src/main.cc	Thu Aug 30 05:38:03 2012 +0300
     3.3 @@ -90,7 +90,7 @@
     3.4  	add_data_path("sdr");
     3.5  
     3.6  	rend = new DeferredRenderer();
     3.7 -	if(!rend->init(xsz, ysz)) {
     3.8 +	if(!cfg.use_deferred || !rend->init(xsz, ysz)) {
     3.9  		printf("falling back to crappy renderer...\n");
    3.10  
    3.11  		rend = new FwdRenderer();