mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-03 17:37:18 +00:00
Remove more MyGUI 3.2.0 specific code
This commit is contained in:
parent
c5fa7bf7c2
commit
1a96dd0bd5
@ -35,26 +35,12 @@ namespace MWGui
|
||||
|
||||
void ItemWidget::setIcon(const std::string &icon)
|
||||
{
|
||||
// HACK HACK HACK: Don't setImageTexture if it hasn't changed.
|
||||
// There is a leak in MyGUI for each setImageTexture on the same widget.
|
||||
// http://www.ogre3d.org/addonforums/viewtopic.php?f=17&t=30251
|
||||
if (mCurrentItemTexture == icon)
|
||||
return;
|
||||
|
||||
mCurrentItemTexture = icon;
|
||||
if (mItem)
|
||||
mItem->setImageTexture(icon);
|
||||
}
|
||||
|
||||
void ItemWidget::setFrame(const std::string &frame, const MyGUI::IntCoord &coord)
|
||||
{
|
||||
// HACK HACK HACK: Don't setImageTexture if it hasn't changed.
|
||||
// There is a leak in MyGUI for each setImageTexture on the same widget.
|
||||
// http://www.ogre3d.org/addonforums/viewtopic.php?f=17&t=30251
|
||||
if (mCurrentFrameTexture == frame)
|
||||
return;
|
||||
|
||||
mCurrentFrameTexture = frame;
|
||||
if (mFrame)
|
||||
{
|
||||
mFrame->setImageTexture(frame);
|
||||
@ -77,21 +63,8 @@ namespace MWGui
|
||||
if (ptr.isEmpty())
|
||||
{
|
||||
if (mFrame)
|
||||
{
|
||||
// HACK HACK HACK: Don't setImageTexture if it hasn't changed.
|
||||
// There is a leak in MyGUI for each setImageTexture on the same widget.
|
||||
// http://www.ogre3d.org/addonforums/viewtopic.php?f=17&t=30251
|
||||
if (!mCurrentFrameTexture.empty())
|
||||
{
|
||||
mFrame->setImageTexture("");
|
||||
mCurrentFrameTexture = "";
|
||||
}
|
||||
}
|
||||
if (!mCurrentItemTexture.empty())
|
||||
{
|
||||
mCurrentItemTexture = "";
|
||||
mItem->setImageTexture("");
|
||||
}
|
||||
mFrame->setImageTexture("");
|
||||
mItem->setImageTexture("");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -42,9 +42,6 @@ namespace MWGui
|
||||
|
||||
MyGUI::ImageBox* mItem;
|
||||
MyGUI::ImageBox* mFrame;
|
||||
|
||||
std::string mCurrentItemTexture;
|
||||
std::string mCurrentFrameTexture;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user