From bfd10a03c0044d98587bd93a18d7fc5517c787ad Mon Sep 17 00:00:00 2001 From: cc9cii Date: Fri, 10 Oct 2014 13:35:14 +1100 Subject: [PATCH] User configuration manager's resource directory. --- apps/opencs/editor.cpp | 4 ++++ apps/opencs/view/render/textoverlay.cpp | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/opencs/editor.cpp b/apps/opencs/editor.cpp index de3e23965..20763beea 100644 --- a/apps/opencs/editor.cpp +++ b/apps/opencs/editor.cpp @@ -295,6 +295,10 @@ std::auto_ptr CS::Editor::setupGraphics() sh::OgrePlatform* platform = new sh::OgrePlatform ("General", (mResources / "materials").string()); + // for font used in overlays + Ogre::Root::getSingleton().addResourceLocation ((mResources / "mygui").string(), + "FileSystem", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true); + if (!boost::filesystem::exists (mCfgMgr.getCachePath())) boost::filesystem::create_directories (mCfgMgr.getCachePath()); diff --git a/apps/opencs/view/render/textoverlay.cpp b/apps/opencs/view/render/textoverlay.cpp index 1fbcd5a88..117a57193 100644 --- a/apps/opencs/view/render/textoverlay.cpp +++ b/apps/opencs/view/render/textoverlay.cpp @@ -20,15 +20,15 @@ namespace CSVRender // - configurable font size in pixels (automatically calulate everything else from it) // - configurable texture to use // - try material script -// - decide whether to use QPaint +// - decide whether to use QPaint (http://www.ogre3d.org/tikiwiki/Ogre+overlays+using+Qt) -// http://www.ogre3d.org/tikiwiki/tiki-index.php?page=ObjectTextDisplay -// http://www.ogre3d.org/tikiwiki/tiki-index.php?page=MovableTextOverlay -// http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Creating+dynamic+textures +// http://www.ogre3d.org/tikiwiki/ObjectTextDisplay +// http://www.ogre3d.org/tikiwiki/MovableTextOverlay +// http://www.ogre3d.org/tikiwiki/Creating+dynamic+textures // http://www.ogre3d.org/tikiwiki/ManualObject TextOverlay::TextOverlay(const Ogre::MovableObject* obj, const Ogre::Camera* camera, const Ogre::String& id) : mOverlay(0), mCaption(""), mDesc(""), mEnabled(true), mCamera(camera), mObj(obj), mId(id), mOnScreen(false) - , mFontHeight(16) // FIXME: make this configurable + , mFontHeight(16) // FIXME: make font height configurable { if(id == "" || !camera || !obj) throw std::runtime_error("TextOverlay could not be created."); @@ -38,7 +38,6 @@ TextOverlay::TextOverlay(const Ogre::MovableObject* obj, const Ogre::Camera* cam mFont = Ogre::FontManager::getSingleton().getByName("DejaVuLGC","General"); else { - Ogre::ResourceGroupManager::getSingleton().addResourceLocation("resources/mygui", "FileSystem"); mFont = Ogre::FontManager::getSingleton().create("DejaVuLGC","General"); mFont->setType(Ogre::FT_TRUETYPE); mFont->setSource("DejaVuLGCSansMono.ttf");