- printf("Timer ends \n");
- t = clock() - t;
- double time_taken = ((double)t)/CLOCKS_PER_SEC; // calculate the elapsed time
- printf("Tracing took %f seconds to execute\n", time_taken);
-
- float *rgba_test = (float *)csr_malloc( 1024*1024*sizeof(float)*3 );
+ if( csr_opt( 'h' ) || csr_long_opt( "help" ) )
+ {
+ // Display help
+ printf
+ (
+ "csRadar Copyright (C) 2021 Harry Godden (hgn)\n"
+ "\n"
+ "Usage: ./csRadar map.vmf -g \"/gamedir/gameinfo.txt\" layout cover\n"
+ " VMF file is first, then any other arguments (eg. layout, cover), will specify\n"
+ " visgroups to be rendered into individual files\n"
+ " No visgroups specified will simply draw everything\n"
+ "\n"
+ "Options:\n"
+ " -g <gameinfo.txt path> Required if you are loading models\n"
+ " -r 1024 Output resolution\n"
+ " -o <output> Specify output name/path\n"
+ " -e <classname> Same as default arg, but instead filters for entity class\n"
+ //" -s <height> Add a vertical split at this height\n"
+ " --padding=128 When cropping radar, add padding units to border\n"
+ //" --standard-layers Use standard TAR layers/groups\n"
+ " --no-txt Don't create matching radar txt\n"
+ " --multi-sample=RGSS [ none, 2x, rgss, 8r ]\n"
+ " --extension=TAR Use an extension binary instead\n"
+ " --min=z Miniumum height to render\n"
+ " --max=z Maxiumum height to render\n"
+ "\n"
+ " -v --version Display program version\n"
+ " -h --help Display this help text\n"
+ );
+
+ goto IL_CSR_EXIT;
+ }
+ }
+
+ if( api.num_strings )
+ {
+ if( gameinfo )
+ {
+ fs_set_gameinfo( gameinfo );
+ }
+
+ // Path handling
+ if( !output_set )
+ {
+ strcpy( api.output_path, api.strings[0].str );
+ csr_stripext( api.output_path );
+ }