Changeset 8231 for code/branches/kicklib/src/libraries
- Timestamp:
- Apr 11, 2011, 6:39:04 AM (14 years ago)
- Location:
- code/branches/kicklib/src/libraries/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib/src/libraries/core/GraphicsManager.cc
r8225 r8231 30 30 #include "GraphicsManager.h" 31 31 32 #include <cstdlib> 32 33 #include <fstream> 33 34 #include <sstream> … … 61 62 #include "command/ConsoleCommand.h" 62 63 63 // Differentiate Boost Filesystem v2 and v364 #if (BOOST_FILESYSTEM_VERSION < 3)65 # define BF_NATIVE_STRING file_string66 #else67 # define BF_NATIVE_STRING string68 #endif69 70 64 namespace orxonox 71 65 { … … 148 142 SetConfigValue(ogreConfigFile_, "ogre.cfg") 149 143 .description("Location of the Ogre config file"); 150 SetConfigValue(ogrePluginsDirectory_, specialConfig::ogrePluginsDirectory)151 .description("Folder where the Ogre plugins are located.");152 144 SetConfigValue(ogrePlugins_, specialConfig::ogrePlugins) 153 145 .description("Comma separated list of all plugins to load."); … … 241 233 void GraphicsManager::loadOgrePlugins() 242 234 { 243 // just to make sure the next statement doesn't segfault 244 if (ogrePluginsDirectory_.empty()) 245 ogrePluginsDirectory_ = '.'; 246 247 boost::filesystem::path folder(ogrePluginsDirectory_); 235 // Plugin path can have many different locations... 236 std::string pluginPath = specialConfig::ogrePluginsDirectory; 237 #ifdef DEPENDENCY_PACKAGE_ENABLE 238 if (!PathConfig::isDevelopmentRun()) 239 { 240 # if defined(ORXONOX_PLATFORM_WINDOWS) 241 pluginPath = PathConfig::getExecutablePathString(); 242 # elif defined(ORXONOX_PLATFORM_APPLE) 243 // TODO: Where are the plugins being installed to? 244 pluginPath = PathConfig::getExecutablePathString(); 245 # endif 246 } 247 #endif 248 249 // Add OGRE plugin path to the environment. That way one plugin could 250 // also depend on another without problems on Windows 251 std::string pathVariable(getenv("PATH")); 252 putenv(const_cast<char*>(("PATH=" + pathVariable + ';' + pluginPath).c_str())); 253 248 254 // Do some SubString magic to get the comma separated list of plugins 249 255 SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0'); 250 // Use backslash paths on Windows! file_string() already does that though.251 256 for (unsigned int i = 0; i < plugins.size(); ++i) 252 ogreRoot_->loadPlugin( (folder / plugins[i]).BF_NATIVE_STRING());257 ogreRoot_->loadPlugin(plugins[i]); 253 258 } 254 259 -
code/branches/kicklib/src/libraries/core/GraphicsManager.h
r7948 r8231 110 110 // config values 111 111 std::string ogreConfigFile_; //!< ogre config filename 112 std::string ogrePluginsDirectory_; //!< Directory where the Ogre plugins are located113 112 std::string ogrePlugins_; //!< Comma separated list of all plugins to load 114 113 std::string ogreLogFile_; //!< log filename for Ogre log messages
Note: See TracChangeset
for help on using the changeset viewer.