Changeset 5929 for code/trunk/src/libraries/core/GraphicsManager.cc
- Timestamp:
- Oct 12, 2009, 8:20:07 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core5 (added) merged: 5768-5769,5772,5775-5780,5783-5785,5791-5792,5795-5807,5809-5814,5816-5832,5836-5839,5842-5853,5855-5899,5904-5922,5924-5928
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/GraphicsManager.cc
r5781 r5929 48 48 49 49 #include "SpecialConfig.h" 50 #include "util/Clock.h" 50 51 #include "util/Exception.h" 51 52 #include "util/StringUtils.h" 52 53 #include "util/SubString.h" 53 #include "Clock.h"54 54 #include "ConsoleCommand.h" 55 55 #include "ConfigValueIncludes.h" 56 56 #include "CoreIncludes.h" 57 #include "Core.h"58 57 #include "Game.h" 59 58 #include "GameMode.h" 60 59 #include "Loader.h" 61 60 #include "MemoryArchive.h" 61 #include "PathConfig.h" 62 62 #include "WindowEventListener.h" 63 63 #include "XMLFile.h" … … 102 102 103 103 // At first, add the root paths of the data directories as resource locations 104 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( Core::getDataPathString(), "FileSystem", "dataRoot", false);104 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getDataPathString(), "FileSystem", "dataRoot", false); 105 105 // Load resources 106 106 resources_.reset(new XMLFile("resources.oxr", "dataRoot")); … … 109 109 110 110 // Only for development runs 111 if ( Core::isDevelopmentRun())112 { 113 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( Core::getExternalDataPathString(), "FileSystem", "externalDataRoot", false);111 if (PathConfig::isDevelopmentRun()) 112 { 113 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem", "externalDataRoot", false); 114 114 extResources_.reset(new XMLFile("resources.oxr", "externalDataRoot")); 115 115 extResources_->setLuaSupport(false); … … 130 130 GraphicsManager::~GraphicsManager() 131 131 { 132 Loader::unload(debugOverlay_.get()); 133 132 134 Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_.get()); 133 135 // TODO: Destroy the console command 136 137 // Undeclare the resources 138 Loader::unload(resources_.get()); 139 if (PathConfig::isDevelopmentRun()) 140 Loader::unload(extResources_.get()); 134 141 } 135 142 … … 241 248 } 242 249 243 boost::filesystem::path ogreConfigFilepath( Core::getConfigPath() / this->ogreConfigFile_);244 boost::filesystem::path ogreLogFilepath( Core::getLogPath() / this->ogreLogFile_);250 boost::filesystem::path ogreConfigFilepath(PathConfig::getConfigPath() / this->ogreConfigFile_); 251 boost::filesystem::path ogreLogFilepath(PathConfig::getLogPath() / this->ogreLogFile_); 245 252 246 253 // create a new logManager … … 313 320 314 321 // add console commands 315 FunctorMember<GraphicsManager>* functor1 = createFunctor(&GraphicsManager::printScreen); 316 ccPrintScreen_ = createConsoleCommand(functor1->setObject(this), "printScreen"); 322 ccPrintScreen_ = createConsoleCommand(createFunctor(&GraphicsManager::printScreen, this), "printScreen"); 317 323 CommandExecutor::addConsoleCommandShortcut(ccPrintScreen_); 318 324 } 319 325 326 void GraphicsManager::loadDebugOverlay() 327 { 328 // Load debug overlay to show info about fps and tick time 329 COUT(4) << "Loading Debug Overlay..." << std::endl; 330 debugOverlay_.reset(new XMLFile("debug.oxo")); 331 Loader::open(debugOverlay_.get()); 332 } 333 334 /** 335 @note 336 A note about the Ogre::FrameListener: Even though we don't use them, 337 they still get called. However, the delta times are not correct (except 338 for timeSinceLastFrame, which is the most important). A little research 339 as shown that there is probably only one FrameListener that doesn't even 340 need the time. So we shouldn't run into problems. 341 */ 320 342 void GraphicsManager::update(const Clock& time) 321 343 { … … 418 440 assert(this->renderWindow_); 419 441 420 this->renderWindow_->writeContentsToTimestampedFile( Core::getLogPathString() + "screenShot_", ".jpg");442 this->renderWindow_->writeContentsToTimestampedFile(PathConfig::getLogPathString() + "screenShot_", ".jpg"); 421 443 } 422 444 }
Note: See TracChangeset
for help on using the changeset viewer.