X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fsceneload.cc;h=b491cf0c3129b8f16200f649b61698a3c14e692c;hp=6fb17d452d442e68b45bab2b808f1e19ec08a18b;hb=017ce4cb4c27802eb620227fd822f5e4e03efa3b;hpb=31e1ffedb543e048673b7ba969607fbb8214ac9a diff --git a/src/sceneload.cc b/src/sceneload.cc index 6fb17d4..b491cf0 100644 --- a/src/sceneload.cc +++ b/src/sceneload.cc @@ -15,6 +15,7 @@ #include "scene.h" #include "objmesh.h" #include "datamap.h" +#include "logger.h" static bool load_material(Scene *scn, Material *mat, const aiMaterial *aimat); static SceneNode *load_node(Scene *scn, const aiScene *aiscn, unsigned int flags, const aiNode *ainode); @@ -50,11 +51,11 @@ bool Scene::load(const char *fname, unsigned int flags) ppflags |= aiProcess_FlipUVs; } - printf("Loading scene file: %s\n", fname); + info_log("Loading scene file: %s\n", fname); const aiScene *aiscn = aiImportFile(fname, ppflags); if(!aiscn) { - fprintf(stderr, "failed to load scene file: %s\n", fname); + error_log("failed to load scene file: %s\n", fname); return false; } @@ -83,7 +84,7 @@ bool Scene::load(const char *fname, unsigned int flags) break; default: - fprintf(stderr, "unsupported primitive type: %u\n", aimesh->mPrimitiveTypes); + error_log("unsupported primitive type: %u\n", aimesh->mPrimitiveTypes); break; } } @@ -109,7 +110,7 @@ bool Scene::load(const char *fname, unsigned int flags) mesh_by_aimesh.clear(); aiReleaseImport(aiscn); - printf("loaded scene file: %s, %d meshes\n", fname, (int)meshes.size()); + info_log("loaded scene file: %s, %d meshes\n", fname, (int)meshes.size()); nodes->update(0); return true; } @@ -125,7 +126,7 @@ static bool load_material(Scene *scn, Material *mat, const aiMaterial *aimat) } else { mat->name = "unknown"; } - //printf("load_material: %s\n", mat->name.c_str()); + //info_log("load_material: %s\n", mat->name.c_str()); if(aiGetMaterialColor(aimat, AI_MATKEY_COLOR_DIFFUSE, &aicol) == 0) { mat->diffuse = Vec3(aicol[0], aicol[1], aicol[2]); @@ -171,7 +172,7 @@ static bool load_material(Scene *scn, Material *mat, const aiMaterial *aimat) } int textype = assimp_textype(aitype); - printf("loading %s texture: %s\n", assimp_textypestr(aitype), fname); + info_log("loading %s texture: %s\n", assimp_textypestr(aitype), fname); Texture *tex = scn->texset->get_texture(fname, TEX_2D); assert(tex);