mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 06:45:34 +00:00
User configuration manager's resource directory.
This commit is contained in:
parent
406135ee96
commit
bfd10a03c0
2 changed files with 9 additions and 6 deletions
|
@ -295,6 +295,10 @@ std::auto_ptr<sh::Factory> CS::Editor::setupGraphics()
|
||||||
sh::OgrePlatform* platform =
|
sh::OgrePlatform* platform =
|
||||||
new sh::OgrePlatform ("General", (mResources / "materials").string());
|
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()))
|
if (!boost::filesystem::exists (mCfgMgr.getCachePath()))
|
||||||
boost::filesystem::create_directories (mCfgMgr.getCachePath());
|
boost::filesystem::create_directories (mCfgMgr.getCachePath());
|
||||||
|
|
||||||
|
|
|
@ -20,15 +20,15 @@ namespace CSVRender
|
||||||
// - configurable font size in pixels (automatically calulate everything else from it)
|
// - configurable font size in pixels (automatically calulate everything else from it)
|
||||||
// - configurable texture to use
|
// - configurable texture to use
|
||||||
// - try material script
|
// - 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/ObjectTextDisplay
|
||||||
// http://www.ogre3d.org/tikiwiki/tiki-index.php?page=MovableTextOverlay
|
// http://www.ogre3d.org/tikiwiki/MovableTextOverlay
|
||||||
// http://www.ogre3d.org/tikiwiki/tiki-index.php?page=Creating+dynamic+textures
|
// http://www.ogre3d.org/tikiwiki/Creating+dynamic+textures
|
||||||
// http://www.ogre3d.org/tikiwiki/ManualObject
|
// http://www.ogre3d.org/tikiwiki/ManualObject
|
||||||
TextOverlay::TextOverlay(const Ogre::MovableObject* obj, const Ogre::Camera* camera, const Ogre::String& id)
|
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)
|
: 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)
|
if(id == "" || !camera || !obj)
|
||||||
throw std::runtime_error("TextOverlay could not be created.");
|
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");
|
mFont = Ogre::FontManager::getSingleton().getByName("DejaVuLGC","General");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Ogre::ResourceGroupManager::getSingleton().addResourceLocation("resources/mygui", "FileSystem");
|
|
||||||
mFont = Ogre::FontManager::getSingleton().create("DejaVuLGC","General");
|
mFont = Ogre::FontManager::getSingleton().create("DejaVuLGC","General");
|
||||||
mFont->setType(Ogre::FT_TRUETYPE);
|
mFont->setType(Ogre::FT_TRUETYPE);
|
||||||
mFont->setSource("DejaVuLGCSansMono.ttf");
|
mFont->setSource("DejaVuLGCSansMono.ttf");
|
||||||
|
|
Loading…
Reference in a new issue