largely loadable model assets
[convexer.git] / cxr / test.c
index 3903b9636e0a291c283fb72ec7bc690c2e92d3c9..7d82c1e7f7caf758fb4e2d617dbae35daddff403 100644 (file)
@@ -7,12 +7,30 @@ int main(int arc, const char *argv[])
       "/home/harry/.steam/steam/steamapps/common/"
       "Counter-Strike Global Offensive/csgo/gameinfo.txt" ) )
    {
-      cxr_tri_mesh *mesh_test = cxr_load_mdl( "models/pigeon.mdl" );
-
-      if( mesh_test )
+      valve_model *model_test = valve_load_model( "models/pigeon.mdl" );
+      if( model_test )
       {
          cxr_log( "Mesh loaded\n" );
-         cxr_free_tri_mesh( mesh_test );
+         
+         for( int i=0; i<model_test->material_count; i++ )
+         {
+            cxr_log( " material: %s\n", model_test->materials[i] );
+            
+            valve_material *material = 
+               valve_load_material( model_test->materials[i] );
+            
+            if( material )
+            {
+               cxr_log( "  $basetexture: %s\n"
+                        "  $bumpmap: %s\n",
+                        material->basetexture,
+                        material->bumpmap );
+
+               valve_free_material( material );
+            }
+         }
+
+         valve_free_model( model_test );
       }
       else
          cxr_log( "Mesh failed to load\n" );