From 6d21fe3115518c36fec2877a1c9048a8941c3927 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 30 Apr 2012 21:07:25 +0200 Subject: [PATCH] fixed mygui leaking some stuff resulting in lower fps after looking at tooltips and low-quality text --- apps/openmw/mwgui/tooltips.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 90b5baa67..e1cb05111 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -31,13 +31,10 @@ void ToolTips::onFrame(float frameDuration) { /// \todo Store a MWWorld::Ptr in the widget user data, retrieve it here and construct a tooltip dynamically - /// \todo we are destroying/creating the tooltip widgets every frame here, - /// because the tooltip might change (e.g. when trap is activated) - /// is there maybe a better way (listener when the object changes)? - for (size_t i=0; igetChildCount(); ++i) - { - mDynamicToolTipBox->_destroyChildWidget(mDynamicToolTipBox->getChildAt(i)); - } + MyGUI::Gui::getInstance().destroyWidget(mDynamicToolTipBox); + mDynamicToolTipBox = mMainWidget->createWidget("HUD_Box", + IntCoord(0, 0, mMainWidget->getCoord().width, mMainWidget->getCoord().height), + Align::Stretch, "DynamicToolTipBox"); const IntSize &viewSize = RenderManager::getInstance().getViewSize();