[Orxonox-commit 179] r2854 - branches/gui/src/orxonox/gamestates

rgrieder at orxonox.net rgrieder at orxonox.net
Thu Mar 26 16:33:33 CET 2009


Author: rgrieder
Date: 2009-03-26 15:33:32 +0000 (Thu, 26 Mar 2009)
New Revision: 2854

Modified:
   branches/gui/src/orxonox/gamestates/GSGraphics.cc
   branches/gui/src/orxonox/gamestates/GSRoot.cc
Log:
small fixes with game states.

Modified: branches/gui/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSGraphics.cc	2009-03-26 14:18:08 UTC (rev 2853)
+++ branches/gui/src/orxonox/gamestates/GSGraphics.cc	2009-03-26 15:33:32 UTC (rev 2854)
@@ -142,6 +142,13 @@
     */
     void GSGraphics::update(const Clock& time)
     {
+        if (this->getActivity().topState)
+        {
+            // This state can not 'survive' on its own.
+            // Load a user interface therefore
+            Game::getInstance().requestState("mainMenu");
+        }
+
         uint64_t timeBeforeTick = time.getRealMicroseconds();
 
         this->inputManager_->update(time);        // tick console

Modified: branches/gui/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSRoot.cc	2009-03-26 14:18:08 UTC (rev 2853)
+++ branches/gui/src/orxonox/gamestates/GSRoot.cc	2009-03-26 15:33:32 UTC (rev 2854)
@@ -99,7 +99,7 @@
         }
         if (CommandLine::getValue("client").getBool())
         {
-            Game::getInstance().requestStates("graphics, standalone, level");
+            Game::getInstance().requestStates("graphics, client, level");
             loadLevel = true;
         }
         if (CommandLine::getValue("dedicated").getBool())
@@ -108,19 +108,11 @@
             loadLevel = true;
         }
         
-        // Determine where to start
-        if (!loadLevel)
+        // Determine where to start otherwise
+        if (!loadLevel && !CommandLine::getValue("console").getBool())
         {
-            if (CommandLine::getValue("console").getBool())
-            {
-                // Start the game in the console without 3D graphics
-                Game::getInstance().requestState("ioConsole");
-            }
-            else
-            {
-                // Start in GUI mode
-                Game::getInstance().requestStates("graphics, mainMenu");
-            }
+            // Also load graphics
+            Game::getInstance().requestState("graphics");
         }
     }
 




More information about the Orxonox-commit mailing list