GUI cleanup fix

c++11
scrawl 10 years ago
parent 9de575ad42
commit 5a759f8b0d

@ -311,11 +311,6 @@ int CS::Editor::run()
return QApplication::exec(); return QApplication::exec();
} }
// for font used in overlays
//Ogre::Root::getSingleton().addResourceLocation ((mResources / "mygui").string(),
// "FileSystem", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
void CS::Editor::documentAdded (CSMDoc::Document *document) void CS::Editor::documentAdded (CSMDoc::Document *document)
{ {
mViewManager.addView (document); mViewManager.addView (document);

@ -1,7 +1,5 @@
#include "mainmenu.hpp" #include "mainmenu.hpp"
#include <OgreResourceGroupManager.h>
#include <MyGUI_TextBox.h> #include <MyGUI_TextBox.h>
#include <MyGUI_Gui.h> #include <MyGUI_Gui.h>
#include <MyGUI_RenderManager.h> #include <MyGUI_RenderManager.h>

@ -30,6 +30,8 @@
#include <components/myguiplatform/myguiplatform.hpp> #include <components/myguiplatform/myguiplatform.hpp>
#include <components/vfs/manager.hpp>
#include <components/widgets/widgets.hpp> #include <components/widgets/widgets.hpp>
#include <components/widgets/tags.hpp> #include <components/widgets/tags.hpp>
@ -180,8 +182,8 @@ namespace MWGui
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getTextureManager()); mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getTextureManager());
mGuiPlatform->initialise(resourcePath, logpath); mGuiPlatform->initialise(resourcePath, logpath);
MyGUI::Gui* gui = new MyGUI::Gui; mGui = new MyGUI::Gui;
gui->initialise(""); mGui->initialise("");
createTextures(); createTextures();
@ -307,8 +309,8 @@ namespace MWGui
std::string hitFaderTexture = "textures\\bm_player_hit_01.dds"; std::string hitFaderTexture = "textures\\bm_player_hit_01.dds";
// fall back to player_hit_01.dds if bm_player_hit_01.dds is not available // fall back to player_hit_01.dds if bm_player_hit_01.dds is not available
// TODO: check if non-BM versions actually use player_hit_01.dds // TODO: check if non-BM versions actually use player_hit_01.dds
//if(!Ogre::ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(hitFaderTexture)) if(!mResourceSystem->getVFS()->exists(hitFaderTexture))
// hitFaderTexture = "textures\\player_hit_01.dds"; hitFaderTexture = "textures\\player_hit_01.dds";
mHitFader = new ScreenFader(hitFaderTexture); mHitFader = new ScreenFader(hitFaderTexture);
mScreenFader = new ScreenFader("black.png"); mScreenFader = new ScreenFader("black.png");
@ -421,6 +423,7 @@ namespace MWGui
mFontLoader.reset(); mFontLoader.reset();
delete mGui;
delete mGuiPlatform; delete mGuiPlatform;
} }

@ -438,7 +438,16 @@ namespace Gui
font->deserialization(root, MyGUI::Version(3,2,0)); font->deserialization(root, MyGUI::Version(3,2,0));
MyGUI::ResourceManager::getInstance().removeByName(font->getResourceName()); for (std::vector<MyGUI::ResourceManualFont*>::iterator it = mFonts.begin(); it != mFonts.end();)
{
if ((*it)->getResourceName() == font->getResourceName())
{
MyGUI::ResourceManager::getInstance().removeByName(font->getResourceName());
it = mFonts.erase(it);
}
else
++it;
}
MyGUI::ResourceManager::getInstance().addResource(font); MyGUI::ResourceManager::getInstance().addResource(font);
} }

Loading…
Cancel
Save