- shaders for both lightmapped objects with or without albedo maps
[laserbrain_demo] / src / sceneload.cc
index 6fb17d4..b491cf0 100644 (file)
@@ -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);