backported changes from museum project
[ld37_one_room] / src / sceneload.cc
index e33e457..58d1865 100644 (file)
@@ -200,6 +200,8 @@ static bool load_material(Scene *scn, Material *mat, const aiMaterial *aimat)
                                *dptr++ = *sptr == '\\' ? '/' : *sptr;
                        } while(*sptr++);
 
+                       if(!fname || !*fname) continue;
+
                        int textype = assimp_textype(aitype);
 
                        Texture *tex = texman.get_texture(fname, TEX_2D, &scn->datamap);
@@ -377,6 +379,7 @@ Scene *SceneSet::create_scene()
 
 bool SceneSet::load_scene(Scene *scn, const char *fname)
 {
+       scn->clear();
        return scn->load(fname, SCNLOAD_FLIPTEX | SCNLOAD_STAGE_IO);
 }