Some fixes.

This commit is contained in:
aap
2015-01-26 20:23:45 +01:00
parent ad21deaf0f
commit 5247d1c26e
4 changed files with 18 additions and 15 deletions

5
src/image.cpp Normal file → Executable file
View File

@@ -75,7 +75,7 @@ Texture::read(const char *name, const char *mask)
Raster *raster = NULL;
Texture *tex;
if((tex = currentTexDictionary->find(name)))
if(currentTexDictionary && (tex = currentTexDictionary->find(name)))
return tex;
tex = new Texture;
strncpy(tex->name, name, 32);
@@ -90,7 +90,8 @@ Texture::read(const char *name, const char *mask)
delete img;
}
tex->raster = raster;
currentTexDictionary->add(tex);
if(currentTexDictionary)
currentTexDictionary->add(tex);
return tex;
}