Changeset 6417 for code/trunk/src/libraries/core/GraphicsManager.cc
- Timestamp:
- Dec 25, 2009, 10:23:58 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/core/GraphicsManager.cc
r6105 r6417 100 100 101 101 // At first, add the root paths of the data directories as resource locations 102 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getDataPathString(), "FileSystem" , "dataRoot", false);102 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getDataPathString(), "FileSystem"); 103 103 // Load resources 104 resources_.reset(new XMLFile(" resources.oxr", "dataRoot"));104 resources_.reset(new XMLFile("DefaultResources.oxr")); 105 105 resources_->setLuaSupport(false); 106 106 Loader::open(resources_.get()); … … 109 109 if (PathConfig::isDevelopmentRun()) 110 110 { 111 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem" , "externalDataRoot", false);112 extResources_.reset(new XMLFile("resources.oxr" , "externalDataRoot"));111 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem"); 112 extResources_.reset(new XMLFile("resources.oxr")); 113 113 extResources_->setLuaSupport(false); 114 114 Loader::open(extResources_.get()); … … 208 208 shared_array<char> data(new char[output.str().size()]); 209 209 // Debug optimisations 210 const std::string outputStr = output.str();210 const std::string& outputStr = output.str(); 211 211 char* rawData = data.get(); 212 212 for (unsigned i = 0; i < outputStr.size(); ++i) … … 238 238 COUT(3) << "Setting up Ogre..." << std::endl; 239 239 240 if (ogreConfigFile_ == "")240 if (ogreConfigFile_.empty()) 241 241 { 242 242 COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl; 243 243 ModifyConfigValue(ogreConfigFile_, tset, "config.cfg"); 244 244 } 245 if (ogreLogFile_ == "")245 if (ogreLogFile_.empty()) 246 246 { 247 247 COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl; … … 285 285 { 286 286 // just to make sure the next statement doesn't segfault 287 if (ogrePluginsDirectory_ == "")288 ogrePluginsDirectory_ = ".";287 if (ogrePluginsDirectory_.empty()) 288 ogrePluginsDirectory_ = '.'; 289 289 290 290 boost::filesystem::path folder(ogrePluginsDirectory_); … … 341 341 need the time. So we shouldn't run into problems. 342 342 */ 343 void GraphicsManager:: update(const Clock& time)343 void GraphicsManager::postUpdate(const Clock& time) 344 344 { 345 345 Ogre::FrameEvent evt; … … 395 395 { 396 396 int orxonoxLevel; 397 switch (lml) 398 { 399 case Ogre::LML_TRIVIAL: 400 orxonoxLevel = this->ogreLogLevelTrivial_; 401 break; 402 case Ogre::LML_NORMAL: 403 orxonoxLevel = this->ogreLogLevelNormal_; 404 break; 405 case Ogre::LML_CRITICAL: 406 orxonoxLevel = this->ogreLogLevelCritical_; 407 break; 408 default: 409 orxonoxLevel = 0; 397 std::string introduction; 398 // Do not show caught OGRE exceptions in front 399 if (message.find("EXCEPTION") != std::string::npos) 400 { 401 orxonoxLevel = OutputLevel::Debug; 402 introduction = "Ogre, caught exception: "; 403 } 404 else 405 { 406 switch (lml) 407 { 408 case Ogre::LML_TRIVIAL: 409 orxonoxLevel = this->ogreLogLevelTrivial_; 410 break; 411 case Ogre::LML_NORMAL: 412 orxonoxLevel = this->ogreLogLevelNormal_; 413 break; 414 case Ogre::LML_CRITICAL: 415 orxonoxLevel = this->ogreLogLevelCritical_; 416 break; 417 default: 418 orxonoxLevel = 0; 419 } 420 introduction = "Ogre: "; 410 421 } 411 422 OutputHandler::getOutStream(orxonoxLevel) 412 << "Ogre: "<< message << std::endl;423 << introduction << message << std::endl; 413 424 } 414 425 … … 440 451 { 441 452 assert(this->renderWindow_); 442 443 this->renderWindow_->writeContentsToTimestampedFile(PathConfig::getLogPathString() + "screenShot_", ".jpg"); 453 this->renderWindow_->writeContentsToTimestampedFile(PathConfig::getLogPathString() + "screenShot_", ".png"); 444 454 } 445 455 }
Note: See TracChangeset
for help on using the changeset viewer.