Hopefully fixed bug with masked textures

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8397 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-04-20 20:40:10 +00:00
parent 30b69e2888
commit 3f5486aeab
2 changed files with 10 additions and 6 deletions

View File

@ -900,7 +900,8 @@ ITexture* IrrDriver::applyMask(video::ITexture* texture,
return NULL;
}
ITexture *t = m_video_driver->addTexture(texture->getName().getPath().c_str(),
//printf("* Adding '%s'\n", texture->getName().getPath().c_str());
ITexture *t = m_video_driver->addTexture(StringUtils::getBasename(texture->getName().getPath().c_str()).c_str(),
img, NULL);
img->drop();
mask->drop();

View File

@ -256,13 +256,16 @@ void Material::install(bool is_full_path)
m_texture = irr_driver->getTexture(full_path,
isPreMul(), isPreDiv());
if (m_mask.size() > 0)
{
m_texture = irr_driver->applyMask(m_texture, m_mask);
}
// now set the name to the basename, so that all tests work as expected
m_texname = StringUtils::getBasename(m_texname);
if (m_mask.size() > 0)
{
video::ITexture* tex = irr_driver->applyMask(m_texture, m_mask);
if (tex) m_texture = tex;
else fprintf(stderr, "Applying mask failed for '%s'!\n", m_texname.c_str());
}
} // install
//-----------------------------------------------------------------------------
Material::~Material()