Changeset 5645 for code/branches/resource2/src/core/Core.cc
- Timestamp:
- Aug 13, 2009, 10:50:07 PM (15 years ago)
- Location:
- code/branches/resource2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2
- Property svn:externals
-
old new 1 media_stripped http://svn.orxonox.net/game/data/branches/media_stripped1 data_stripped https://svn.orxonox.net/game/data/branches/media_stripped
-
- Property svn:externals
-
code/branches/resource2/src/core/Core.cc
r5641 r5645 85 85 Core* Core::singletonPtr_s = 0; 86 86 87 SetCommandLineArgument(external MediaPath, "").information("Path to the external media files");87 SetCommandLineArgument(externalDataPath, "").information("Path to the external data files"); 88 88 SetCommandLineOnlyArgument(writingPathSuffix, "").information("Additional subfolder for config and log files"); 89 89 SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file"); … … 110 110 this->setConfigValues(); 111 111 112 // External media directory only exists for dev runs112 // External data directory only exists for dev runs 113 113 if (Core::isDevelopmentRun()) 114 114 { 115 // Possible media path override by the command line116 if (!CommandLine::getArgument("external MediaPath")->hasDefaultValue())117 tsetExternal MediaPath(CommandLine::getValue("externalMediaPath"));115 // Possible data path override by the command line 116 if (!CommandLine::getArgument("externalDataPath")->hasDefaultValue()) 117 tsetExternalDataPath(CommandLine::getValue("externalDataPath")); 118 118 } 119 119 } … … 188 188 /** 189 189 @brief 190 Temporary sets the media path190 Temporary sets the data path 191 191 @param path 192 The new media path192 The new data path 193 193 */ 194 void tsetExternal MediaPath(const std::string& path)195 { 196 mediaPath_ = boost::filesystem::path(path);194 void tsetExternalDataPath(const std::string& path) 195 { 196 dataPath_ = boost::filesystem::path(path); 197 197 } 198 198 … … 218 218 boost::filesystem::path rootPath_; 219 219 boost::filesystem::path executablePath_; //!< Path to the executable 220 boost::filesystem::path mediaPath_; //!< Path to the media file folder221 boost::filesystem::path external MediaPath_; //!< Path to the media file folder220 boost::filesystem::path dataPath_; //!< Path to the data file folder 221 boost::filesystem::path externalDataPath_; //!< Path to the external data file folder 222 222 boost::filesystem::path configPath_; //!< Path to the config file folder 223 223 boost::filesystem::path logPath_; //!< Path to the log file folder … … 283 283 284 284 // initialise Tcl 285 this->tclBind_.reset(new TclBind(Core::get MediaPathString()));285 this->tclBind_.reset(new TclBind(Core::getDataPathString())); 286 286 this->tclThreadManager_.reset(new TclThreadManager(tclBind_->getTclInterpreter())); 287 287 … … 401 401 } 402 402 403 /*static*/ void Core::tsetExternal MediaPath(const std::string& path)404 { 405 getInstance().configuration_->tsetExternal MediaPath(path);406 } 407 408 /*static*/ const boost::filesystem::path& Core::get MediaPath()409 { 410 return getInstance().configuration_-> mediaPath_;411 } 412 /*static*/ std::string Core::get MediaPathString()413 { 414 return getInstance().configuration_-> mediaPath_.string() + '/';415 } 416 417 /*static*/ const boost::filesystem::path& Core::getExternal MediaPath()418 { 419 return getInstance().configuration_->external MediaPath_;420 } 421 /*static*/ std::string Core::getExternal MediaPathString()422 { 423 return getInstance().configuration_->external MediaPath_.string() + '/';403 /*static*/ void Core::tsetExternalDataPath(const std::string& path) 404 { 405 getInstance().configuration_->tsetExternalDataPath(path); 406 } 407 408 /*static*/ const boost::filesystem::path& Core::getDataPath() 409 { 410 return getInstance().configuration_->dataPath_; 411 } 412 /*static*/ std::string Core::getDataPathString() 413 { 414 return getInstance().configuration_->dataPath_.string() + '/'; 415 } 416 417 /*static*/ const boost::filesystem::path& Core::getExternalDataPath() 418 { 419 return getInstance().configuration_->externalDataPath_; 420 } 421 /*static*/ std::string Core::getExternalDataPathString() 422 { 423 return getInstance().configuration_->externalDataPath_.string() + '/'; 424 424 } 425 425 … … 561 561 COUT(1) << "Running from the build tree." << std::endl; 562 562 Core::bDevRun_ = true; 563 configuration_-> mediaPath_ = specialConfig::mediaDevDirectory;564 configuration_->external MediaPath_ = specialConfig::externalMediaDevDirectory;563 configuration_->dataPath_ = specialConfig::dataDevDirectory; 564 configuration_->externalDataPath_ = specialConfig::externalDataDevDirectory; 565 565 configuration_->configPath_ = specialConfig::configDevDirectory; 566 566 configuration_->logPath_ = specialConfig::logDevDirectory; … … 579 579 580 580 // Using paths relative to the install prefix, complete them 581 configuration_-> mediaPath_ = configuration_->rootPath_ / specialConfig::defaultMediaPath;581 configuration_->dataPath_ = configuration_->rootPath_ / specialConfig::defaultDataPath; 582 582 configuration_->configPath_ = configuration_->rootPath_ / specialConfig::defaultConfigPath; 583 583 configuration_->logPath_ = configuration_->rootPath_ / specialConfig::defaultLogPath; … … 585 585 // There is no root path, so don't set it at all 586 586 587 configuration_-> mediaPath_ = specialConfig::mediaInstallDirectory;587 configuration_->dataPath_ = specialConfig::dataInstallDirectory; 588 588 589 589 // Get user directory
Note: See TracChangeset
for help on using the changeset viewer.