Changeset 2685 for code/branches/buildsystem3/src/orxonox/gamestates
- Timestamp:
- Feb 20, 2009, 5:32:04 PM (16 years ago)
- Location:
- code/branches/buildsystem3/src/orxonox/gamestates
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc
r2664 r2685 61 61 #include "gui/GUIManager.h" 62 62 #include "tools/WindowEventListener.h" 63 #include "Settings.h"64 63 65 64 // for compatibility … … 138 137 // load debug overlay 139 138 COUT(3) << "Loading Debug Overlay..." << std::endl; 140 this->debugOverlay_ = new XMLFile( Settings::getDataPath() + "overlay/debug.oxo");139 this->debugOverlay_ = new XMLFile(Core::getMediaPath() + "overlay/debug.oxo"); 141 140 Loader::open(debugOverlay_); 142 141 … … 211 210 delete this->ogreRoot_; 212 211 213 //#ifdef ORXONOX_PLATFORM_WINDOWS214 212 // delete the ogre log and the logManager (since we have created it). 215 213 this->ogreLogger_->getDefaultLog()->removeListener(this); 216 214 this->ogreLogger_->destroyLog(Ogre::LogManager::getSingleton().getDefaultLog()); 217 215 delete this->ogreLogger_; 218 //#endif219 216 220 217 delete graphicsEngine_; … … 287 284 COUT(3) << "Setting up Ogre..." << std::endl; 288 285 289 // TODO: LogManager doesn't work on oli platform. The why is yet unknown. 290 //#ifdef ORXONOX_PLATFORM_WINDOWS 286 if (ogreConfigFile_ == "") 287 { 288 COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl; 289 ModifyConfigValue(ogreConfigFile_, tset, "config.cfg"); 290 } 291 if (ogreLogFile_ == "") 292 { 293 COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl; 294 ModifyConfigValue(ogreLogFile_, tset, "ogre.log"); 295 } 296 297 boost::filesystem::path ogreConfigFilepath(Core::getConfigPath() + ogreConfigFile_); 298 boost::filesystem::path ogreLogFilepath(Core::getLogPath() + ogreLogFile_); 299 291 300 // create a new logManager 301 // Ogre::Root will detect that we've already created a Log 292 302 ogreLogger_ = new Ogre::LogManager(); 293 303 COUT(4) << "Ogre LogManager created" << std::endl; … … 295 305 // create our own log that we can listen to 296 306 Ogre::Log *myLog; 297 if (this->ogreLogFile_ == "") 298 myLog = ogreLogger_->createLog("ogre.log", true, false, true); 299 else 300 myLog = ogreLogger_->createLog(this->ogreLogFile_, true, false, false); 307 myLog = ogreLogger_->createLog(ogreLogFilepath.native_file_string(), true, false, false); 301 308 COUT(4) << "Ogre Log created" << std::endl; 302 309 303 310 myLog->setLogDetail(Ogre::LL_BOREME); 304 311 myLog->addListener(this); 305 //#endif 306 307 // Root will detect that we've already created a Log 312 308 313 COUT(4) << "Creating Ogre Root..." << std::endl; 309 310 if (ogreConfigFile_ == "")311 {312 COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;313 ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");314 }315 if (ogreLogFile_ == "")316 {317 COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;318 ModifyConfigValue(ogreLogFile_, tset, "ogre.log");319 }320 314 321 315 // check for config file existence because Ogre displays (caught) exceptions if not 322 316 std::ifstream probe; 323 probe.open(ogreConfigFile _.c_str());317 probe.open(ogreConfigFilepath.native_file_string().c_str()); 324 318 if (!probe) 325 319 { 326 320 // create a zero sized file 327 321 std::ofstream creator; 328 creator.open(ogreConfigFile _.c_str());322 creator.open(ogreConfigFilepath.native_file_string().c_str()); 329 323 creator.close(); 330 324 } … … 333 327 334 328 // Leave plugins file empty. We're going to do that part manually later 335 ogreRoot_ = new Ogre::Root("", ogreConfigFile_, ogreLogFile_); 336 337 #if 0 // Ogre 1.4.3 doesn't yet support setDebugOutputEnabled(.) 338 #ifndef ORXONOX_PLATFORM_WINDOWS 339 // tame the ogre ouput so we don't get all the mess in the console 340 Ogre::Log* defaultLog = Ogre::LogManager::getSingleton().getDefaultLog(); 341 defaultLog->setDebugOutputEnabled(false); 342 defaultLog->setLogDetail(Ogre::LL_BOREME); 343 defaultLog->addListener(this); 344 #endif 345 #endif 329 ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.native_file_string(), ogreLogFilepath.native_file_string()); 346 330 347 331 COUT(3) << "Ogre set up done." << std::endl; … … 377 361 try 378 362 { 379 cf.load( Settings::getDataPath() + resourceFile_);363 cf.load(Core::getMediaPath() + resourceFile_); 380 364 } 381 365 catch (...) … … 403 387 404 388 Ogre::ResourceGroupManager::getSingleton().addResourceLocation( 405 std::string( Settings::getDataPath() + archName), typeName, secName);389 std::string(Core::getMediaPath() + archName), typeName, secName); 406 390 } 407 391 } -
code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc
r2662 r2685 46 46 #include "LevelManager.h" 47 47 #include "PlayerManager.h" 48 #include "Settings.h"49 48 50 49 namespace orxonox … … 205 204 std::string levelName; 206 205 CommandLine::getValue("level", &levelName); 207 startFile_ = new XMLFile( Settings::getDataPath() + std::string("levels/") + levelName);206 startFile_ = new XMLFile(Core::getMediaPath() + std::string("levels/") + levelName); 208 207 Loader::open(startFile_); 209 208 } -
code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.cc
r2664 r2685 44 44 #include "tools/Timer.h" 45 45 #include "objects/Tickable.h" 46 #include "Settings.h"47 46 48 47 #ifdef ORXONOX_PLATFORM_WINDOWS 49 # ifndef WIN32_LEAN_AND_MEAN 50 # define WIN32_LEAN_AND_MEAN 51 # endif 52 # include "windows.h" 53 54 //Get around Windows hackery 55 # ifdef max 56 # undef max 57 # endif 58 # ifdef min 59 # undef min 60 # endif 48 # include <winbase.h> 61 49 #endif 62 50 63 51 namespace orxonox 64 52 { 65 SetCommandLineArgument(dataPath, "").information("PATH");66 53 SetCommandLineArgument(limitToCPU, 1).information("0: off | #cpu"); 67 54 … … 71 58 , bPaused_(false) 72 59 , timeFactorPauseBackup_(1.0f) 73 , settings_(0)74 60 , tclBind_(0) 75 61 , tclThreadManager_(0) … … 113 99 this->luaBind_ = new LuaBind(); 114 100 115 // instantiate Settings class116 this->settings_ = new Settings();117 118 std::string dataPath = CommandLine::getValue("dataPath");119 if (dataPath != "")120 {121 if (*dataPath.end() != '/' && *dataPath.end() != '\\')122 Settings::tsetDataPath(dataPath + "/");123 else124 Settings::tsetDataPath(dataPath);125 }126 127 101 // initialise TCL 128 this->tclBind_ = new TclBind( Settings::getDataPath());102 this->tclBind_ = new TclBind(Core::getMediaPath()); 129 103 this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter()); 130 104 … … 182 156 delete this->tclBind_; 183 157 184 delete this->settings_;185 158 delete this->luaBind_; 186 159 -
code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.h
r2662 r2685 81 81 bool bPaused_; 82 82 float timeFactorPauseBackup_; 83 Settings* settings_;84 83 TclBind* tclBind_; 85 84 TclThreadManager* tclThreadManager_;
Note: See TracChangeset
for help on using the changeset viewer.