tga & normals
[csRadar.git] / vmf.h
diff --git a/vmf.h b/vmf.h
index c5f736b4474977214d8ef543dbb79ba1029c4a0d..4fbe023c568867a5ba5cb6ab0a4ae90c581dbe99 100644 (file)
--- a/vmf.h
+++ b/vmf.h
@@ -43,7 +43,7 @@ void vmf_load_models( vmf_map *map );
 // Create matrix describing this entities transform
 void vmf_entity_transform( vdf_node *ent, m4x3f mat );
 
-u32 vmf_visgroup_id( vdf_node *root, const char *name );
+int vmf_visgroup_id( vdf_node *root, const char *name );
 int vmf_visgroup_match( vdf_node *ent, u32 target );
 
 // Currently unused
@@ -74,7 +74,7 @@ struct vmf_vert
 {
        v3f     co;
        v3f     nrm;
-       v2f     xy;
+       v3f     origin;
 };
 
 struct vmf_face
@@ -422,7 +422,7 @@ ESolidResult solidgen_push( vmf_solid *ctx, vdf_node *node )
        v3_divs( center, (float)numpoints, center );
        for( ; vert_start < csr_sb_count( ctx->verts ); vert_start ++ )
        {
-               v2_copy( center, ctx->verts[ vert_start ].xy );
+               v3_copy( center, ctx->verts[ vert_start ].origin );
        }
        
        // Sort each faces and trianglulalate them
@@ -522,6 +522,9 @@ ESolidResult solidgen_push( vmf_solid *ctx, vdf_node *node )
                                                
                                                // Todo, put correct normal
                                                v3_copy( (v3f){ 0.f, 0.f, 1.f }, vert->nrm );
+                                               
+                                               // Todo: use real bounds of displaced vertices
+                                               v3_copy( center, vert->origin );
                                        }
                                }
                                
@@ -817,7 +820,7 @@ void vmf_entity_transform( vdf_node *ent, m4x3f mat )
        m4x3_scale( mat, scale );
 }
 
-u32 vmf_visgroup_id( vdf_node *root, const char *name )
+int vmf_visgroup_id( vdf_node *root, const char *name )
 {
        vdf_node *dict = vdf_next( root, "visgroups", NULL );
        
@@ -832,7 +835,7 @@ u32 vmf_visgroup_id( vdf_node *root, const char *name )
                }
        }
        
-       return 0;
+       return -1;
 }
 
 int vmf_visgroup_match( vdf_node *ent, u32 target )