std::string texture_path = g_settings->get("texture_path");
if(texture_path != "")
{
- std::string testpath = texture_path + '/' + filename;
+ std::string testpath = texture_path + DIR_DELIM + filename;
// Check all filename extensions. Returns "" if not found.
fullpath = getImagePath(testpath);
}
core::dimension2d<u32> dim = image->getDimension();
baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
+ // Blit
+ image->copyTo(baseimg);
+
+ image->drop();
+
for(u32 y=0; y<dim.Height; y++)
for(u32 x=0; x<dim.Width; x++)
{
- video::SColor c = image->getPixel(x,y);
+ video::SColor c = baseimg->getPixel(x,y);
u32 r = c.getRed();
u32 g = c.getGreen();
u32 b = c.getBlue();
if(!(r == r1 && g == g1 && b == b1))
continue;
c.setAlpha(0);
- image->setPixel(x,y,c);
+ baseimg->setPixel(x,y,c);
}
- // Blit
- image->copyTo(baseimg);
-
- image->drop();
}
}
/*
{
core::dimension2d<u32> dim = image->getDimension();
baseimg = driver->createImage(video::ECF_A8R8G8B8, dim);
+
+ // Blit
+ image->copyTo(baseimg);
+
+ image->drop();
for(u32 y=0; y<dim.Height; y++)
for(u32 x=0; x<dim.Width; x++)
{
- video::SColor c = image->getPixel(x,y);
+ video::SColor c = baseimg->getPixel(x,y);
u32 r = c.getRed();
u32 g = c.getGreen();
u32 b = c.getBlue();
!(r == r2 && g == g2 && b == b2))
continue;
c.setAlpha(0);
- image->setPixel(x,y,c);
+ baseimg->setPixel(x,y,c);
}
- // Blit
- image->copyTo(baseimg);
-
- image->drop();
}
}
/*