[Orxonox-commit 816] r3337 - in branches/resource/src/orxonox: gui objects/quest overlays
rgrieder at orxonox.net
rgrieder at orxonox.net
Thu Jul 23 13:34:31 CEST 2009
Author: rgrieder
Date: 2009-07-23 13:34:31 +0200 (Thu, 23 Jul 2009)
New Revision: 3337
Modified:
branches/resource/src/orxonox/gui/GUIManager.cc
branches/resource/src/orxonox/gui/GUIManager.h
branches/resource/src/orxonox/objects/quest/QuestManager.cc
branches/resource/src/orxonox/overlays/GUIOverlay.cc
Log:
Removed GUIOverlay management from GUIManager: It shouldn't be the GUIManager's responsibility to handle some overlays.
Modified: branches/resource/src/orxonox/gui/GUIManager.cc
===================================================================
--- branches/resource/src/orxonox/gui/GUIManager.cc 2009-07-23 10:15:06 UTC (rev 3336)
+++ branches/resource/src/orxonox/gui/GUIManager.cc 2009-07-23 11:34:31 UTC (rev 3337)
@@ -286,41 +286,13 @@
/**
@brief
- Registers a GUIOverlay with the GUIManager so that the GUIOverlay can be accessed by it's name through the GUIManager.
- @param name
- The name of the GUI.
- @param overlay
- A pointer to the GUIOverlay of the GUI.
- @return
- Returns false if the Overlay was already present.
- */
- bool GUIManager::registerOverlay(const std::string& name, GUIOverlay* overlay)
- {
- return (this->guiOverlays_.insert(std::pair<std::string, GUIOverlay*>(name, overlay))).second;
- }
-
- /**
- @brief
- Get the GUIOverlay of the GUI with the given name.
- @param name
- The name of the GUI.
- @return
- Returns a pointer to the GUIOverlay.
- */
- GUIOverlay* GUIManager::getOverlay(const std::string& name)
- {
- return (this->guiOverlays_.find(name))->second;
- }
-
- /**
- @brief
Tells the GUIManager which SceneManager to use
@param camera
The current camera on which the GUI should be displayed on.
In fact the GUIManager needs the SceneManager and not the Camera to display the GUI.
This means the GUI is not bound to a camera but rather to the SceneManager.
- Hidding the GUI when needed can therefore not be solved by just NOT setting the current camera.
+ Hiding the GUI when needed can therefore not be resolved by just NOT setting the current camera.
*/
void GUIManager::setCamera(Ogre::Camera* camera)
{
Modified: branches/resource/src/orxonox/gui/GUIManager.h
===================================================================
--- branches/resource/src/orxonox/gui/GUIManager.h 2009-07-23 10:15:06 UTC (rev 3336)
+++ branches/resource/src/orxonox/gui/GUIManager.h 2009-07-23 11:34:31 UTC (rev 3337)
@@ -87,9 +87,6 @@
void showGUI(const std::string& name);
void executeCode(const std::string& str);
- bool registerOverlay(const std::string& name, GUIOverlay* overlay); //!< Register a GUIOverlay with the GUIManager.
- GUIOverlay* getOverlay(const std::string& name); // Get the GUIOverlay of the GUI with the given name.
-
void setCamera(Ogre::Camera* camera);
static GUIManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; } // tolua_export
@@ -122,8 +119,6 @@
State state_; //!< reflects state of the GUIManager
- std::map<std::string, GUIOverlay*> guiOverlays_;//!< A list of all GUIOverlay's.
-
static GUIManager* singletonRef_s; //!< Singleton reference to GUIManager
}; // tolua_export
Modified: branches/resource/src/orxonox/objects/quest/QuestManager.cc
===================================================================
--- branches/resource/src/orxonox/objects/quest/QuestManager.cc 2009-07-23 10:15:06 UTC (rev 3336)
+++ branches/resource/src/orxonox/objects/quest/QuestManager.cc 2009-07-23 11:34:31 UTC (rev 3337)
@@ -35,7 +35,6 @@
#include "util/Exception.h"
#include "core/CoreIncludes.h"
-#include "gui/GUIManager.h"
#include "objects/infos/PlayerInfo.h"
#include "objects/infos/PlayerInfo.h"
@@ -224,7 +223,10 @@
*/
QuestContainer* QuestManager::getQuestTree(std::string & name)
{
- GUIOverlay* gui = GUIManager::getInstance().getOverlay(name);
+ GUIOverlay* gui = NULL;
+ for (ObjectList<GUIOverlay>::iterator it = ObjectList<GUIOverlay>::begin(); it != ObjectList<GUIOverlay>::end(); ++it)
+ if (it->getGUIName() == name)
+ gui = *it;
PlayerInfo* player;
if(gui == NULL)
Modified: branches/resource/src/orxonox/overlays/GUIOverlay.cc
===================================================================
--- branches/resource/src/orxonox/overlays/GUIOverlay.cc 2009-07-23 10:15:06 UTC (rev 3336)
+++ branches/resource/src/orxonox/overlays/GUIOverlay.cc 2009-07-23 11:34:31 UTC (rev 3337)
@@ -54,8 +54,6 @@
SUPER(GUIOverlay, XMLPort, xmlElement, mode);
XMLPortParam(GUIOverlay, "guiname", setGUIName, getGUIName, xmlElement, mode);
-
- GUIManager::getInstance().registerOverlay(this->guiName_, this);
}
void GUIOverlay::changedVisibility()
More information about the Orxonox-commit
mailing list