- draw_buffers( image, 1024, 1024, (v4f){ -1000.f, -1000.f, 1000.f, 1000.f }, tri, 1 );
+
+ // Main
+
+ csr_target target;
+
+ csr_create_target( &target, resolution, resolution );
+ csr_rt_clear( &target );
+
+ // Compute bounds
+ csr_filter filter =
+ {
+ .classname = NULL,
+ .visgroup = NULL,
+ .compute_bounds_only = 1
+ };
+
+ // One pass for fitting, second pass for drawing
+ for( int i = 0; i < 2; i ++ )
+ {
+ if( num_strings == 1 )
+ {
+ // Draw everything
+ draw_vmf_group( &target, map, map->root, &filter, NULL, NULL );
+ csr_rt_save_buffers( &target, output_path, "all" );
+ }
+ else
+ {
+ // Draw groups
+ for( int i = 1; i < num_strings; i ++ )
+ {
+ filter.visgroup = strings[ i ];
+
+ draw_vmf_group( &target, map, map->root, &filter, NULL, NULL );
+ csr_rt_save_buffers( &target, output_path, strings[i] );
+
+ csr_rt_clear( &target );
+ }
+ }
+
+ filter.compute_bounds_only = 0;
+ csr_auto_fit( &target, padding );
+ }
+
+ if( write_txt )
+ {
+ char txt_path[ 512 ];
+
+ strcpy( txt_path, output_path );
+ strcat( txt_path, ".txt" );
+
+ csr_write_txt( txt_path, vmf_name, &target );
+ }
+
+ csr_rt_free( &target );
+ vmf_free( map );