- Timestamp:
- Apr 21, 2011, 7:43:10 PM (13 years ago)
- Location:
- code/branches/kicklib2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/kicklib2
-
code/branches/kicklib2/src/libraries/core/GraphicsManager.cc
r8284 r8285 30 30 #include "GraphicsManager.h" 31 31 32 #include <cstdlib> 32 33 #include <fstream> 33 34 #include <sstream> … … 120 121 // Only for development runs 121 122 if (PathConfig::isDevelopmentRun()) 122 {123 123 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem"); 124 extResources_.reset(new XMLFile("resources.oxr")); 125 extResources_->setLuaSupport(false);126 Loader::open(extResources_.get());127 }124 125 extResources_.reset(new XMLFile("resources.oxr")); 126 extResources_->setLuaSupport(false); 127 Loader::open(extResources_.get()); 128 128 129 129 if (bLoadRenderer) … … 150 150 // Undeclare the resources 151 151 Loader::unload(resources_.get()); 152 if (PathConfig::isDevelopmentRun()) 153 Loader::unload(extResources_.get()); 152 Loader::unload(extResources_.get()); 154 153 } 155 154 … … 158 157 SetConfigValue(ogreConfigFile_, "ogre.cfg") 159 158 .description("Location of the Ogre config file"); 160 SetConfigValue(ogrePluginsDirectory_, specialConfig::ogrePluginsDirectory)161 .description("Folder where the Ogre plugins are located.");162 159 SetConfigValue(ogrePlugins_, specialConfig::ogrePlugins) 163 160 .description("Comma separated list of all plugins to load."); … … 251 248 void GraphicsManager::loadOgrePlugins() 252 249 { 253 // just to make sure the next statement doesn't segfault 254 if (ogrePluginsDirectory_.empty()) 255 ogrePluginsDirectory_ = '.'; 256 257 boost::filesystem::path folder(ogrePluginsDirectory_); 250 // Plugin path can have many different locations... 251 std::string pluginPath = specialConfig::ogrePluginsDirectory; 252 #ifdef DEPENDENCY_PACKAGE_ENABLE 253 if (!PathConfig::isDevelopmentRun()) 254 { 255 # if defined(ORXONOX_PLATFORM_WINDOWS) 256 pluginPath = PathConfig::getExecutablePathString(); 257 # elif defined(ORXONOX_PLATFORM_APPLE) 258 // TODO: Where are the plugins being installed to? 259 pluginPath = PathConfig::getExecutablePathString(); 260 # endif 261 } 262 #endif 263 264 #ifdef ORXONOX_PLATFORM_WINDOWS 265 // Add OGRE plugin path to the environment. That way one plugin could 266 // also depend on another without problems on Windows 267 const char* currentPATH = getenv("PATH"); 268 std::string newPATH = pluginPath; 269 if (currentPATH != NULL) 270 newPATH = std::string(currentPATH) + ';' + newPATH; 271 putenv(const_cast<char*>(("PATH=" + newPATH).c_str())); 272 #endif 273 258 274 // Do some SubString magic to get the comma separated list of plugins 259 275 SubString plugins(ogrePlugins_, ",", " ", false, '\\', false, '"', false, '{', '}', false, '\0'); 260 // Use backslash paths on Windows! file_string() already does that though.261 276 for (unsigned int i = 0; i < plugins.size(); ++i) 262 #if BOOST_FILESYSTEM_VERSION < 3 263 ogreRoot_->loadPlugin((folder / plugins[i]).file_string()); 264 #else 265 ogreRoot_->loadPlugin((folder / plugins[i]).string()); 266 #endif 277 ogreRoot_->loadPlugin(pluginPath + '/' + plugins[i]); 267 278 } 268 279 … … 290 301 291 302 Ogre::WindowEventUtilities::addWindowEventListener(this->renderWindow_, ogreWindowEventListener_.get()); 292 293 // HACK294 #ifdef ORXONOX_PLATFORM_APPLE295 //INFO: This will give our window focus, and not lock it to the terminal296 ProcessSerialNumber psn = {0, kCurrentProcess};297 TransformProcessType(&psn, kProcessTransformToForegroundApplication);298 SetFrontProcess(&psn);299 #endif300 // End of HACK301 303 302 304 // create a full screen default viewport
Note: See TracChangeset
for help on using the changeset viewer.