X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Ftexture.cc;h=c556d276286f2b4a039c761bd597d9e850b3bcd9;hp=cbbd11dc455c7a0ca87ac8d579e128382293a8a8;hb=d4d7f73284783d2a50d71014789d196bef7d0e0e;hpb=e8fe498f52ff5f3c87759623ce94726af0ef2890 diff --git a/src/texture.cc b/src/texture.cc index cbbd11d..c556d27 100644 --- a/src/texture.cc +++ b/src/texture.cc @@ -1,6 +1,7 @@ #include #include #include "texture.h" +#include "datamap.h" #include "image.h" #include "opengl.h" #include "imago2.h" @@ -201,7 +202,6 @@ void Texture::create_default(TextureType type) pixels += 4; } } - default_img->save("/tmp/foo.png"); } switch(type) { @@ -491,8 +491,17 @@ Texture *TextureSet::create_tex() bool TextureSet::load_tex(Texture *tex, const char *fname) { + char *pathbuf; + int nsize = datamap_path_size(fname); + if(nsize) { + pathbuf = (char*)alloca(nsize); + datamap_lookup(fname, pathbuf, nsize); + } else { + pathbuf = (char*)fname; + } + Image *img = new Image; - if(!img->load(fname)) { + if(!img->load(pathbuf)) { delete img; return false; }