Changeset 2244 for code/branches/buildsystem/src/orxonox
- Timestamp:
- Nov 21, 2008, 12:36:23 AM (16 years ago)
- Location:
- code/branches/buildsystem/src/orxonox/gamestates
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem/src/orxonox/gamestates/GSGraphics.cc
r1828 r2244 43 43 #include "util/Debug.h" 44 44 #include "util/Exception.h" 45 #include "util/String.h" 46 #include "util/SubString.h" 45 47 #include "core/ConsoleCommand.h" 46 48 #include "core/ConfigValueIncludes.h" … … 82 84 { 83 85 SetConfigValue(resourceFile_, "resources.cfg").description("Location of the resources file in the data path."); 86 SetConfigValue(ogrePluginsFolder_, ".").description("Folder where the Ogre plugins are located."); 87 SetConfigValue(ogrePlugins_, "RenderSystem_GL, Plugin_ParticleFX").description("Comma separated list of all plugins to load."); 84 88 SetConfigValue(statisticsRefreshCycle_, 200000).description("Sets the time in microseconds interval at which average fps, etc. get updated."); 85 89 } … … 93 97 this->ogreRoot_ = getParent()->getOgreRoot(); 94 98 99 // load all the required plugins for Ogre 100 loadOgrePlugins(); 101 // read resource declaration file 95 102 this->declareResources(); 96 this->loadRenderer(); // creates the render window 103 // Reads ogre config and creates the render window 104 this->loadRenderer(); 105 97 106 // TODO: Spread this so that this call only initialises things needed for the Console and GUI 98 107 this->initialiseResources(); … … 232 241 233 242 ++frameCount_; 243 } 244 245 void GSGraphics::loadOgrePlugins() 246 { 247 // just to make sure the next statement doesn't segfault 248 if (ogrePluginsFolder_ == "") 249 ogrePluginsFolder_ = "."; 250 251 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32 252 convertToWindowsPath(&ogrePluginsFolder_); 253 #else 254 convertToUnixPath(&ogrePluginsFolder_); 255 #endif 256 257 // Do some SubString magic to get the comma separated list of plugins 258 SubString plugins(ogrePlugins_, ",", " ", false, 92, false, 34, false, 40, 41, false, '\0'); 259 for (unsigned int i = 0; i < plugins.size(); ++i) 260 ogreRoot_->loadPlugin(ogrePluginsFolder_ + plugins[i]); 234 261 } 235 262 -
code/branches/buildsystem/src/orxonox/gamestates/GSGraphics.h
r1788 r2244 56 56 void setConfigValues(); 57 57 58 void loadOgrePlugins(); 58 59 void declareResources(); 59 60 void loadRenderer(); … … 88 89 // config values 89 90 std::string resourceFile_; //!< resources file name 91 std::string ogrePluginsFolder_; //!< Folder where the Ogre plugins are located 92 std::string ogrePlugins_; //!< Comma separated list of all plugins to load 90 93 unsigned int detailLevelParticle_; //!< Detail level of particle effects (0: off, 1: low, 2: normal, 3: high) 91 94 }; -
code/branches/buildsystem/src/orxonox/gamestates/GSRoot.cc
r1826 r2244 286 286 probe.close(); 287 287 288 ogreRoot_ = new Ogre::Root(ogrePluginsFile_, ogreConfigFile_, ogreLogFile_); 288 // Leave plugins file empty. We're going to do that part manually later 289 ogreRoot_ = new Ogre::Root("", ogreConfigFile_, ogreLogFile_); 289 290 290 291 #if 0 // Ogre 1.4.3 doesn't yet support setDebugOutputEnabled(.)
Note: See TracChangeset
for help on using the changeset viewer.