X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=cxr%2Ftest.c;h=7d82c1e7f7caf758fb4e2d617dbae35daddff403;hb=0d0b6bf37c8a9c4494071973103a89b4aa82574a;hp=4529b9855854102f5b3e5b24722a3af565707d81;hpb=2937c186209f5ff766cacc9f17a118744ede7b7a;p=convexer.git diff --git a/cxr/test.c b/cxr/test.c index 4529b98..7d82c1e 100644 --- a/cxr/test.c +++ b/cxr/test.c @@ -1,4 +1,52 @@ -#include "convexer.c" +#define CXR_VALVE_BIN +#include "cxr.h" + +int main(int arc, const char *argv[]) +{ + if( cxr_fs_set_gameinfo( + "/home/harry/.steam/steam/steamapps/common/" + "Counter-Strike Global Offensive/csgo/gameinfo.txt" ) ) + { + valve_model *model_test = valve_load_model( "models/pigeon.mdl" ); + if( model_test ) + { + cxr_log( "Mesh loaded\n" ); + + for( int i=0; imaterial_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" ); + } + + cxr_fs_exit(); + return 0; +} + + + + +#if 0 +#define CXR_VALVE_MAP_FILE +#define CXR_DEBUG 1 +#include "cxr.h" #include "solid.h" int main(int arc, const char *argv[]) @@ -20,7 +68,7 @@ int main(int arc, const char *argv[]) .skyname = "vertigoblue" }; - cxr_world *world = cxr_decompose( &test_mesh ); + cxr_world *world = cxr_decompose( &test_mesh, NULL ); if( world ) { cxr_push_world_vmf( world, &ctx, vdo ); @@ -33,3 +81,4 @@ int main(int arc, const char *argv[]) cxr_vdf_close(vdo); return 0; } +#endif