From d62fd96cd51ab6229a97a7f9bf426e306ef9b532 Mon Sep 17 00:00:00 2001 From: Lukasz Gromanowski Date: Thu, 1 Sep 2011 21:48:36 +0200 Subject: [PATCH] Issue #168: Configuration cleanup, part 2 Updated configure() method. Signed-off-by: Lukasz Gromanowski --- ogre/renderer.cpp | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/ogre/renderer.cpp b/ogre/renderer.cpp index 36291864e..0cd75c6b6 100644 --- a/ogre/renderer.cpp +++ b/ogre/renderer.cpp @@ -38,37 +38,25 @@ bool OgreRenderer::configure(bool showConfig, const std::string &pluginCfg, bool _logging) { - std::string theLogFile("Ogre.log"); - std::string theCfgFile("ogre.cfg"); + // Set up logging first + new LogManager; + Log *log = LogManager::getSingleton().createLog(logPath + std::string("Ogre.log")); + logging = _logging; - theLogFile.insert(0, logPath); - theCfgFile.insert(0, cfgPath); - - // Set up logging first - new LogManager; - Log *log = LogManager::getSingleton().createLog(theLogFile); - logging = _logging; - - if(logging) + if(logging) // Full log detail log->setLogDetail(LL_BOREME); - else + else // Disable logging log->setDebugOutputEnabled(false); - mRoot = new Root(pluginCfg, theCfgFile, ""); + mRoot = new Root(pluginCfg, cfgPath, ""); - // Show the configuration dialog and initialise the system, if the - // showConfig parameter is specified. The settings are stored in - // ogre.cfg. If showConfig is false, the settings are assumed to - // already exist in ogre.cfg. - int result; - if(showConfig) - result = mRoot->showConfigDialog(); - else - result = mRoot->restoreConfig(); - - return !result; + // Show the configuration dialog and initialise the system, if the + // showConfig parameter is specified. The settings are stored in + // ogre.cfg. If showConfig is false, the settings are assumed to + // already exist in ogre.cfg. + return (showConfig) ? mRoot->showConfigDialog() : mRoot->restoreConfig(); } bool OgreRenderer::configure(bool showConfig,