mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-05 15:55:45 +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)
|
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)
|
if (mItem)
|
||||||
mItem->setImageTexture(icon);
|
mItem->setImageTexture(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemWidget::setFrame(const std::string &frame, const MyGUI::IntCoord &coord)
|
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)
|
if (mFrame)
|
||||||
{
|
{
|
||||||
mFrame->setImageTexture(frame);
|
mFrame->setImageTexture(frame);
|
||||||
@ -77,21 +63,8 @@ namespace MWGui
|
|||||||
if (ptr.isEmpty())
|
if (ptr.isEmpty())
|
||||||
{
|
{
|
||||||
if (mFrame)
|
if (mFrame)
|
||||||
{
|
mFrame->setImageTexture("");
|
||||||
// HACK HACK HACK: Don't setImageTexture if it hasn't changed.
|
mItem->setImageTexture("");
|
||||||
// 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("");
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,9 +42,6 @@ namespace MWGui
|
|||||||
|
|
||||||
MyGUI::ImageBox* mItem;
|
MyGUI::ImageBox* mItem;
|
||||||
MyGUI::ImageBox* mFrame;
|
MyGUI::ImageBox* mFrame;
|
||||||
|
|
||||||
std::string mCurrentItemTexture;
|
|
||||||
std::string mCurrentFrameTexture;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user