Changeset 8231 for code/branches
- Timestamp:
- Apr 11, 2011, 6:39:04 AM (14 years ago)
- Location:
- code/branches/kicklib/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib/src/SpecialConfig.h.in
r8071 r8231 92 92 93 93 // OGRE PLUGINS 94 // Apple has trouble finding OGRE plugins because of its install-name convention95 // Adopting the executable_path structure for later use in app bundles96 94 #ifdef NDEBUG 97 95 const char ogrePlugins[] = "@OGRE_PLUGINS_RELEASE@"; 98 # ifdef DEPENDENCY_PACKAGE_ENABLE99 # ifdef ORXONOX_PLATFORM_APPLE100 const char ogrePluginsDirectory[] = "@executable_path/../Plugins";101 # else102 const char ogrePluginsDirectory[] = ".";103 # endif104 # else105 96 const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_RELEASE@"; 106 # endif107 97 #else 108 98 const char ogrePlugins[] = "@OGRE_PLUGINS_DEBUG@"; 109 # ifdef DEPENDENCY_PACKAGE_ENABLE110 # ifdef ORXONOX_PLATFORM_APPLE111 const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_DEBUG@";112 # else113 const char ogrePluginsDirectory[] = ".";114 # endif115 # else116 99 const char ogrePluginsDirectory[] = "@OGRE_PLUGINS_FOLDER_DEBUG@"; 117 # endif118 100 #endif 119 101 } } -
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.