- Timestamp:
- Feb 14, 2009, 10:53:45 PM (16 years ago)
- Location:
- code/branches/buildsystem3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem3
- Property svn:ignore deleted
- Property svn:mergeinfo changed
-
code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc
r2662 r2664 31 31 32 32 #include <fstream> 33 #include <boost/filesystem.hpp> 34 33 35 #include <OgreCompositorManager.h> 34 36 #include <OgreConfigFile.h> … … 45 47 #include "util/Debug.h" 46 48 #include "util/Exception.h" 49 #include "util/String.h" 50 #include "util/SubString.h" 47 51 #include "core/ConsoleCommand.h" 48 52 #include "core/ConfigValueIncludes.h" … … 92 96 SetConfigValue(ogreConfigFile_, "ogre.cfg") 93 97 .description("Location of the Ogre config file"); 94 SetConfigValue(ogrePluginsFile_, "plugins.cfg") 95 .description("Location of the Ogre plugins file"); 98 SetConfigValue(ogrePluginsFolder_, ORXONOX_OGRE_PLUGINS_FOLDER) 99 .description("Folder where the Ogre plugins are located."); 100 SetConfigValue(ogrePlugins_, ORXONOX_OGRE_PLUGINS) 101 .description("Comma separated list of all plugins to load."); 96 102 SetConfigValue(ogreLogFile_, "ogre.log") 97 103 .description("Logfile for messages from Ogre. Use \"\" to suppress log file creation."); … … 115 121 // Ogre setup procedure 116 122 setupOgre(); 123 // load all the required plugins for Ogre 124 loadOgrePlugins(); 125 // read resource declaration file 117 126 this->declareResources(); 118 this->loadRenderer(); // creates the render window 127 // Reads ogre config and creates the render window 128 this->loadRenderer(); 129 119 130 // TODO: Spread this so that this call only initialises things needed for the Console and GUI 120 131 this->initialiseResources(); … … 200 211 delete this->ogreRoot_; 201 212 202 //#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32213 //#ifdef ORXONOX_PLATFORM_WINDOWS 203 214 // delete the ogre log and the logManager (since we have created it). 204 215 this->ogreLogger_->getDefaultLog()->removeListener(this); … … 277 288 278 289 // TODO: LogManager doesn't work on oli platform. The why is yet unknown. 279 //#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32290 //#ifdef ORXONOX_PLATFORM_WINDOWS 280 291 // create a new logManager 281 292 ogreLogger_ = new Ogre::LogManager(); … … 297 308 COUT(4) << "Creating Ogre Root..." << std::endl; 298 309 299 if (ogrePluginsFile_ == "")300 {301 COUT(2) << "Warning: Ogre plugins file set to \"\". Defaulting to plugins.cfg" << std::endl;302 ModifyConfigValue(ogrePluginsFile_, tset, "plugins.cfg");303 }304 310 if (ogreConfigFile_ == "") 305 311 { … … 326 332 probe.close(); 327 333 328 ogreRoot_ = new Ogre::Root(ogrePluginsFile_, ogreConfigFile_, ogreLogFile_); 334 // Leave plugins file empty. We're going to do that part manually later 335 ogreRoot_ = new Ogre::Root("", ogreConfigFile_, ogreLogFile_); 329 336 330 337 #if 0 // Ogre 1.4.3 doesn't yet support setDebugOutputEnabled(.) 331 #if ORXONOX_PLATFORM != ORXONOX_PLATFORM_WIN32338 #ifndef ORXONOX_PLATFORM_WINDOWS 332 339 // tame the ogre ouput so we don't get all the mess in the console 333 340 Ogre::Log* defaultLog = Ogre::LogManager::getSingleton().getDefaultLog(); … … 339 346 340 347 COUT(3) << "Ogre set up done." << std::endl; 348 } 349 350 void GSGraphics::loadOgrePlugins() 351 { 352 // just to make sure the next statement doesn't segfault 353 if (ogrePluginsFolder_ == "") 354 ogrePluginsFolder_ = "."; 355 356 boost::filesystem::path folder(ogrePluginsFolder_); 357 // Do some SubString magic to get the comma separated list of plugins 358 SubString plugins(ogrePlugins_, ",", " ", false, 92, false, 34, false, 40, 41, false, '\0'); 359 for (unsigned int i = 0; i < plugins.size(); ++i) 360 ogreRoot_->loadPlugin((folder / plugins[i]).native_file_string()); 341 361 } 342 362
Note: See TracChangeset
for help on using the changeset viewer.