fixed background loading of both textures and scenes
[laserbrain_demo] / src / texture.cc
index 3aebec3..dae0c7c 100644 (file)
@@ -475,8 +475,10 @@ Texture *TextureSet::get_texture(const char *name, TextureType type, const DataM
        if(nsize) {
                fname = (char*)alloca(nsize);
                dmap->lookup(name, fname, nsize);
+               //debug_log("texture lookup: %s -> %s\n", name, fname);
        } else {
                fname = (char*)name;
+               //debug_log("texture lookup failed, using: %s\n", fname);
        }
 
        std::map<std::string, Texture*>::const_iterator iter = data.find(fname);
@@ -501,6 +503,7 @@ Texture *TextureSet::create_tex()
 bool TextureSet::load_tex(Texture *tex, const char *fname)
 {
        Image *img = new Image;
+       img->name = fname;
        if(!img->load(fname)) {
                delete img;
                return false;
@@ -514,6 +517,7 @@ bool TextureSet::load_tex(Texture *tex, const char *fname)
 
 bool TextureSet::done_tex(Texture *tex)
 {
+       //debug_log("TextureSet::done_tex [%s]\n", tex->img->name.c_str());
        if(!tex->img) {
                return false;
        }