Properly initialize baseimg for texture modifier [combine:WxH:X,Y=filename:X,Y=filename2
authorPerttu Ahola <celeron55@gmail.com>
Fri, 31 Aug 2012 14:58:55 +0000 (17:58 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Fri, 31 Aug 2012 14:58:55 +0000 (17:58 +0300)
src/tile.cpp

index 6dbe4c63a606b29ba6b8cef22b8816ebf7e373c6..a9ded3891783e0474ff348709c28bf21e614c7a2 100644 (file)
@@ -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(","));