projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
material editing in scene metafile
[laserbrain_demo]
/
src
/
texture.cc
diff --git
a/src/texture.cc
b/src/texture.cc
index
cbbd11d
..
c556d27
100644
(file)
--- a/
src/texture.cc
+++ b/
src/texture.cc
@@
-1,6
+1,7
@@
#include <math.h>
#include <assert.h>
#include "texture.h"
#include <math.h>
#include <assert.h>
#include "texture.h"
+#include "datamap.h"
#include "image.h"
#include "opengl.h"
#include "imago2.h"
#include "image.h"
#include "opengl.h"
#include "imago2.h"
@@
-201,7
+202,6
@@
void Texture::create_default(TextureType type)
pixels += 4;
}
}
pixels += 4;
}
}
- default_img->save("/tmp/foo.png");
}
switch(type) {
}
switch(type) {
@@
-491,8
+491,17
@@
Texture *TextureSet::create_tex()
bool TextureSet::load_tex(Texture *tex, const char *fname)
{
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;
Image *img = new Image;
- if(!img->load(fname)) {
+ if(!img->load(pathbuf)) {
delete img;
return false;
}
delete img;
return false;
}