[Orxonox-commit 1197] r5918 - code/branches/core5/src/orxonox/gamestates

scheusso at orxonox.net scheusso at orxonox.net
Fri Oct 9 16:54:31 CEST 2009


Author: scheusso
Date: 2009-10-09 16:54:31 +0200 (Fri, 09 Oct 2009)
New Revision: 5918

Modified:
   code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc
   code/branches/core5/src/orxonox/gamestates/GSMainMenu.h
   code/branches/core5/src/orxonox/gamestates/GSRoot.cc
   code/branches/core5/src/orxonox/gamestates/GSRoot.h
Log:
2 new console commands (startIOConsole, printObjects)


Modified: code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc	2009-10-09 14:44:50 UTC (rev 5917)
+++ code/branches/core5/src/orxonox/gamestates/GSMainMenu.cc	2009-10-09 14:54:31 UTC (rev 5918)
@@ -56,6 +56,7 @@
 
         // create an empty Scene
         this->scene_ = new Scene(NULL);
+        this->scene_->setSyncMode( 0x0 );
         // and a Camera
         this->camera_ = this->scene_->getSceneManager()->createCamera("mainMenu/Camera");
         if (GameMode::playsSound())
@@ -89,6 +90,7 @@
         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startClient, this), "startClient"));
         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startDedicated, this), "startDedicated"));
         CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu, this), "startMainMenu"));
+        CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSMainMenu::startIOConsole, this), "startIOConsole"));
 
         KeyBinderManager::getInstance().setToDefault();
         InputManager::getInstance().enterState("mainMenu");
@@ -152,4 +154,11 @@
         Game::getInstance().popState();
         Game::getInstance().requestStates("mainmenu");
     }
+    void GSMainMenu::startIOConsole()
+    {
+        // HACK - HACK
+        Game::getInstance().popState();
+        Game::getInstance().popState();
+        Game::getInstance().requestStates("ioConsole");
+    }
 }

Modified: code/branches/core5/src/orxonox/gamestates/GSMainMenu.h
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSMainMenu.h	2009-10-09 14:44:50 UTC (rev 5917)
+++ code/branches/core5/src/orxonox/gamestates/GSMainMenu.h	2009-10-09 14:54:31 UTC (rev 5918)
@@ -46,11 +46,12 @@
         void deactivate();
         void update(const Clock& time);
 
-        void startStandalone();
-        void startServer();
-        void startClient();
-        void startDedicated();
-        void startMainMenu();
+        static void startStandalone();
+        static void startServer();
+        static void startClient();
+        static void startDedicated();
+        static void startMainMenu();
+        static void startIOConsole();
 
     private:
         InputState*       inputState_;

Modified: code/branches/core5/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSRoot.cc	2009-10-09 14:44:50 UTC (rev 5917)
+++ code/branches/core5/src/orxonox/gamestates/GSRoot.cc	2009-10-09 14:54:31 UTC (rev 5918)
@@ -40,6 +40,7 @@
 namespace orxonox
 {
     DeclareGameState(GSRoot, "root", false, false);
+    SetConsoleCommandShortcut(GSRoot, printObjects);
 
     GSRoot::GSRoot(const GameStateInfo& info)
         : GameState(info)
@@ -53,6 +54,20 @@
     {
         NetworkFunctionBase::destroyAllNetworkFunctions();
     }
+    
+    void GSRoot::printObjects()
+    {
+        unsigned int nr=0;
+        for(ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it){
+            if( dynamic_cast<Synchronisable*>(*it) )
+                COUT(0) << "object: " << it->getIdentifier()->getName() << " id: " << dynamic_cast<Synchronisable*>(*it)->getObjectID() << std::endl;
+            else
+                COUT(0) << "object: " << it->getIdentifier()->getName() << std::endl;
+            nr++;
+        }
+        COUT(0) << "currently got " << nr << " objects" << std::endl;
+    
+    }
 
     void GSRoot::activate()
     {

Modified: code/branches/core5/src/orxonox/gamestates/GSRoot.h
===================================================================
--- code/branches/core5/src/orxonox/gamestates/GSRoot.h	2009-10-09 14:44:50 UTC (rev 5917)
+++ code/branches/core5/src/orxonox/gamestates/GSRoot.h	2009-10-09 14:54:31 UTC (rev 5918)
@@ -40,6 +40,8 @@
         GSRoot(const GameStateInfo& info);
         ~GSRoot();
 
+        static void printObjects();
+
         void activate();
         void deactivate();
         void update(const Clock& time);




More information about the Orxonox-commit mailing list