Changeset 8858 for code/trunk/src/libraries/core/GraphicsManager.cc
- Timestamp:
- Aug 23, 2011, 12:45:53 AM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 1 build 2 2 codeblocks 3 vs 3 4 dependencies
-
- Property svn:mergeinfo changed
/code/branches/output (added) merged: 8739-8740,8765,8771-8772,8774-8780,8787-8789,8794-8799,8801,8803-8812,8814,8816-8817,8820,8822,8825-8837,8840,8844,8846,8848-8850,8853-8854
- Property svn:ignore
-
code/trunk/src/libraries/core/GraphicsManager.cc
r8423 r8858 104 104 RegisterObject(GraphicsManager); 105 105 106 orxout(internal_status) << "initializing GraphicsManager..." << endl; 106 107 this->setConfigValues(); 107 108 … … 114 115 resources_.reset(new XMLFile("DefaultResources.oxr")); 115 116 resources_->setLuaSupport(false); 116 Loader::open(resources_.get() );117 Loader::open(resources_.get(), ClassTreeMask(), false); 117 118 118 119 // Only for runs in the build directory (not installed) … … 122 123 extResources_.reset(new XMLFile("resources.oxr")); 123 124 extResources_->setLuaSupport(false); 124 Loader::open(extResources_.get() );125 Loader::open(extResources_.get(), ClassTreeMask(), false); 125 126 126 127 if (bLoadRenderer) … … 129 130 this->upgradeToGraphics(); 130 131 } 132 133 orxout(internal_status) << "finished initializing GraphicsManager" << endl; 131 134 } 132 135 133 136 void GraphicsManager::destroy() 134 137 { 138 orxout(internal_status) << "destroying GraphicsManager..." << endl; 139 135 140 Loader::unload(debugOverlay_.get()); 136 141 … … 148 153 safeObjectDelete(&ogreLogger_); 149 154 safeObjectDelete(&ogreWindowEventListener_); 155 156 orxout(internal_status) << "finished destroying GraphicsManager" << endl; 150 157 } 151 158 … … 158 165 SetConfigValue(ogreLogFile_, "ogre.log") 159 166 .description("Logfile for messages from Ogre. Use \"\" to suppress log file creation."); 160 SetConfigValue(ogreLogLevelTrivial_ , 5)161 .description("Corresponding orxonox debug level for ogre Trivial");162 SetConfigValue(ogreLogLevelNormal_ , 4)163 .description("Corresponding orxonox debug level for ogre Normal");164 SetConfigValue(ogreLogLevelCritical_, 2)165 .description("Corresponding orxonox debug level for ogre Critical");166 167 } 167 168 … … 179 180 return; 180 181 182 orxout(internal_info) << "GraphicsManager upgrade to graphics" << endl; 183 181 184 // load all the required plugins for Ogre 182 185 this->loadOgrePlugins(); … … 189 192 // choose another resource group. 190 193 Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); 194 195 orxout(internal_info) << "GraphicsManager finished upgrade to graphics" << endl; 191 196 } 192 197 … … 197 202 void GraphicsManager::loadOgreRoot() 198 203 { 199 COUT(3) << "Setting up Ogre..." << std::endl;204 orxout(internal_info) << "Setting up Ogre..." << endl; 200 205 201 206 if (ogreConfigFile_.empty()) 202 207 { 203 COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;208 orxout(internal_warning) << "Ogre config file set to \"\". Defaulting to config.cfg" << endl; 204 209 ModifyConfigValue(ogreConfigFile_, tset, "config.cfg"); 205 210 } 206 211 if (ogreLogFile_.empty()) 207 212 { 208 COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;213 orxout(internal_warning) << "Ogre log file set to \"\". Defaulting to ogre.log" << endl; 209 214 ModifyConfigValue(ogreLogFile_, tset, "ogre.log"); 210 215 } … … 216 221 // Ogre::Root will detect that we've already created a Log 217 222 ogreLogger_ = new Ogre::LogManager(); 218 COUT(4) << "Ogre LogManager created" << std::endl;223 orxout(internal_info) << "Ogre LogManager created" << endl; 219 224 220 225 // create our own log that we can listen to 221 226 Ogre::Log *myLog; 222 227 myLog = ogreLogger_->createLog(ogreLogFilepath.string(), true, false, false); 223 COUT(4) << "Ogre Log created" << std::endl;228 orxout(internal_info) << "Ogre Log created" << endl; 224 229 225 230 myLog->setLogDetail(Ogre::LL_BOREME); 226 231 myLog->addListener(this); 227 232 228 COUT(4) << "Creating Ogre Root..." << std::endl;233 orxout(internal_info) << "Creating Ogre Root..." << endl; 229 234 230 235 // check for config file existence because Ogre displays (caught) exceptions if not … … 240 245 ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.string(), ogreLogFilepath.string()); 241 246 242 COUT(3) << "Ogre set up done." << std::endl;247 orxout(internal_info) << "Ogre set up done." << endl; 243 248 } 244 249 245 250 void GraphicsManager::loadOgrePlugins() 246 251 { 252 orxout(internal_info) << "loading ogre plugins" << endl; 253 247 254 // Plugin path can have many different locations... 248 255 std::string pluginPath = specialConfig::ogrePluginsDirectory; … … 277 284 void GraphicsManager::loadRenderer() 278 285 { 279 CCOUT(4) << "Configuring Renderer" << std::endl;286 orxout(internal_info) << "GraphicsManager: Configuring Renderer" << endl; 280 287 281 288 bool updatedConfig = Core::getInstance().getOgreConfigTimestamp() > Core::getInstance().getLastLevelTimestamp(); 282 289 if (updatedConfig) 283 COUT(2) << "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << std::endl;290 orxout(user_info)<< "Ogre config file has changed, but no level was started since then. Displaying config dialogue again to verify the changes." << endl; 284 291 285 292 if (!ogreRoot_->restoreConfig() || updatedConfig) … … 291 298 } 292 299 293 CCOUT(4) << "Creating render window" << std::endl;300 orxout(internal_info) << "Creating render window" << endl; 294 301 295 302 this->renderWindow_ = ogreRoot_->initialise(true, "Orxonox"); … … 317 324 { 318 325 // Load debug overlay to show info about fps and tick time 319 COUT(4) << "Loading Debug Overlay..." << std::endl;326 orxout(internal_info) << "Loading Debug Overlay..." << endl; 320 327 debugOverlay_.reset(new XMLFile("debug.oxo")); 321 Loader::open(debugOverlay_.get() );328 Loader::open(debugOverlay_.get(), ClassTreeMask(), false); 322 329 } 323 330 … … 396 403 Ogre::LogMessageLevel lml, bool maskDebug, const std::string& logName) 397 404 { 398 intorxonoxLevel;405 OutputLevel orxonoxLevel; 399 406 std::string introduction; 400 407 // Do not show caught OGRE exceptions in front 401 408 if (message.find("EXCEPTION") != std::string::npos) 402 409 { 403 orxonoxLevel = OutputLevel::Debug;410 orxonoxLevel = level::internal_error; 404 411 introduction = "Ogre, caught exception: "; 405 412 } … … 409 416 { 410 417 case Ogre::LML_TRIVIAL: 411 orxonoxLevel = this->ogreLogLevelTrivial_;418 orxonoxLevel = level::verbose_more; 412 419 break; 413 420 case Ogre::LML_NORMAL: 414 orxonoxLevel = this->ogreLogLevelNormal_;421 orxonoxLevel = level::verbose; 415 422 break; 416 423 case Ogre::LML_CRITICAL: 417 orxonoxLevel = this->ogreLogLevelCritical_;424 orxonoxLevel = level::internal_warning; 418 425 break; 419 426 default: 420 orxonoxLevel = 0;427 orxonoxLevel = level::debug_output; 421 428 } 422 429 introduction = "Ogre: "; 423 430 } 424 OutputHandler::getOutStream(orxonoxLevel) 425 << introduction << message << std::endl;431 432 orxout(orxonoxLevel, context::ogre) << introduction << message << endl; 426 433 } 427 434
Note: See TracChangeset
for help on using the changeset viewer.