Changeset 10624 for code/trunk/src/libraries/core/GraphicsManager.cc
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (10 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/libraries/core/GraphicsManager.cc
r10295 r10624 59 59 #include "GUIManager.h" 60 60 #include "Loader.h" 61 #include "PathConfig.h" 61 #include "ApplicationPaths.h" 62 #include "ConfigurablePaths.h" 62 63 #include "ViewportEventListener.h" 63 64 #include "WindowEventListener.h" 64 65 #include "XMLFile.h" 65 #include "command/ConsoleCommand .h"66 #include "command/ConsoleCommandIncludes.h" 66 67 #include "input/InputManager.h" 67 68 … … 94 95 GraphicsManager* GraphicsManager::singletonPtr_s = 0; 95 96 97 RegisterAbstractClass(GraphicsManager).inheritsFrom<Configurable>(); 98 96 99 GraphicsManager::GraphicsManager(bool bLoadRenderer) 97 100 : ogreWindowEventListener_(new OgreWindowEventListener()) … … 111 114 112 115 // At first, add the root paths of the data directories as resource locations 113 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( PathConfig::getDataPathString(), "FileSystem");116 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(ConfigurablePaths::getDataPathString(), "FileSystem"); 114 117 // Load resources 115 118 resources_.reset(new XMLFile("DefaultResources.oxr")); 116 119 resources_->setLuaSupport(false); 117 Loader:: open(resources_.get(), ClassTreeMask(), false);120 Loader::getInstance().load(resources_.get(), ClassTreeMask(), false); 118 121 119 122 // Only for runs in the build directory (not installed) 120 if ( PathConfig::buildDirectoryRun())121 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( PathConfig::getExternalDataPathString(), "FileSystem");123 if (ApplicationPaths::buildDirectoryRun()) 124 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(ConfigurablePaths::getExternalDataPathString(), "FileSystem"); 122 125 123 126 extResources_.reset(new XMLFile("resources.oxr")); 124 127 extResources_->setLuaSupport(false); 125 Loader:: open(extResources_.get(), ClassTreeMask(), false);128 Loader::getInstance().load(extResources_.get(), ClassTreeMask(), false); 126 129 127 130 if (bLoadRenderer) … … 137 140 { 138 141 orxout(internal_status) << "destroying GraphicsManager..." << endl; 139 140 Loader::unload(debugOverlay_.get());141 142 142 143 Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_); … … 147 148 148 149 // Undeclare the resources 149 Loader:: unload(resources_.get());150 Loader:: unload(extResources_.get());150 Loader::getInstance().unload(resources_.get()); 151 Loader::getInstance().unload(extResources_.get()); 151 152 152 153 safeObjectDelete(&ogreRoot_); … … 218 219 } 219 220 220 boost::filesystem::path ogreConfigFilepath( PathConfig::getConfigPath() / this->ogreConfigFile_);221 boost::filesystem::path ogreLogFilepath( PathConfig::getLogPath() / this->ogreLogFile_);221 boost::filesystem::path ogreConfigFilepath(ConfigurablePaths::getConfigPath() / this->ogreConfigFile_); 222 boost::filesystem::path ogreLogFilepath(ConfigurablePaths::getLogPath() / this->ogreLogFile_); 222 223 223 224 // create a new logManager … … 258 259 std::string pluginPath = specialConfig::ogrePluginsDirectory; 259 260 #ifdef DEPENDENCY_PACKAGE_ENABLE 260 if (! PathConfig::buildDirectoryRun())261 if (!ApplicationPaths::buildDirectoryRun()) 261 262 { 262 263 # if defined(ORXONOX_PLATFORM_WINDOWS) 263 pluginPath = PathConfig::getExecutablePathString();264 pluginPath = ApplicationPaths::getExecutablePathString(); 264 265 # elif defined(ORXONOX_PLATFORM_APPLE) 265 266 // TODO: Where are the plugins being installed to? 266 pluginPath = PathConfig::getExecutablePathString();267 pluginPath = ApplicationPaths::getExecutablePathString(); 267 268 # endif 268 269 } … … 279 280 orxout(internal_info) << "GraphicsManager: Configuring Renderer" << endl; 280 281 281 bool updatedConfig = Core::getInstance().get OgreConfigTimestamp() > Core::getInstance().getLastLevelTimestamp();282 bool updatedConfig = Core::getInstance().getConfig()->getOgreConfigTimestamp() > Core::getInstance().getConfig()->getLastLevelTimestamp(); 282 283 if (updatedConfig) 283 284 orxout(user_info)<< "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << endl; … … 288 289 ThrowException(InitialisationFailed, "OGRE graphics configuration dialogue canceled."); 289 290 else 290 Core::getInstance(). updateOgreConfigTimestamp();291 Core::getInstance().getConfig()->updateOgreConfigTimestamp(); 291 292 } 292 293 … … 328 329 orxout(internal_info) << "Loading Debug Overlay..." << endl; 329 330 debugOverlay_.reset(new XMLFile("debug.oxo")); 330 Loader::open(debugOverlay_.get(), ClassTreeMask(), false); 331 Loader::getInstance().load(debugOverlay_.get(), ClassTreeMask(), false); 332 } 333 334 void GraphicsManager::unloadDebugOverlay() 335 { 336 Loader::getInstance().unload(debugOverlay_.get()); 331 337 } 332 338 … … 514 520 GraphicsManager::getInstance().getRenderWindow()->setFullscreen(fullscreen, width, height); 515 521 this->ogreRoot_->saveConfig(); 516 Core::getInstance(). updateOgreConfigTimestamp();522 Core::getInstance().getConfig()->updateOgreConfigTimestamp(); 517 523 // Also reload the input devices 518 524 InputManager::getInstance().reload(); … … 532 538 //this->ogreRoot_->getRenderSystem()->reinitialise(); // can't use this that easily, because it recreates the render window, invalidating renderWindow_ 533 539 this->ogreRoot_->saveConfig(); 534 Core::getInstance(). updateOgreConfigTimestamp();540 Core::getInstance().getConfig()->updateOgreConfigTimestamp(); 535 541 } 536 542 … … 548 554 //this->ogreRoot_->getRenderSystem()->reinitialise(); // can't use this that easily, because it recreates the render window, invalidating renderWindow_ 549 555 this->ogreRoot_->saveConfig(); 550 Core::getInstance(). updateOgreConfigTimestamp();556 Core::getInstance().getConfig()->updateOgreConfigTimestamp(); 551 557 } 552 558 … … 557 563 { 558 564 assert(this->renderWindow_); 559 this->renderWindow_->writeContentsToTimestampedFile( PathConfig::getLogPathString() + "screenShot_", ".png");565 this->renderWindow_->writeContentsToTimestampedFile(ConfigurablePaths::getLogPathString() + "screenShot_", ".png"); 560 566 } 561 567 }
Note: See TracChangeset
for help on using the changeset viewer.