[Orxonox-commit 3685] r8366 - in code/trunk/src/libraries: core core/command core/input tools

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Apr 30 21:31:02 CEST 2011


Author: rgrieder
Date: 2011-04-30 21:31:02 +0200 (Sat, 30 Apr 2011)
New Revision: 8366

Modified:
   code/trunk/src/libraries/core/Core.cc
   code/trunk/src/libraries/core/Core.h
   code/trunk/src/libraries/core/GraphicsManager.cc
   code/trunk/src/libraries/core/PathConfig.cc
   code/trunk/src/libraries/core/PathConfig.h
   code/trunk/src/libraries/core/command/TclBind.cc
   code/trunk/src/libraries/core/input/KeyBinder.cc
   code/trunk/src/libraries/tools/ResourceLocation.cc
Log:
Renamed PathConfig::isDevelopmentRun() to PathConfig::buildDirectoryRun() because that fits better and there is no confusion with Core::inDevMode().
Also used isDevelopmentRun() as default value for Core::inDevMode() instead of ORXONOX_RELEASE.

Modified: code/trunk/src/libraries/core/Core.cc
===================================================================
--- code/trunk/src/libraries/core/Core.cc	2011-04-30 19:27:02 UTC (rev 8365)
+++ code/trunk/src/libraries/core/Core.cc	2011-04-30 19:31:02 UTC (rev 8366)
@@ -97,6 +97,7 @@
         , bStartIOConsole_(true)
         , lastLevelTimestamp_(0)
         , ogreConfigTimestamp_(0)
+        , bDevMode_(false)
     {
         // Set the hard coded fixed paths
         this->pathConfig_.reset(new PathConfig());
@@ -211,17 +212,15 @@
     {
 #ifdef ORXONOX_RELEASE
         const unsigned int defaultLevelLogFile = 3;
-        SetConfigValue(bDevMode_, false)
-            .description("Developer mode. If not set, hides some things from the user to not confuse him.");
 #else
         const unsigned int defaultLevelLogFile = 4;
-        SetConfigValue(bDevMode_, true)
-            .description("Developer mode. If not set, hides some things from the user to not confuse him.");
 #endif
         SetConfigValueExternal(softDebugLevelLogFile_, "OutputHandler", "softDebugLevelLogFile", defaultLevelLogFile)
             .description("The maximum level of debug output shown in the log file");
         OutputHandler::getInstance().setSoftDebugLevel(OutputHandler::logFileOutputListenerName_s, this->softDebugLevelLogFile_);
 
+        SetConfigValue(bDevMode_, PathConfig::buildDirectoryRun())
+            .description("Developer mode. If not set, hides some things from the user to not confuse him.");
         SetConfigValue(language_, Language::getInstance().defaultLanguage_)
             .description("The language of the in game text")
             .callback(this, &Core::languageChanged);

Modified: code/trunk/src/libraries/core/Core.h
===================================================================
--- code/trunk/src/libraries/core/Core.h	2011-04-30 19:27:02 UTC (rev 8365)
+++ code/trunk/src/libraries/core/Core.h	2011-04-30 19:31:02 UTC (rev 8366)
@@ -90,6 +90,7 @@
             inline long long getOgreConfigTimestamp() const
                 { return this->ogreConfigTimestamp_; }
 
+            //! Developers bit. If returns false, some options are not available as to not confuse the normal user.
             inline bool inDevMode(void) const
                 { return this->bDevMode_; }
 

Modified: code/trunk/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/trunk/src/libraries/core/GraphicsManager.cc	2011-04-30 19:27:02 UTC (rev 8365)
+++ code/trunk/src/libraries/core/GraphicsManager.cc	2011-04-30 19:31:02 UTC (rev 8366)
@@ -118,8 +118,8 @@
         resources_->setLuaSupport(false);
         Loader::open(resources_.get());
 
-        // Only for development runs
-        if (PathConfig::isDevelopmentRun())
+        // Only for runs in the build directory (not installed)
+        if (PathConfig::buildDirectoryRun())
             Ogre::ResourceGroupManager::getSingleton().addResourceLocation(PathConfig::getExternalDataPathString(), "FileSystem");
 
         extResources_.reset(new XMLFile("resources.oxr"));
@@ -250,7 +250,7 @@
         // Plugin path can have many different locations...
         std::string pluginPath = specialConfig::ogrePluginsDirectory;
 #ifdef DEPENDENCY_PACKAGE_ENABLE
-        if (!PathConfig::isDevelopmentRun())
+        if (!PathConfig::buildDirectoryRun())
         {
 #  if defined(ORXONOX_PLATFORM_WINDOWS)
             pluginPath = PathConfig::getExecutablePathString();

Modified: code/trunk/src/libraries/core/PathConfig.cc
===================================================================
--- code/trunk/src/libraries/core/PathConfig.cc	2011-04-30 19:27:02 UTC (rev 8365)
+++ code/trunk/src/libraries/core/PathConfig.cc	2011-04-30 19:31:02 UTC (rev 8366)
@@ -83,7 +83,7 @@
         , externalDataPath_(*(new bf::path()))
         , configPath_(*(new bf::path()))
         , logPath_(*(new bf::path()))
-        , bDevRun_(false)
+        , bBuildDirectoryRun_(false)
     {
         //////////////////////////
         // FIND EXECUTABLE PATH //
@@ -137,7 +137,7 @@
         if (bf::exists(executablePath_ / "orxonox_dev_build.keep_me"))
         {
             COUT(1) << "Running from the build tree." << std::endl;
-            PathConfig::bDevRun_ = true;
+            PathConfig::bBuildDirectoryRun_ = true;
             modulePath_ = specialConfig::moduleDevDirectory;
         }
         else
@@ -179,7 +179,7 @@
 
     void PathConfig::setConfigurablePaths()
     {
-        if (bDevRun_)
+        if (bBuildDirectoryRun_)
         {
             dataPath_         = specialConfig::dataDevDirectory;
             configPath_       = specialConfig::configDevDirectory;

Modified: code/trunk/src/libraries/core/PathConfig.h
===================================================================
--- code/trunk/src/libraries/core/PathConfig.h	2011-04-30 19:27:02 UTC (rev 8365)
+++ code/trunk/src/libraries/core/PathConfig.h	2011-04-30 19:31:02 UTC (rev 8366)
@@ -113,7 +113,7 @@
             static std::string getModulePathString();
 
             //! Return true for runs in the build directory (not installed)
-            static bool isDevelopmentRun() { return getInstance().bDevRun_; }
+            static bool buildDirectoryRun() { return getInstance().bBuildDirectoryRun_; }
 
         private:
             PathConfig(const PathConfig&); //!< Don't use (undefined symbol)
@@ -128,7 +128,7 @@
             //! Returns a list with all modules declared by a *.module file in the module folder.
             std::vector<std::string> getModulePaths();
 
-            //! Path to the parent directory of the ones above if program was installed with relativ paths
+            //! Path to the parent directory of the ones above if program was installed with relative paths
             boost::filesystem::path& rootPath_;
             boost::filesystem::path& executablePath_;        //!< Path to the executable
             boost::filesystem::path& modulePath_;            //!< Path to the modules
@@ -137,7 +137,7 @@
             boost::filesystem::path& configPath_;            //!< Path to the config files folder
             boost::filesystem::path& logPath_;               //!< Path to the log files folder
 
-            bool                     bDevRun_;               //!< True for runs in the build directory (not installed)
+            bool                     bBuildDirectoryRun_;    //!< True for runs in the build directory (not installed)
             static PathConfig* singletonPtr_s;
     }; //tolua_export
 } //tolua_export

Modified: code/trunk/src/libraries/core/command/TclBind.cc
===================================================================
--- code/trunk/src/libraries/core/command/TclBind.cc	2011-04-30 19:27:02 UTC (rev 8365)
+++ code/trunk/src/libraries/core/command/TclBind.cc	2011-04-30 19:31:02 UTC (rev 8366)
@@ -139,10 +139,10 @@
     std::string TclBind::getTclLibraryPath()
     {
 #ifdef DEPENDENCY_PACKAGE_ENABLE
-        if (PathConfig::isDevelopmentRun())
+        if (PathConfig::buildDirectoryRun())
             return (std::string(specialConfig::dependencyLibraryDirectory) + "/tcl");
         else
-            return (PathConfig::getRootPathString() + "lib/tcl");
+            return (PathConfig::getRootPathString() + specialConfig::defaultLibraryPath + "/tcl");
 #else
         return "";
 #endif

Modified: code/trunk/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinder.cc	2011-04-30 19:27:02 UTC (rev 8365)
+++ code/trunk/src/libraries/core/input/KeyBinder.cc	2011-04-30 19:31:02 UTC (rev 8366)
@@ -252,10 +252,10 @@
     {
         COUT(3) << "KeyBinder: Loading key bindings..." << std::endl;
 
-        this->configFile_ = new ConfigFile(this->filename_, !PathConfig::isDevelopmentRun());
+        this->configFile_ = new ConfigFile(this->filename_, !PathConfig::buildDirectoryRun());
         this->configFile_->load();
 
-        if (PathConfig::isDevelopmentRun())
+        if (PathConfig::buildDirectoryRun())
         {
             // Dev users should have combined key bindings files
             std::string defaultFilepath(PathConfig::getDataPathString() + ConfigFile::DEFAULT_CONFIG_FOLDER + '/' + this->filename_);
@@ -286,7 +286,7 @@
         {
             addButtonToCommand(binding, it->second);
             std::string str = binding;
-            if (PathConfig::isDevelopmentRun() && binding.empty())
+            if (PathConfig::buildDirectoryRun() && binding.empty())
                 str = "NoBinding";
             it->second->setBinding(this->configFile_, this->fallbackConfigFile_, binding, bTemporary);
             return true;

Modified: code/trunk/src/libraries/tools/ResourceLocation.cc
===================================================================
--- code/trunk/src/libraries/tools/ResourceLocation.cc	2011-04-30 19:27:02 UTC (rev 8365)
+++ code/trunk/src/libraries/tools/ResourceLocation.cc	2011-04-30 19:31:02 UTC (rev 8366)
@@ -75,7 +75,7 @@
         bf::path path;
         if (bf::exists(PathConfig::getDataPath() / this->getPath()))
             path = PathConfig::getDataPath() / this->getPath();
-        else if (PathConfig::isDevelopmentRun() && bf::exists(PathConfig::getExternalDataPath() / this->getPath()))
+        else if (PathConfig::buildDirectoryRun() && bf::exists(PathConfig::getExternalDataPath() / this->getPath()))
             path = PathConfig::getExternalDataPath() / this->getPath();
         else
         {




More information about the Orxonox-commit mailing list