mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-06 19:01:21 +03:00
Make configuration and log paths configurable
This commit is contained in:
parent
3a17aaa697
commit
7185eab18c
4 changed files with 48 additions and 8 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
using namespace OEngine::GUI;
|
||||
|
||||
void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging)
|
||||
void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging, const std::string& logDir)
|
||||
{
|
||||
assert(wnd);
|
||||
assert(mgr);
|
||||
|
@ -21,13 +21,17 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool
|
|||
LogManager::initialise();
|
||||
LogManager::setSTDOutputEnabled(logging);
|
||||
|
||||
std::string theLogFile = std::string(MYGUI_PLATFORM_LOG_FILENAME);
|
||||
if(!logDir.empty())
|
||||
theLogFile.insert(0, logDir);
|
||||
|
||||
// Set up OGRE platform. We might make this more generic later.
|
||||
mPlatform = new OgrePlatform();
|
||||
mPlatform->initialise(wnd, mgr);
|
||||
mPlatform->initialise(wnd, mgr, "General", theLogFile);
|
||||
|
||||
// Create GUI
|
||||
mGui = new Gui();
|
||||
mGui->initialise();
|
||||
mGui->initialise("core.xml", theLogFile);
|
||||
}
|
||||
|
||||
void MyGUIManager::shutdown()
|
||||
|
|
|
@ -23,11 +23,11 @@ namespace GUI
|
|||
|
||||
public:
|
||||
MyGUIManager() : mPlatform(NULL), mGui(NULL) {}
|
||||
MyGUIManager(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false)
|
||||
{ setup(wnd,mgr,logging); }
|
||||
MyGUIManager(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false, const std::string& logDir = std::string(""))
|
||||
{ setup(wnd,mgr,logging, logDir); }
|
||||
~MyGUIManager() { shutdown(); }
|
||||
|
||||
void setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false);
|
||||
void setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool logging=false, const std::string& logDir = std::string(""));
|
||||
void shutdown();
|
||||
|
||||
MyGUI::Gui *getGui() { return mGui; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue