[Orxonox-commit 151] r2834 - in branches/gui/src/orxonox: . gamestates gui

bknecht at orxonox.net bknecht at orxonox.net
Mon Mar 23 16:48:24 CET 2009


Author: bknecht
Date: 2009-03-23 15:48:23 +0000 (Mon, 23 Mar 2009)
New Revision: 2834

Modified:
   branches/gui/src/orxonox/CameraManager.cc
   branches/gui/src/orxonox/gamestates/GSStandalone.cc
   branches/gui/src/orxonox/gui/GUIManager.cc
   branches/gui/src/orxonox/gui/GUIManager.h
Log:
When you change the camera, the GUI is now newly set. Also: the GUI remembers if it was hidden or not. Only problem at the moment: Input is captured for the wrong thing. Ingame the GUI captures the input.

Modified: branches/gui/src/orxonox/CameraManager.cc
===================================================================
--- branches/gui/src/orxonox/CameraManager.cc	2009-03-23 15:15:33 UTC (rev 2833)
+++ branches/gui/src/orxonox/CameraManager.cc	2009-03-23 15:48:23 UTC (rev 2834)
@@ -40,6 +40,7 @@
 #include "objects/Scene.h"
 #include "tools/Shader.h"
 #include "util/String.h"
+#include "gui/GUIManager.h"
 
 namespace orxonox
 {
@@ -140,6 +141,7 @@
         }
 
         this->viewport_->setCamera(camera);
+        GUIManager::getInstancePtr()->setCamera(camera);
 
         // reactivate all visible compositors
         {

Modified: branches/gui/src/orxonox/gamestates/GSStandalone.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSStandalone.cc	2009-03-23 15:15:33 UTC (rev 2833)
+++ branches/gui/src/orxonox/gamestates/GSStandalone.cc	2009-03-23 15:48:23 UTC (rev 2834)
@@ -57,9 +57,6 @@
         guiManager_ = GUIManager::getInstancePtr();
         // not sure if necessary
         // guiManager_->loadScene("IngameMenu");
-
-        Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
-        guiManager_->showGUI("IngameMenu", viewport->getCamera()->getSceneManager());
     }
 
     void GSStandalone::leave()
@@ -71,11 +68,11 @@
 
     void GSStandalone::ticked(const Clock& time)
     {
-        Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
+        //Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
         //COUT(0) << "** " << viewport->getCamera()->getSceneManager() << std::endl;
         //guiManager_->testFct();
         //Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport();
-        guiManager_->showGUI("IngameMenu", viewport->getCamera()->getSceneManager());
+        //guiManager_->showGUI("IngameMenu", viewport->getCamera()->getSceneManager());
 
         // tick CEGUI
         guiManager_->update(time);

Modified: branches/gui/src/orxonox/gui/GUIManager.cc
===================================================================
--- branches/gui/src/orxonox/gui/GUIManager.cc	2009-03-23 15:15:33 UTC (rev 2833)
+++ branches/gui/src/orxonox/gui/GUIManager.cc	2009-03-23 15:48:23 UTC (rev 2834)
@@ -266,6 +266,11 @@
         getInstance().scriptModule_->executeScriptGlobal("toggleGUI");
     }
 
+    void GUIManager::setCamera(Ogre::Camera* camera)
+    {
+        this->showGUI("default", camera->getSceneManager());
+    }
+
     void GUIManager::showGUI(const std::string& name, Ogre::SceneManager* sceneManager)// bool showBackground)
     {
         if (state_ != Uninitialised)

Modified: branches/gui/src/orxonox/gui/GUIManager.h
===================================================================
--- branches/gui/src/orxonox/gui/GUIManager.h	2009-03-23 15:15:33 UTC (rev 2833)
+++ branches/gui/src/orxonox/gui/GUIManager.h	2009-03-23 15:48:23 UTC (rev 2834)
@@ -82,6 +82,7 @@
 
         static void toggleGUI();
 
+        void setCamera(Ogre::Camera* camera);
         Ogre::Camera* getCamera() { return this->backgroundCamera_; }
 
         static void showGUI_s(const std::string& name, Ogre::SceneManager* sceneManager)//bool showBackground)




More information about the Orxonox-commit mailing list