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:
parent
30b69e2888
commit
3f5486aeab
@ -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();
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user