Changeset 5645 for code/branches/resource2/src/core
- Timestamp:
- Aug 13, 2009, 10:50:07 PM (15 years ago)
- Location:
- code/branches/resource2
- Files:
-
- 6 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/ConfigFileManager.cc
r3370 r5645 229 229 if (!boost::filesystem::exists(filepath)) 230 230 { 231 // Try to get default one from the media folder232 boost::filesystem::path defaultFilepath(Core::get MediaPath() / "defaultConfig" / this->filename_);231 // Try to get default one from the data folder 232 boost::filesystem::path defaultFilepath(Core::getDataPath() / "defaultConfig" / this->filename_); 233 233 if (boost::filesystem::exists(defaultFilepath)) 234 234 { -
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 -
code/branches/resource2/src/core/Core.h
r5641 r5645 57 57 The Core class is a singleton used to configure the program basics. 58 58 @details 59 The class provides information about the media, config and log path.59 The class provides information about the data, config and log path. 60 60 It determines those by the use of platform specific functions. 61 61 @remark … … 91 91 static void resetLanguage(); 92 92 93 static void tsetExternal MediaPath(const std::string& path);93 static void tsetExternalDataPath(const std::string& path); 94 94 //! Returns the path to the data files as boost::filesystem::path 95 static const boost::filesystem::path& get MediaPath();95 static const boost::filesystem::path& getDataPath(); 96 96 //! Returns the path to the external data files as boost::filesystem::path 97 static const boost::filesystem::path& getExternal MediaPath();97 static const boost::filesystem::path& getExternalDataPath(); 98 98 //! Returns the path to the config files as boost::filesystem::path 99 99 static const boost::filesystem::path& getConfigPath(); 100 100 //! Returns the path to the log files as boost::filesystem::path 101 101 static const boost::filesystem::path& getLogPath(); 102 //! Returns the path to the data files as std::string103 102 //! Returns the path to the root folder as boost::filesystem::path 104 103 static const boost::filesystem::path& getRootPath(); 105 static std::string getMediaPathString(); 104 //! Returns the path to the data files as std::string 105 static std::string getDataPathString(); 106 106 //! Returns the path to the external data files as std::string 107 static std::string getExternal MediaPathString();107 static std::string getExternalDataPathString(); 108 108 //! Returns the path to the config files as std::string 109 109 static std::string getConfigPathString(); -
code/branches/resource2/src/core/GUIManager.cc
r3370 r5645 171 171 { 172 172 // set datapath for GUI data 173 lua_pushfstring(this->scriptModule_->getLuaState(), Core::get MediaPathString().c_str());173 lua_pushfstring(this->scriptModule_->getLuaState(), Core::getDataPathString().c_str()); 174 174 lua_setglobal(this->scriptModule_->getLuaState(), "datapath"); 175 175 // call main Lua script -
code/branches/resource2/src/core/LuaBind.cc
r3370 r5645 47 47 LuaBind::LuaBind() 48 48 { 49 this->includePath_ = Core::get MediaPathString();49 this->includePath_ = Core::getDataPathString(); 50 50 51 51 luaState_ = lua_open();
Note: See TracChangeset
for help on using the changeset viewer.