Check texture cache before adding an icon button's disabled texture
This commit is contained in:
parent
ee49604856
commit
9b57d76a79
@ -288,6 +288,13 @@ const video::ITexture* IconButtonWidget::getTexture()
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
video::ITexture* IconButtonWidget::getDeactivatedTexture(video::ITexture* texture)
|
video::ITexture* IconButtonWidget::getDeactivatedTexture(video::ITexture* texture)
|
||||||
|
{
|
||||||
|
video::ITexture* t;
|
||||||
|
|
||||||
|
std::string name = texture->getName().getPath().c_str();
|
||||||
|
name += "_disabled";
|
||||||
|
t = irr_driver->getTexture(name);
|
||||||
|
if (t == NULL)
|
||||||
{
|
{
|
||||||
SColor c;
|
SColor c;
|
||||||
u32 g;
|
u32 g;
|
||||||
@ -309,7 +316,10 @@ video::ITexture* IconButtonWidget::getDeactivatedTexture(video::ITexture* textur
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return driver->addTexture(texture->getName().getPath() + "_disabled", image.get ());
|
t = driver->addTexture(name.c_str(), image.get ());
|
||||||
|
}
|
||||||
|
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user