mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Use MyGUI's castType function
This commit is contained in:
parent
763f647412
commit
60a12b3dee
1 changed files with 2 additions and 4 deletions
|
@ -1635,9 +1635,7 @@ namespace MWGui
|
|||
layout->mMainWidget->setPosition(pos);
|
||||
layout->mMainWidget->setSize(size);
|
||||
|
||||
MyGUI::Window* window = dynamic_cast<MyGUI::Window*>(layout->mMainWidget);
|
||||
if (!window)
|
||||
throw std::runtime_error("Attempting to track size of a non-resizable window");
|
||||
MyGUI::Window* window = layout->mMainWidget->castType<MyGUI::Window>();
|
||||
window->eventWindowChangeCoord += MyGUI::newDelegate(this, &WindowManager::onWindowChangeCoord);
|
||||
mTrackedWindows[window] = name;
|
||||
}
|
||||
|
@ -2010,7 +2008,7 @@ namespace MWGui
|
|||
while (enumerator.next())
|
||||
{
|
||||
MyGUI::IResource* resource = enumerator.current().second;
|
||||
ResourceImageSetPointerFix* imgSetPointer = dynamic_cast<ResourceImageSetPointerFix*>(resource);
|
||||
ResourceImageSetPointerFix* imgSetPointer = resource->castType<ResourceImageSetPointerFix>(false);
|
||||
if (!imgSetPointer)
|
||||
continue;
|
||||
std::string tex_name = imgSetPointer->getImageSet()->getIndexInfo(0,0).texture;
|
||||
|
|
Loading…
Reference in a new issue