Properly initialize baseimg for texture modifier [combine:WxH:X,Y=filename:X,Y=filename2

This commit is contained in:
Perttu Ahola 2012-08-31 17:58:55 +03:00
parent 1d7408a7b8
commit 8887105ffd
1 changed files with 5 additions and 1 deletions

View 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);
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(","));