+// This software is not affiliated with Valve Corporation
+// We are not affiliated, associated, authorized, endorsed by, or in any way officially
+// connected with Valve Corporation, or any of its subsidiaries or its affiliates.
+//
+// All trademarks are property of their respective owners
+
+typedef struct mdl_mesh mdl_mesh_t;
+
+// High level API
+//=======================================================================================================================
+
+// Load model from vfs
+int mdl_from_find_files( const char *mdlname, mdl_mesh_t *ctx );
+void mdl_free( mdl_mesh_t *m );
+
+// Set ctx to blank / 0,0
+void mdl_error( mdl_mesh_t *m );
+
+// Implementation
+//=======================================================================================================================
+
+struct mdl_mesh
+{
+ u16 *indices;
+ u32 num_indices;
+
+ float *vertices;
+ u32 num_vertices;
+
+ // Bounding box
+ boxf bounds;
+};
+
+#ifdef VALVE_IMPLEMENTATION
+
// VVD
//=======================================================================================================================
//StudioMDL constants
#pragma pack(pop)
-typedef struct
-{
- u16 *indices;
- u32 num_indices;
-
- float *vertices;
- u32 num_vertices;
-}
-mdl_mesh_t;
-
void mdl_free( mdl_mesh_t *m )
{
free( m->indices );
return 0;
}
+ v3_copy( pMdl->hull_min, ctx->bounds[0] );
+ v3_copy( pMdl->hull_max, ctx->bounds[1] );
+
ctx->num_indices = vtx_count_indices( pVtxHdr );
// Allocate and read indices
return 1;
}
+
+#endif