exit(0);
}
+ printf( "got: %s\n", arg );
+
strings[ num_strings ++ ] = arg;
}
.visgroup = NULL,
.compute_bounds_only = 1
};
- draw_vmf_group( &target, map, map->root, &filter, NULL, NULL );
- csr_auto_fit( &target, padding );
- filter.compute_bounds_only = 0;
- if( num_strings == 1 )
- {
- // Draw everything
- draw_vmf_group( &target, map, map->root, NULL, NULL, NULL );
- csr_rt_save_buffers( &target, output_path, "all" );
- }
- else
+ // One pass for fitting, second pass for drawing
+ for( int i = 0; i < 2; i ++ )
{
- // Draw groups
- for( int i = 1; i < num_strings; i ++ )
+ if( num_strings == 1 )
{
- filter.visgroup = strings[ i ];
-
- draw_vmf_group( &target, map, map->root, NULL, NULL, NULL );
- csr_rt_save_buffers( &target, output_path, strings[i] );
-
- csr_rt_clear( &target );
+ // 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 )
dx = rt->bounds[1][0] - rt->bounds[0][0];
dy = rt->bounds[1][1] - rt->bounds[0][1];
- l = fmaxf( dx, dy );
- d = l * ( l / dx ) * .5f;
+ l = fmaxf( dx, dy ) * .5f;
cx = (rt->bounds[1][0] + rt->bounds[0][0]) * .5f;
cy = (rt->bounds[1][1] + rt->bounds[0][1]) * .5f;
- rt->bounds[0][0] = cx - d - padding;
- rt->bounds[1][0] = cx + d + padding;
- rt->bounds[0][1] = cy - d - padding;
- rt->bounds[1][1] = cy + d + padding;
+ rt->bounds[0][0] = cx - l - padding;
+ rt->bounds[1][0] = cx + l + padding;
+ rt->bounds[0][1] = cy - l - padding;
+ rt->bounds[1][1] = cy + l + padding;
- rt->scale = d + padding;
+ rt->scale = l + padding;
csr_update_subsamples( rt );
}
m4x3f transform = M4X3_IDENTITY;
vmf_solid solid;
vmf_vert tri[3];
- vdf_node *ent_solid;
boxf trf_bounds;
u32 group_id = 0;
else
{
// Brush entity
- if( (ent_solid = vdf_next( ent, "solid", NULL )) )
+ vdf_foreach( ent, "solid", ent_solid )
{
solidgen_push( &solid, ent_solid );
}
v3_copy( box[0], a );
v3_copy( box[1], b );
+ v3_fill( box[0], INFINITY );
+ v3_fill( box[1], -INFINITY );
m4x3_expand_aabb_point( m, box, a );
m4x3_expand_aabb_point( m, box, (v3f){ a[0], b[1], a[2] } );
if( carg[0] != '-' )
{
- csr_argi ++;
+ csr_consume_next = 1;
return carg;
}
-./csRadar testmap.vmf -g "/home/harry/SteamLibrary/steamapps/common/Counter-Strike Global Offensive/csgo/gameinfo.txt"
+./csRadar cs_apollo.vmf -g "/home/harry/SteamLibrary/steamapps/common/Counter-Strike Global Offensive/csgo/gameinfo.txt" tar_layout
return 0;
}
- v3_copy( pMdl->view_bbmin, ctx->bounds[0] );
- v3_copy( pMdl->view_bbmax, ctx->bounds[1] );
+ v3_copy( pMdl->hull_min, ctx->bounds[0] );
+ v3_copy( pMdl->hull_max, ctx->bounds[1] );
ctx->num_indices = vtx_count_indices( pVtxHdr );
// TODO: What is this for again? surely it should be the other way around... i think...
if( solid_has_displacement( node ) )
{
+ is_displacement = 1;
+ /*
+
printf( "solid_has_displacement\n" );
num_planes = vmf_api.bisectors;
}
is_displacement = 1;
+ */
}
int it = 0;