X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=cxr%2Ftest.c;h=7d82c1e7f7caf758fb4e2d617dbae35daddff403;hb=0d0b6bf37c8a9c4494071973103a89b4aa82574a;hp=b8d91d89a67ba679a974d781341f240eb4a8fd26;hpb=9a92cec0e25c758d12c535bb737be598f053b56d;p=convexer.git diff --git a/cxr/test.c b/cxr/test.c index b8d91d8..7d82c1e 100644 --- a/cxr/test.c +++ b/cxr/test.c @@ -1,4 +1,49 @@ -#define CXR_IMPLEMENTATION +#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" @@ -36,3 +81,4 @@ int main(int arc, const char *argv[]) cxr_vdf_close(vdo); return 0; } +#endif