[Orxonox-commit 1905] r6622 - code/branches/gamestate/src/libraries/core

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Mar 27 17:39:27 CET 2010


Author: rgrieder
Date: 2010-03-27 17:39:26 +0100 (Sat, 27 Mar 2010)
New Revision: 6622

Modified:
   code/branches/gamestate/src/libraries/core/Core.cc
   code/branches/gamestate/src/libraries/core/Core.h
Log:
Made IOConsole optional: use "--noIOConsole" or set config value Core::bStartIOConsole_ to false and it will not start.
Default behaviour is still "using the IOConsole".

Modified: code/branches/gamestate/src/libraries/core/Core.cc
===================================================================
--- code/branches/gamestate/src/libraries/core/Core.cc	2010-03-26 19:51:37 UTC (rev 6621)
+++ code/branches/gamestate/src/libraries/core/Core.cc	2010-03-27 16:39:26 UTC (rev 6622)
@@ -77,6 +77,7 @@
     Core* Core::singletonPtr_s  = 0;
 
     SetCommandLineArgument(settingsFile, "orxonox.ini").information("THE configuration file");
+    SetCommandLineSwitch(noIOConsole).information("Use this if you don't want to use the IOConsole (for instance for Lua debugging)");
 #ifdef ORXONOX_PLATFORM_WINDOWS
     SetCommandLineArgument(limitToCPU, 1).information("Limits the program to one CPU/core (1, 2, 3, etc.). Default is the first core (faster than off)");
 #endif
@@ -87,6 +88,7 @@
         // Cleanup guard for external console commands that don't belong to an Identifier
         , consoleCommandDestroyer_(CommandExecutor::destroyExternalCommands)
         , bGraphicsLoaded_(false)
+        , bStartIOConsole_(true)
     {
         // Set the hard coded fixed paths
         this->pathConfig_.reset(new PathConfig());
@@ -148,7 +150,12 @@
         this->setConfigValues();
 
         // create persistent io console
-        this->ioConsole_.reset(new IOConsole());
+        if (CommandLineParser::getValue("noIOConsole").getBool())
+        {
+            ModifyConfigValue(bStartIOConsole_, tset, false);
+        }
+        if (this->bStartIOConsole_)
+            this->ioConsole_.reset(new IOConsole());
 
         // creates the class hierarchy for all classes with factories
         Identifier::createClassHierarchy();
@@ -192,6 +199,8 @@
         SetConfigValue(bInitRandomNumberGenerator_, true)
             .description("If true, all random actions are different each time you start the game")
             .callback(this, &Core::initRandomNumberGenerator);
+        SetConfigValue(bStartIOConsole_, true)
+            .description("Set to false if you don't want to use the IOConsole (for Lua debugging for instance)");
     }
 
     //! Callback function if the language has changed.
@@ -326,7 +335,8 @@
             ScopedSingletonManager::preUpdate<ScopeID::Graphics>(time);
         }
         // Process console events and status line
-        this->ioConsole_->preUpdate(time);
+        if (this->ioConsole_ != NULL)
+            this->ioConsole_->preUpdate(time);
         // Process thread commands
         this->tclThreadManager_->preUpdate(time);
     }

Modified: code/branches/gamestate/src/libraries/core/Core.h
===================================================================
--- code/branches/gamestate/src/libraries/core/Core.h	2010-03-26 19:51:37 UTC (rev 6621)
+++ code/branches/gamestate/src/libraries/core/Core.h	2010-03-27 16:39:26 UTC (rev 6622)
@@ -96,7 +96,7 @@
             scoped_ptr<IOConsole>         ioConsole_;
             scoped_ptr<TclBind>           tclBind_;
             scoped_ptr<TclThreadManager>  tclThreadManager_;
-            scoped_ptr<Scope<ScopeID::Root> >     rootScope_;
+            scoped_ptr<Scope<ScopeID::Root> > rootScope_;
             // graphical
             scoped_ptr<GraphicsManager>   graphicsManager_;     //!< Interface to OGRE
             scoped_ptr<InputManager>      inputManager_;        //!< Interface to OIS
@@ -107,6 +107,7 @@
             int                           softDebugLevelLogFile_;      //!< The debug level for the log file (belongs to OutputHandler)
             std::string                   language_;                   //!< The language
             bool                          bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called
+            bool                          bStartIOConsole_;            //!< Set to false if you don't want to use the IOConsole
 
             static Core*                  singletonPtr_s;
     };




More information about the Orxonox-commit mailing list