- clock_t t;
- t = clock();
- printf("Timer starts\n");
-
- csr_frag *image = (csr_frag *)csr_malloc( 1024*1024*sizeof(csr_frag) );
- clear_depth( image, 1024, 1024 );
-
- for( int i = 0; i < csr_sb_count( solid_main.indices )/3; i ++ )
+ if( csr_opt( 'v' ) || csr_long_opt( "version" ) )
+ {
+ printf( "csRadar version: " CSR_VERSION "\n" );
+ return 0;
+ }
+
+ 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"
+ " --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= [ none, 2, 4, 4r, 8kn (default), 16c ]\n"
+ "\n"
+ " -v --version Display program version\n"
+ " -h --help Display this help text\n"
+ );
+
+ return 0;
+ }
+ }
+
+ if( num_strings )
+ {
+ vmf_map *map = vmf_init( strings[0], 1 );
+
+ if( map )