[Orxonox-commit 7085] r11702 - code/trunk/src/modules/overlays/hud
landauf at orxonox.net
landauf at orxonox.net
Sat Jan 6 02:01:20 CET 2018
Author: landauf
Date: 2018-01-06 02:01:20 +0100 (Sat, 06 Jan 2018)
New Revision: 11702
Modified:
code/trunk/src/modules/overlays/hud/HUDPickupItem.cc
code/trunk/src/modules/overlays/hud/HUDPickupItem.h
code/trunk/src/modules/overlays/hud/HUDPickupSystem.cc
code/trunk/src/modules/overlays/hud/HUDPickupSystem.h
Log:
[HUD_HS16] removed a lot of unused stuff
Modified: code/trunk/src/modules/overlays/hud/HUDPickupItem.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDPickupItem.cc 2018-01-05 23:24:02 UTC (rev 11701)
+++ code/trunk/src/modules/overlays/hud/HUDPickupItem.cc 2018-01-06 01:01:20 UTC (rev 11702)
@@ -35,9 +35,8 @@
#include <OgrePanelOverlayElement.h>
#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Convert.h"
#include "core/class/Super.h"
+#include "util/StringUtils.h"
#include "HUDPickupItem.h"
namespace orxonox
@@ -67,11 +66,8 @@
this->background_->addChild(overlayElement_);
}
- void HUDPickupItem::hideMe(Pickupable* p, bool repaint)
+ void HUDPickupItem::hideMe()
{
- if(!repaint) return; //dont do anything, if we are not allowed to repaint because the level is terminating
- assert(overlayElement_);
- assert(this->background_);
//overlayElement_->hide();
this->background_->removeChild(overlayElement_->getName());
}
Modified: code/trunk/src/modules/overlays/hud/HUDPickupItem.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDPickupItem.h 2018-01-05 23:24:02 UTC (rev 11701)
+++ code/trunk/src/modules/overlays/hud/HUDPickupItem.h 2018-01-06 01:01:20 UTC (rev 11702)
@@ -4,36 +4,23 @@
#include "overlays/OverlaysPrereqs.h"
-#include <map>
-#include <vector>
-#include <string>
-
-#include <OgreOverlayManager.h>
-#include <OgrePanelOverlayElement.h>
-
+#include "util/OgreForwardRefs.h"
#include "overlays/OrxonoxOverlay.h"
-#include "tools/interfaces/Tickable.h"
-#include "worldentities/pawns/Pawn.h"
-#include "overlays/OverlayGroup.h"
-#include "pickup/Pickup.h"
namespace orxonox
{
- class _OverlaysExport HUDPickupItem : public OrxonoxOverlay, public Tickable
+ class _OverlaysExport HUDPickupItem : public OrxonoxOverlay
{
public:
HUDPickupItem(Context* context);
- Ogre::PanelOverlayElement* overlayElement_;
virtual ~HUDPickupItem();
void initializeMaterial(const std::string& s, float x, float y);
- void hideMe(Pickupable* p, bool repaint);
+ void hideMe();
- private:
- WeakPtr<Pawn> owner_;
- WeakPtr<Pickup> pickup_;
-
+ private:
+ Ogre::PanelOverlayElement* overlayElement_;
};
}
-#endif
\ No newline at end of file
+#endif
Modified: code/trunk/src/modules/overlays/hud/HUDPickupSystem.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDPickupSystem.cc 2018-01-05 23:24:02 UTC (rev 11701)
+++ code/trunk/src/modules/overlays/hud/HUDPickupSystem.cc 2018-01-06 01:01:20 UTC (rev 11702)
@@ -29,13 +29,15 @@
#include <vector>
#include <string>
+#include <OgreOverlayManager.h>
+#include <OgrePanelOverlayElement.h>
+
#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "util/Convert.h"
#include "core/class/Super.h"
+#include "util/StringUtils.h"
#include "HUDPickupSystem.h"
+#include "HUDPickupItem.h"
#include "pickup/Pickup.h"
-#include "HUDPickupItem.h"
#include "pickup/PickupManager.h"
namespace orxonox
@@ -67,13 +69,13 @@
{
//hide all pickup symbols in HUD and delete from local map
- for(const auto& sm_pair : picks)
+ for(HUDPickupItem* item : items_)
{
- sm_pair.second->hideMe(sm_pair.first, repaint);
+ item->hideMe();
}
- picks.clear();
- assert(picks.empty()); //picks must be empty now
+ items_.clear();
+ assert(items_.empty()); //items_ must be empty now
//add to local map and place on screen
int i = 0;
@@ -94,16 +96,10 @@
HUDPickupItem* item = new HUDPickupItem(this->getContext());
item->initializeMaterial(this->getIcon(((Pickup*)pickup)->getRepresentationName()), offsetX+i*x, offsetY);
item->setOverlayGroup(this->getOverlayGroup());
- picks[pickup] = item;
+ items_.push_back(item);
}
}
-
- void HUDPickupSystem::destroyAll()
- {
- this->background_->removeChild(overlayElement_->getName());
- }
-
std::string HUDPickupSystem::getIcon(std::string repName)
{
if(repName.find("invisible", 0)!=std::string::npos) return "Eye";
Modified: code/trunk/src/modules/overlays/hud/HUDPickupSystem.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDPickupSystem.h 2018-01-05 23:24:02 UTC (rev 11701)
+++ code/trunk/src/modules/overlays/hud/HUDPickupSystem.h 2018-01-06 01:01:20 UTC (rev 11702)
@@ -32,20 +32,10 @@
#include "overlays/OverlaysPrereqs.h"
-#include <map>
#include <vector>
-#include <string>
-
-#include <OgreOverlayManager.h>
-#include <OgrePanelOverlayElement.h>
-
+#include "util/OgreForwardRefs.h"
#include "overlays/OrxonoxOverlay.h"
-#include "worldentities/pawns/Pawn.h"
-#include "overlays/OverlayGroup.h"
-#include "pickup/Pickup.h"
-#include "pickup/PickupRepresentation.h"
-#include "HUDPickupItem.h"
namespace orxonox
{
@@ -58,20 +48,13 @@
void sizeChanged();
void sync(std::vector<Pickupable*> p, std::map<Pickupable*, uint32_t> indexes_);
- bool repaint=true; //if we shouldnt repaint, set this to false
-
private:
- void destroyAll();
std::string getIcon(std::string repName);
- std::map<Pickupable*, HUDPickupItem*> picks;
-
+ std::vector<HUDPickupItem*> items_;
Ogre::PanelOverlayElement* overlayElement_;
- WeakPtr<Pawn> owner_;
-
- std::vector<PickupRepresentation> pickupRepresentations_;
};
}
-#endif
\ No newline at end of file
+#endif
More information about the Orxonox-commit
mailing list