aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-08-31 17:58:55 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-08-31 17:58:55 +0300
commit8887105ffda38d42eb7dd3958f574317d7ce2ca6 (patch)
tree33bef5193ce95877eee848e77e6116812f9ac3b9
parent1d7408a7b866a8948e7913a7e8bac7d608f90fbb (diff)
downloadminetest-8887105ffda38d42eb7dd3958f574317d7ce2ca6.tar.gz
minetest-8887105ffda38d42eb7dd3958f574317d7ce2ca6.tar.bz2
minetest-8887105ffda38d42eb7dd3958f574317d7ce2ca6.zip
Properly initialize baseimg for texture modifier [combine:WxH:X,Y=filename:X,Y=filename2
-rw-r--r--src/tile.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tile.cpp b/src/tile.cpp
index 6dbe4c63a..a9ded3891 100644
--- a/src/tile.cpp
+++ b/src/tile.cpp
@@ -1344,7 +1344,11 @@ bool generate_image(std::string part_of_name, video::IImage *& baseimg,
u32 h0 = stoi(sf.next(":"));
infostream<<"combined w="<<w0<<" h="<<h0<<std::endl;
core::dimension2d<u32> dim(w0,h0);
- baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
+ if(baseimg == NULL)
+ {
+ baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
+ baseimg->fill(video::SColor(0,0,0,0));
+ }
while(sf.atend() == false)
{
u32 x = stoi(sf.next(","));