Changeset 11071 for code/trunk/src/modules/overlays
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 66 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/overlays/FadeoutText.h
r9667 r11071 44 44 virtual ~FadeoutText() {} 45 45 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;47 virtual void tick(float dt) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 virtual void tick(float dt) override; 48 48 49 49 inline void setDelay(float delay) … … 58 58 59 59 private: 60 virtual void changedColour() ;61 virtual void changedCaption() ;60 virtual void changedColour() override; 61 virtual void changedCaption() override; 62 62 63 63 void fadeout(); -
code/trunk/src/modules/overlays/GUIOverlay.cc
r9667 r11071 92 92 ControllableEntity* entity = orxonox_cast<ControllableEntity*>(this->getOwner()); 93 93 if (entity) 94 GUIManager::getInstance().setPlayer(name, entity->getPlayer()); //Set Player is going to be NULL, so it needs to be set in changedVisibility() as well.94 GUIManager::getInstance().setPlayer(name, entity->getPlayer()); //Set Player is going to be nullptr, so it needs to be set in changedVisibility() as well. 95 95 } 96 96 } -
code/trunk/src/modules/overlays/GUIOverlay.h
r9667 r11071 44 44 virtual ~GUIOverlay(); 45 45 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 48 void setGUIName(const std::string& name); 49 49 inline const std::string& getGUIName() const { return this->guiName_; } 50 50 51 virtual void changedVisibility() ;52 virtual void changedOwner() ;51 virtual void changedVisibility() override; 52 virtual void changedOwner() override; 53 53 54 54 private: -
code/trunk/src/modules/overlays/OverlayText.cc
r9667 r11071 32 32 #include <OgrePanelOverlayElement.h> 33 33 #include <OgreTextAreaOverlayElement.h> 34 #include <boost/static_assert.hpp>35 34 36 35 #include "util/StringUtils.h" … … 43 42 RegisterClass(OverlayText); 44 43 45 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Left == (int)OverlayText::Left);46 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Center);47 BOOST_STATIC_ASSERT((int)Ogre::TextAreaOverlayElement::Right == (int)OverlayText::Right);44 static_assert((int)Ogre::TextAreaOverlayElement::Left == (int)OverlayText::Alignment::Left, "check enum"); 45 static_assert((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Alignment::Center, "check enum"); 46 static_assert((int)Ogre::TextAreaOverlayElement::Right == (int)OverlayText::Alignment::Right, "check enum"); 48 47 49 48 OverlayText::OverlayText(Context* context) … … 86 85 { 87 86 if (alignment == "right") 88 this->setAlignment(OverlayText:: Right);87 this->setAlignment(OverlayText::Alignment::Right); 89 88 else if (alignment == "center") 90 this->setAlignment(OverlayText:: Center);89 this->setAlignment(OverlayText::Alignment::Center); 91 90 else // "left" and default 92 this->setAlignment(OverlayText:: Left);91 this->setAlignment(OverlayText::Alignment::Left); 93 92 } 94 93 … … 112 111 void OverlayText::sizeChanged() 113 112 { 114 if (this->rotState_ == Horizontal)113 if (this->rotState_ == RotationState::Horizontal) 115 114 this->overlay_->setScale(size_.y * sizeCorrection_.y, size_.y * sizeCorrection_.y); 116 else if (this->rotState_ == Vertical)115 else if (this->rotState_ == RotationState::Vertical) 117 116 this->overlay_->setScale(size_.y / (sizeCorrection_.y * sizeCorrection_.y), size_.y * sizeCorrection_.y); 118 117 else -
code/trunk/src/modules/overlays/OverlayText.h
r9667 r11071 42 42 { 43 43 public: 44 enum Alignment44 enum class Alignment 45 45 { 46 46 Left, … … 52 52 virtual ~OverlayText(); 53 53 54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 55 55 56 56 void setCaption(const std::string& caption); … … 76 76 77 77 protected: 78 virtual void sizeChanged() ;78 virtual void sizeChanged() override; 79 79 virtual void changedColour() {} 80 80 virtual void changedCaption() {} -
code/trunk/src/modules/overlays/debugging/DebugFPSText.h
r9667 r11071 43 43 virtual ~DebugFPSText(); 44 44 45 virtual void tick(float dt) ;45 virtual void tick(float dt) override; 46 46 }; 47 47 } -
code/trunk/src/modules/overlays/debugging/DebugPositionText.cc
r9943 r11071 52 52 SUPER(DebugPositionText, tick, dt); 53 53 54 ObjectList<NewHumanController>::iterator it = ObjectList<NewHumanController> ::begin();54 ObjectList<NewHumanController>::iterator it = ObjectList<NewHumanController>().begin(); 55 55 if (it && it->getControllableEntity() ) 56 56 { -
code/trunk/src/modules/overlays/debugging/DebugPositionText.h
r9943 r11071 43 43 virtual ~DebugPositionText(); 44 44 45 virtual void tick(float dt) ;45 virtual void tick(float dt) override; 46 46 }; 47 47 } -
code/trunk/src/modules/overlays/debugging/DebugRTRText.h
r9667 r11071 43 43 virtual ~DebugRTRText(); 44 44 45 virtual void tick(float dt) ;45 virtual void tick(float dt) override; 46 46 }; 47 47 } -
code/trunk/src/modules/overlays/hud/AnnounceMessage.cc
r9667 r11071 40 40 RegisterObject(AnnounceMessage); 41 41 42 this->owner_ = 0;42 this->owner_ = nullptr; 43 43 44 44 this->setDelay(3.0f); -
code/trunk/src/modules/overlays/hud/AnnounceMessage.h
r9667 r11071 43 43 virtual ~AnnounceMessage() {} 44 44 45 virtual void changedOwner() ;45 virtual void changedOwner() override; 46 46 47 v oid announcemessage(const GametypeInfo* gtinfo, const std::string& message);47 virtual void announcemessage(const GametypeInfo* gtinfo, const std::string& message) override; 48 48 49 49 private: -
code/trunk/src/modules/overlays/hud/ChatOverlay.cc
r9667 r11071 58 58 ChatOverlay::~ChatOverlay() 59 59 { 60 for ( std::set<Timer*>::iterator it = this->timers_.begin(); it != this->timers_.end(); ++it)61 delete (*it);60 for (Timer* timer : this->timers_) 61 delete timer; 62 62 } 63 63 … … 92 92 this->text_->setCaption(""); 93 93 94 for ( std::list<Ogre::DisplayString>::iterator it = this->messages_.begin(); it != this->messages_.end(); ++it)94 for (const Ogre::DisplayString& message : this->messages_) 95 95 { 96 this->text_->setCaption(this->text_->getCaption() + "\n" + (*it));96 this->text_->setCaption(this->text_->getCaption() + "\n" + message); 97 97 } 98 98 } -
code/trunk/src/modules/overlays/hud/ChatOverlay.h
r9667 r11071 49 49 50 50 protected: 51 virtual void incomingChat(const std::string& message, const std::string& name) ;51 virtual void incomingChat(const std::string& message, const std::string& name) override; 52 52 53 53 std::list<Ogre::DisplayString> messages_; -
code/trunk/src/modules/overlays/hud/CountDown.cc
r9943 r11071 71 71 RegisterObject(CountDown); 72 72 73 this->owner_ = 0;73 this->owner_ = nullptr; 74 74 this->hasStopped_ = false; 75 75 } -
code/trunk/src/modules/overlays/hud/CountDown.h
r9943 r11071 44 44 virtual ~CountDown(); 45 45 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;47 virtual void changedOwner() ;48 virtual void tick(float dt) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 virtual void changedOwner() override; 48 virtual void tick(float dt) override; 49 49 50 50 inline void setCounter(float value) -
code/trunk/src/modules/overlays/hud/DeathMessage.cc
r9667 r11071 40 40 RegisterObject(DeathMessage); 41 41 42 this->owner_ = 0;42 this->owner_ = nullptr; 43 43 44 44 this->setDelay(2.0f); -
code/trunk/src/modules/overlays/hud/DeathMessage.h
r9667 r11071 43 43 virtual ~DeathMessage() {} 44 44 45 virtual void changedOwner() ;45 virtual void changedOwner() override; 46 46 47 v oid deathmessage(const GametypeInfo* gtinfo, const std::string& message);47 virtual void deathmessage(const GametypeInfo* gtinfo, const std::string& message) override; 48 48 49 49 private: -
code/trunk/src/modules/overlays/hud/GametypeFadingMessage.cc
r9667 r11071 40 40 RegisterObject(GametypeFadingMessage); 41 41 42 this->owner_ = 0;42 this->owner_ = nullptr; 43 43 this->setDelay(2.0f); 44 44 this->setFadeouttime(0.5f); -
code/trunk/src/modules/overlays/hud/GametypeFadingMessage.h
r9667 r11071 43 43 virtual ~GametypeFadingMessage(); 44 44 45 virtual void changedOwner() ;45 virtual void changedOwner() override; 46 46 47 v oid fadingmessage(const GametypeInfo* gtinfo, const std::string& message);47 virtual void fadingmessage(const GametypeInfo* gtinfo, const std::string& message) override; 48 48 49 49 private: -
code/trunk/src/modules/overlays/hud/GametypeStaticMessage.cc
r9667 r11071 42 42 { 43 43 RegisterObject(GametypeStaticMessage); 44 this->owner_ = 0;44 this->owner_ = nullptr; 45 45 } 46 46 -
code/trunk/src/modules/overlays/hud/GametypeStaticMessage.h
r9667 r11071 46 46 virtual ~GametypeStaticMessage(); 47 47 48 virtual void changedOwner() ;48 virtual void changedOwner() override; 49 49 50 v oid staticmessage(const GametypeInfo* gtinfo, const std::string& message, const ColourValue& colour);50 virtual void staticmessage(const GametypeInfo* gtinfo, const std::string& message, const ColourValue& colour) override; 51 51 52 52 private: -
code/trunk/src/modules/overlays/hud/HUDBar.cc
r11052 r11071 219 219 return barColours_[index]; 220 220 else 221 return 0;221 return nullptr; 222 222 } 223 223 -
code/trunk/src/modules/overlays/hud/HUDBar.h
r11052 r11071 52 52 virtual ~BarColour() { } 53 53 54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 55 55 56 56 void setColour(const ColourValue& colour) { this->colour_ = colour; } … … 72 72 virtual ~HUDBar(); 73 73 74 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;74 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 75 75 76 76 void clearColours(); -
code/trunk/src/modules/overlays/hud/HUDBoostBar.cc
r11052 r11071 42 42 RegisterObject(HUDBoostBar); 43 43 44 this->owner_ = 0;44 this->owner_ = nullptr; 45 45 this->flashInterval_ = 0.25f; 46 46 this->flashDt_ = 0.0f; -
code/trunk/src/modules/overlays/hud/HUDBoostBar.h
r9667 r11071 43 43 virtual ~HUDBoostBar(); 44 44 45 virtual void tick(float dt) ;46 virtual void changedOwner() ;45 virtual void tick(float dt) override; 46 virtual void changedOwner() override; 47 47 48 48 private: -
code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.cc
r9667 r11071 30 30 31 31 #include "core/config/ConfigValueIncludes.h" 32 #include "core/CoreIncludes.h" 32 33 #include "worldentities/pawns/Pawn.h" 33 34 … … 41 42 42 43 this->setConfigValues(); 43 this->owner_ = 0;44 this->owner_ = nullptr; 44 45 } 45 46 … … 62 63 void HUDEnemyHealthBar::updateTarget() 63 64 { 64 Pawn* pawn = NULL;65 Pawn* pawn = nullptr; 65 66 if (this->owner_ && this->useEnemyBar_) 66 67 { … … 73 74 // Don't show the HealthBar if the pawn is invisible 74 75 if (pawn && !pawn->isVisible()) 75 pawn = NULL;76 pawn = nullptr; 76 77 } 77 78 // Set the pawn as owner of the HealthBar 78 79 this->setHealthBarOwner(pawn); 79 this->setVisible(pawn != NULL);80 this->setVisible(pawn != nullptr); 80 81 } 81 82 -
code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h
r9667 r11071 41 41 42 42 void setConfigValues(); 43 virtual void tick(float dt) ;43 virtual void tick(float dt) override; 44 44 45 v oid changedOwner();45 virtual void changedOwner() override; 46 46 47 47 private: -
code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.cc
r11052 r11071 41 41 42 42 this->setConfigValues(); 43 this->owner_ = NULL;43 this->owner_ = nullptr; 44 44 } 45 45 … … 62 62 void HUDEnemyShieldBar::updateTarget() 63 63 { 64 Pawn* pawn = NULL;64 Pawn* pawn = nullptr; 65 65 if (this->owner_ && this->useEnemyBar_) 66 66 { … … 73 73 // Don't show the EnemyShieldBar if the pawn is invisible 74 74 if (pawn && !pawn->isVisible()) 75 pawn = NULL;75 pawn = nullptr; 76 76 } 77 77 // Set the pawn as owner of the EnemyShieldBar 78 78 this->setShieldBarOwner(pawn); 79 this->setVisible(pawn != NULL);79 this->setVisible(pawn != nullptr); 80 80 } 81 81 -
code/trunk/src/modules/overlays/hud/HUDEnemyShieldBar.h
r11052 r11071 45 45 46 46 void setConfigValues(); 47 virtual void tick(float dt) ;47 virtual void tick(float dt) override; 48 48 49 v oid changedOwner();49 virtual void changedOwner() override; 50 50 51 51 private: -
code/trunk/src/modules/overlays/hud/HUDHealthBar.cc
r11052 r11071 43 43 RegisterObject(HUDHealthBar); 44 44 45 this->owner_ = 0;45 this->owner_ = nullptr; 46 46 this->bUseBarColour_ = false; 47 47 this->textOffset_ = Vector2(0.0f, 0.0f); … … 66 66 { 67 67 this->textoverlay_->destroy(); 68 this->textoverlay_ = NULL;68 this->textoverlay_ = nullptr; 69 69 } 70 70 } -
code/trunk/src/modules/overlays/hud/HUDHealthBar.h
r11052 r11071 45 45 virtual ~HUDHealthBar(); 46 46 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void tick(float dt) ;49 virtual void changedOwner() ;50 virtual void changedOverlayGroup() ;51 virtual void changedVisibility() ;52 virtual void changedName() ;47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 48 virtual void tick(float dt) override; 49 virtual void changedOwner() override; 50 virtual void changedOverlayGroup() override; 51 virtual void changedVisibility() override; 52 virtual void changedName() override; 53 53 54 54 inline void setTextFont(const std::string& font) … … 112 112 { this->owner_ = owner; } 113 113 protected: 114 virtual void positionChanged() ;115 virtual void sizeChanged() ;114 virtual void positionChanged() override; 115 virtual void sizeChanged() override; 116 116 private: 117 v irtual void positionText();117 void positionText(); 118 118 WeakPtr<Pawn> owner_; 119 119 StrongPtr<OverlayText> textoverlay_; -
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
r11023 r11071 53 53 #include "core/config/ConfigValueIncludes.h" 54 54 #include "tools/TextureGenerator.h" 55 // #include <boost/bind/bind_template.hpp>56 55 57 56 … … 69 68 RegisterClass ( HUDNavigation ); 70 69 71 HUDNavigation* HUDNavigation::localHUD_s = 0;70 HUDNavigation* HUDNavigation::localHUD_s = nullptr; 72 71 73 72 HUDNavigation::HUDNavigation(Context* context) : … … 132 131 } 133 132 this->fontName_ = font; 134 for ( std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)135 { 136 if ( it->second.text_ != NULL)137 it->second.text_->setFontName(this->fontName_);133 for (const auto& mapEntry : this->activeObjectList_) 134 { 135 if (mapEntry.second.text_ != nullptr) 136 mapEntry.second.text_->setFontName(this->fontName_); 138 137 } 139 138 } … … 152 151 } 153 152 this->textSize_ = size; 154 for ( std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it!=this->activeObjectList_.end(); ++it)155 { 156 if ( it->second.text_)157 it->second.text_->setCharHeight(size);153 for (const auto& mapEntry : this->activeObjectList_) 154 { 155 if (mapEntry.second.text_) 156 mapEntry.second.text_->setCharHeight(size); 158 157 } 159 158 } … … 183 182 184 183 Camera* cam = CameraManager::getInstance().getActiveCamera(); 185 if (cam == NULL)184 if (cam == nullptr) 186 185 return; 187 186 const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix(); 188 187 189 for (std:: list<std::pair<RadarViewable*, unsigned int> >::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)190 listIt->second = (int)((listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);188 for (std::pair<RadarViewable*, unsigned int>& pair : this->sortedObjectList_) 189 pair.second = (int)((pair.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f); 191 190 192 191 this->sortedObjectList_.sort(compareDistance); … … 209 208 bool nextHasToBeSelected = false; 210 209 211 for (std::list<std::pair<RadarViewable*, unsigned int> 210 for (std::list<std::pair<RadarViewable*, unsigned int>>::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++markerCount, ++listIt) 212 211 { 213 212 … … 469 468 if(!it->second.selected_ 470 469 || it->first->getRVVelocity().squaredLength() == 0 471 || pawn == NULL470 || pawn == nullptr 472 471 /* TODO : improve getTeam in such a way that it works 473 * || humanPawn == NULL472 * || humanPawn == nullptr 474 473 * || pawn->getTeam() == humanPawn->getTeam()*/) 475 474 { … … 525 524 float yScale = this->getActualSize().y; 526 525 527 for ( std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)528 { 529 if ( it->second.health_ != NULL)530 it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);531 if ( it->second.healthLevel_ != NULL)532 it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);533 if ( it->second.panel_ != NULL)534 it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);535 if ( it->second.text_ != NULL)536 it->second.text_->setCharHeight(this->textSize_ * yScale);537 if ( it->second.target_ != NULL)538 it->second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);526 for (const auto& mapEntry : this->activeObjectList_) 527 { 528 if (mapEntry.second.health_ != nullptr) 529 mapEntry.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale); 530 if (mapEntry.second.healthLevel_ != nullptr) 531 mapEntry.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale); 532 if (mapEntry.second.panel_ != nullptr) 533 mapEntry.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale); 534 if (mapEntry.second.text_ != nullptr) 535 mapEntry.second.text_->setCharHeight(this->textSize_ * yScale); 536 if (mapEntry.second.target_ != nullptr) 537 mapEntry.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale); 539 538 } 540 539 } … … 546 545 547 546 if (this->activeObjectList_.size() >= this->markerLimit_) 548 if (object == NULL)547 if (object == nullptr) 549 548 return; 550 549 … … 634 633 } 635 634 636 for (std::list<std::pair<RadarViewable*, unsigned int> 635 for (std::list<std::pair<RadarViewable*, unsigned int>>::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt) 637 636 { 638 637 if ((listIt->first) == viewable) … … 664 663 { 665 664 const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects(); 666 for ( std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it)667 { 668 if (! (*it)->isHumanShip_)669 this->addObject( *it);665 for (RadarViewable* respawnObject : respawnObjects) 666 { 667 if (!respawnObject->isHumanShip_) 668 this->addObject(respawnObject); 670 669 } 671 670 } -
code/trunk/src/modules/overlays/hud/HUDNavigation.h
r10291 r11071 51 51 void setConfigValues(); 52 52 53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;54 virtual void tick(float dt) ;53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 54 virtual void tick(float dt) override; 55 55 56 56 // RadarListener interface 57 virtual void addObject(RadarViewable* object) ;58 virtual void removeObject(RadarViewable* viewable) ;59 virtual void objectChanged(RadarViewable* viewable) ;57 virtual void addObject(RadarViewable* object) override; 58 virtual void removeObject(RadarViewable* viewable) override; 59 virtual void objectChanged(RadarViewable* viewable) override; 60 60 61 virtual void changedOwner() ;62 virtual void sizeChanged() ;63 virtual void angleChanged() { }64 virtual void positionChanged() { }65 virtual void radarTick(float dt) {}61 virtual void changedOwner() override; 62 virtual void sizeChanged() override; 63 virtual void angleChanged() override { } 64 virtual void positionChanged() override { } 65 virtual void radarTick(float dt) override {} 66 66 67 inline float getRadarSensitivity() const67 virtual inline float getRadarSensitivity() const override 68 68 { return 1.0f; } 69 69 … … 141 141 142 142 std::map<RadarViewable*, ObjectInfo> activeObjectList_; 143 std::list<std::pair<RadarViewable*, unsigned int> 143 std::list<std::pair<RadarViewable*, unsigned int>> sortedObjectList_; 144 144 145 145 float healthMarkerSize_; -
code/trunk/src/modules/overlays/hud/HUDRadar.cc
r11052 r11071 65 65 this->setMaximumDotSize3D(0.07f); 66 66 67 this->shapeMaterials_[RadarViewable:: Dot] = "RadarDot.png";68 this->shapeMaterials_[RadarViewable:: Triangle] = "RadarTriangle.png";69 this->shapeMaterials_[RadarViewable::S quare] = "RadarSquare.png";70 this->owner_ = 0;67 this->shapeMaterials_[RadarViewable::Shape::Dot] = "RadarDot.png"; 68 this->shapeMaterials_[RadarViewable::Shape::Triangle] = "RadarTriangle.png"; 69 this->shapeMaterials_[RadarViewable::Shape::Square] = "RadarSquare.png"; 70 this->owner_ = nullptr; 71 71 72 72 this->map3DFront_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() … … 92 92 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_); 93 93 94 for (std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it = this->radarObjects_.begin(); 95 it != this->radarObjects_.end(); ++it) 96 { 97 Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second); 94 for (const auto& mapEntry : this->radarObjects_) 95 { 96 Ogre::OverlayManager::getSingleton().destroyOverlayElement(mapEntry.second); 98 97 } 99 98 } … … 166 165 { 167 166 const std::set<RadarViewable*>& objectSet = this->getCreator()->getScene()->getRadar()->getRadarObjects(); 168 std::set<RadarViewable*>::const_iterator it; 169 for( it=objectSet.begin(); it!=objectSet.end(); ++it ) 170 this->addObject(*it); 167 for( RadarViewable* viewable : objectSet ) 168 this->addObject(viewable); 171 169 this->radarTick(0); 172 170 } … … 184 182 185 183 // update the distances for all objects 186 std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it;187 188 184 189 185 if(RadarMode_) … … 202 198 } 203 199 204 for( it = this->radarObjects_.begin(); it != this->radarObjects_.end(); ++it)200 for( const auto& mapEntry : this->radarObjects_ ) 205 201 { 206 202 // Make sure the object really is a WorldEntity 207 const WorldEntity* wePointer = it->first->getWorldEntity();203 const WorldEntity* wePointer = mapEntry.first->getWorldEntity(); 208 204 if( !wePointer ) 209 205 { … … 211 207 assert(0); 212 208 } 213 bool isFocus = ( it->first == focusObject);209 bool isFocus = (mapEntry.first == focusObject); 214 210 // set size to fit distance... 215 211 float distance = (wePointer->getWorldPosition() - this->owner_->getPosition()).length(); … … 218 214 float size; 219 215 if(RadarMode_) 220 size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();216 size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * mapEntry.first->getRadarObjectScale(); 221 217 else 222 size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();223 it->second->setDimensions(size, size);218 size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * mapEntry.first->getRadarObjectScale(); 219 mapEntry.second->setDimensions(size, size); 224 220 225 221 // calc position on radar... … … 235 231 int zOrder = determineMap3DZOrder(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), detectionLimit_); 236 232 if(overXZPlain == false /*&& (it->second->getZOrder() > 100 * this->overlay_->getZOrder())*/) // it appears that zOrder of attached Overlayelements is 100 times the zOrder of the Overlay 237 it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder);233 mapEntry.second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder); 238 234 if(overXZPlain == true /*&& (it->second->getZOrder() <= 100 * this->overlay_->getZOrder())*/) 239 it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder);235 mapEntry.second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder); 240 236 } 241 237 else … … 243 239 244 240 coord *= math::pi / 3.5f; // small adjustment to make it fit the texture 245 it->second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);241 mapEntry.second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f); 246 242 247 243 if( distance < detectionLimit_ || detectionLimit_ < 0 ) 248 it->second->show();244 mapEntry.second->show(); 249 245 else 250 it->second->hide();246 mapEntry.second->hide(); 251 247 252 248 // if this object is in focus, then set the focus marker … … 256 252 this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f); 257 253 if(RadarMode_) 258 this->marker_->_notifyZOrder( it->second->getZOrder() -1);254 this->marker_->_notifyZOrder(mapEntry.second->getZOrder() -1); 259 255 this->marker_->show(); 260 256 } -
code/trunk/src/modules/overlays/hud/HUDRadar.h
r9945 r11071 50 50 virtual ~HUDRadar(); 51 51 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;53 virtual void changedOwner() ;52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 53 virtual void changedOwner() override; 54 54 void setConfigValues(); 55 55 … … 80 80 void set3DMaterialBack(std::string material3DBack) { this->material3DBack_ = material3DBack; } 81 81 82 float getRadarSensitivity() const{ return this->sensitivity_; }82 virtual float getRadarSensitivity() const override { return this->sensitivity_; } 83 83 // used also by RadarListener interface! 84 84 void setRadarSensitivity(float sensitivity) { this->sensitivity_ = sensitivity; } … … 89 89 90 90 // RadarListener interface 91 virtual void addObject(RadarViewable* viewable) ;92 virtual void removeObject(RadarViewable* viewable) ;93 virtual void objectChanged( RadarViewable* rv ) ;94 v oid radarTick(float dt);91 virtual void addObject(RadarViewable* viewable) override; 92 virtual void removeObject(RadarViewable* viewable) override; 93 virtual void objectChanged( RadarViewable* rv ) override; 94 virtual void radarTick(float dt) override; 95 95 bool showObject( RadarViewable* rv ); //!< Do not display an object on radar, if showObject(.) is false. 96 96 -
code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.cc
r11052 r11071 40 40 RegisterObject(HUDRocketFuelBar); 41 41 42 this->owner_ = NULL;42 this->owner_ = nullptr; 43 43 } 44 44 -
code/trunk/src/modules/overlays/hud/HUDRocketFuelBar.h
r11052 r11071 49 49 virtual ~HUDRocketFuelBar(); 50 50 51 virtual void tick(float dt) ;52 virtual void changedOwner() ;51 virtual void tick(float dt) override; 52 virtual void changedOwner() override; 53 53 54 54 private: -
code/trunk/src/modules/overlays/hud/HUDShieldBar.cc
r11052 r11071 41 41 RegisterObject(HUDShieldBar); 42 42 43 this->owner_ = NULL;43 this->owner_ = nullptr; 44 44 } 45 45 -
code/trunk/src/modules/overlays/hud/HUDShieldBar.h
r11052 r11071 49 49 virtual ~HUDShieldBar(); 50 50 51 virtual void tick(float dt) ;52 virtual void changedOwner() ;51 virtual void tick(float dt) override; 52 virtual void changedOwner() override; 53 53 54 54 inline void setShieldBarOwner(Pawn* owner) -
code/trunk/src/modules/overlays/hud/HUDSpeedBar.cc
r9667 r11071 43 43 RegisterObject(HUDSpeedBar); 44 44 45 this->owner_ = 0;45 this->owner_ = nullptr; 46 46 } 47 47 -
code/trunk/src/modules/overlays/hud/HUDSpeedBar.h
r9667 r11071 44 44 virtual ~HUDSpeedBar(); 45 45 46 virtual void tick(float dt) ;47 virtual void changedOwner() ;46 virtual void tick(float dt) override; 47 virtual void changedOwner() override; 48 48 49 49 private: -
code/trunk/src/modules/overlays/hud/HUDTimer.cc
r9667 r11071 42 42 RegisterObject(HUDTimer); 43 43 44 this->owner_ = 0;44 this->owner_ = nullptr; 45 45 } 46 46 -
code/trunk/src/modules/overlays/hud/HUDTimer.h
r9667 r11071 43 43 virtual ~HUDTimer(); 44 44 45 virtual void tick(float dt) ;45 virtual void tick(float dt) override; 46 46 47 virtual void changedOwner() ;47 virtual void changedOwner() override; 48 48 49 49 private: -
code/trunk/src/modules/overlays/hud/HUDWeapon.cc
r11052 r11071 44 44 weaponModeHUDActualSize_ = Vector2(0.0f,0.0f); 45 45 46 weaponModes_ = NULL;47 46 weaponIndex_ = 0; 48 47 hudWeaponModes_.clear(); … … 77 76 if (!weapon_) 78 77 { 79 // TODO: destroy this HUD id the Weapon does no more exist. (Wehen the weak pointer is NULL)78 // TODO: destroy this HUD id the Weapon does no more exist. (Wehen the weak pointer is null) 80 79 } 81 80 } … … 115 114 bool visible = this->isVisible(); 116 115 117 for ( std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)118 { 119 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed120 (*it)->setVisible(visible);116 for (HUDWeaponMode* hudWeaponMode : hudWeaponModes_) 117 { 118 hudWeaponMode->changedVisibility(); //inform all Child Overlays that our visibility has changed 119 hudWeaponMode->setVisible(visible); 121 120 } 122 121 } … … 141 140 void HUDWeapon::updateWeaponModeList() 142 141 { 143 if (owner_ == NULL || weapon_ == NULL)142 if (owner_ == nullptr || weapon_ == nullptr) 144 143 { 145 144 return; … … 147 146 148 147 destroyHUDChilds(); 149 150 weaponModes_ = weapon_->getAllWeaponmodes();151 148 152 149 updateSize(); … … 157 154 void HUDWeapon::createHUDChilds() 158 155 { 159 if (weapon Modes_ == NULL)156 if (weapon_ == nullptr) 160 157 { 161 158 return; … … 164 161 int positionIndex = 0; 165 162 166 for ( std::multimap<unsigned int, WeaponMode*>::iterator it = weaponModes_->begin(); it != weaponModes_->end(); ++it)163 for (const auto& mapEntry : weapon_->getAllWeaponmodes()) 167 164 { 168 165 HUDWeaponMode* hudWeaponMode = new HUDWeaponMode(this->getContext()); … … 170 167 hudWeaponMode->setOverlayGroup(this->getOverlayGroup()); 171 168 hudWeaponMode->setVisible(this->isVisible()); 172 hudWeaponMode->setWeaponMode( it->second);169 hudWeaponMode->setWeaponMode(mapEntry.second); 173 170 hudWeaponMode->setWeaponIndex(this->weaponIndex_); 174 171 hudWeaponMode->setAspectCorrection(false); … … 185 182 int positionIndex = 0; 186 183 187 for ( std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)188 { 189 (*it)->setPositionOffset(this->positionOffset_);190 (*it)->setWeaponModeIndex(positionIndex);191 (*it)->setWeaponIndex(this->weaponIndex_);192 (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);184 for (HUDWeaponMode* hudWeaponMode : hudWeaponModes_) 185 { 186 hudWeaponMode->setPositionOffset(this->positionOffset_); 187 hudWeaponMode->setWeaponModeIndex(positionIndex); 188 hudWeaponMode->setWeaponIndex(this->weaponIndex_); 189 hudWeaponMode->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_); 193 190 194 191 ++ positionIndex; … … 198 195 void HUDWeapon::destroyHUDChilds() 199 196 { 200 for ( std::vector<WeakPtr<HUDWeaponMode> >::iterator it = hudWeaponModes_.begin(); it != hudWeaponModes_.end(); ++it)201 { 202 (*it)->destroy();197 for (HUDWeaponMode* hudWeaponMode : hudWeaponModes_) 198 { 199 hudWeaponMode->destroy(); 203 200 } 204 201 … … 208 205 void HUDWeapon::updateSize() 209 206 { 210 if (weapon Modes_ != NULL)211 { 212 this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weapon Modes_->size()));207 if (weapon_ != nullptr) 208 { 209 this->setSize(Vector2(weaponModeHUDActualSize_.x,weaponModeHUDActualSize_.y*weapon_->getAllWeaponmodes().size())); 213 210 updatePosition(); 214 211 } … … 217 214 void HUDWeapon::updatePosition() 218 215 { 219 if (weapon Modes_ != NULL)216 if (weapon_ != nullptr) 220 217 { 221 218 this->setPosition(Vector2(weaponModeHUDActualSize_.x*weaponIndex_,0.0f) + this->positionOffset_); -
code/trunk/src/modules/overlays/hud/HUDWeapon.h
r11052 r11071 55 55 virtual ~HUDWeapon(); 56 56 57 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;58 virtual void tick(float dt) ;59 virtual void changedOwner() ;60 virtual void changedOverlayGroup() ;61 virtual void changedVisibility() ;62 virtual void changedName() ;63 virtual void positionChanged() ;64 virtual void sizeChanged() ;57 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 58 virtual void tick(float dt) override; 59 virtual void changedOwner() override; 60 virtual void changedOverlayGroup() override; 61 virtual void changedVisibility() override; 62 virtual void changedName() override; 63 virtual void positionChanged() override; 64 virtual void sizeChanged() override; 65 65 66 v irtual void setWeapon(Weapon* weapon);66 void setWeapon(Weapon* weapon); 67 67 68 68 inline void setWeaponModeHUDActualSize(Vector2 vector) … … 84 84 85 85 private: 86 v irtual void createHUDChilds();87 v irtual void positionHUDChilds();88 v irtual void destroyHUDChilds();89 v irtual void updateWeaponModeList();90 v irtual void updateSize();91 v irtual void updatePosition();86 void createHUDChilds(); 87 void positionHUDChilds(); 88 void destroyHUDChilds(); 89 void updateWeaponModeList(); 90 void updateSize(); 91 void updatePosition(); 92 92 93 93 WeakPtr<Pawn> owner_; 94 94 WeakPtr<Weapon> weapon_; 95 95 96 std::multimap<unsigned int, WeaponMode*>* weaponModes_; 97 std::vector<WeakPtr<HUDWeaponMode> > hudWeaponModes_; 96 std::vector<WeakPtr<HUDWeaponMode>> hudWeaponModes_; 98 97 99 98 Ogre::PanelOverlayElement* overlayElement_; -
code/trunk/src/modules/overlays/hud/HUDWeaponMode.cc
r11052 r11071 29 29 #include "HUDWeaponMode.h" 30 30 31 #include "util/Convert.h" 32 #include "util/StringUtils.h" 31 33 #include "core/CoreIncludes.h" 32 #include "core/XMLPort.h"33 #include "util/Convert.h"34 34 #include "core/class/Super.h" 35 35 … … 76 76 textOverlayLeft_->setPickPoint(Vector2(0.0f,0.0f)); 77 77 textOverlayLeft_->setVisible(true); 78 textOverlayLeft_->setAlignment(OverlayText:: Center);78 textOverlayLeft_->setAlignment(OverlayText::Alignment::Center); 79 79 textOverlayLeft_->setTextSize(0.02f); 80 80 textOverlayLeft_->setColour(ColourValue(0.21,0.70,0.21,1.0)); … … 87 87 textOverlayRight_->setPickPoint(Vector2(0.0f,0.0f)); 88 88 textOverlayRight_->setVisible(true); 89 textOverlayRight_->setAlignment(OverlayText:: Center);89 textOverlayRight_->setAlignment(OverlayText::Alignment::Center); 90 90 textOverlayRight_->setTextSize(0.02f); 91 91 textOverlayRight_->setColour(ColourValue(0.21,0.70,0.21,1.0)); … … 107 107 } 108 108 109 void HUDWeaponMode::XMLPort(Element& xmlelement, XMLPort::Mode mode)110 {111 SUPER(HUDWeaponMode, XMLPort, xmlelement, mode);112 }113 114 109 void HUDWeaponMode::tick(float dt) 115 110 { … … 131 126 Munition* munition = this->weaponMode_->getMunition(); 132 127 133 if (munition != NULL)134 { 135 MunitionDeployment ::Valuedeployment = munition->getMunitionDeployment();128 if (munition != nullptr) 129 { 130 MunitionDeployment deployment = munition->getMunitionDeployment(); 136 131 137 132 if (deployment == MunitionDeployment::Share) … … 242 237 Munition* munition = this->weaponMode_->getMunition(); 243 238 244 if (munition != NULL)245 { 246 MunitionDeployment ::Valuedeployment = munition->getMunitionDeployment();239 if (munition != nullptr) 240 { 241 MunitionDeployment deployment = munition->getMunitionDeployment(); 247 242 248 243 if (deployment == MunitionDeployment::Share) -
code/trunk/src/modules/overlays/hud/HUDWeaponMode.h
r11052 r11071 57 57 virtual ~HUDWeaponMode(); 58 58 59 virtual void tick(float dt); 60 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 61 virtual void changedOwner(); 62 virtual void changedOverlayGroup(); 63 virtual void changedVisibility(); 64 virtual void changedName(); 65 virtual void positionChanged(); 66 virtual void sizeChanged(); 59 virtual void tick(float dt) override; 60 virtual void changedOwner() override; 61 virtual void changedOverlayGroup() override; 62 virtual void changedVisibility() override; 63 virtual void changedName() override; 64 virtual void positionChanged() override; 65 virtual void sizeChanged() override; 67 66 68 v irtual void setWeaponMode(WeaponMode* weaponMode);67 void setWeaponMode(WeaponMode* weaponMode); 69 68 70 69 inline void setWeaponModeHUDActualSize(Vector2 vector) … … 89 88 90 89 private: 91 v irtual void updateSize();92 v irtual void updatePosition();93 v irtual void positionHUDChilds();90 void updateSize(); 91 void updatePosition(); 92 void positionHUDChilds(); 94 93 95 94 WeakPtr<Pawn> owner_; -
code/trunk/src/modules/overlays/hud/HUDWeaponSystem.cc
r11052 r11071 103 103 bool visible = this->isVisible(); 104 104 105 for ( std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)105 for (HUDWeapon* hudWeapon : hudWeapons_) 106 106 { 107 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed108 (*it)->setVisible(visible);107 hudWeapon->changedVisibility(); //inform all Child Overlays that our visibility has changed 108 hudWeapon->setVisible(visible); 109 109 } 110 110 } … … 117 117 void HUDWeaponSystem::updateWeaponList() 118 118 { 119 if (owner_ == NULL)119 if (owner_ == nullptr) 120 120 { 121 121 return; … … 126 126 destroyHUDChilds(); 127 127 128 std::vector<WeaponPack*>* weaponPacks = owner_->getAllWeaponPacks(); 128 if (owner_->getWeaponSystem()) 129 { 130 const std::vector<WeaponPack*>& weaponPacks = owner_->getWeaponSystem()->getAllWeaponPacks(); 131 for (WeaponPack* weaponPack : weaponPacks) 132 { 133 const std::vector<Weapon*>& weapons = weaponPack->getAllWeapons(); 134 for (Weapon* weapon : weapons) 135 { 136 this->weapons_.push_back(weapon); 137 } 138 } 129 139 130 for (std::vector<WeaponPack*>::const_iterator itPacks = weaponPacks->begin(); itPacks != weaponPacks->end(); ++itPacks) 131 { 132 std::vector<Weapon*>* weapons = (*itPacks)->getAllWeapons(); 133 134 for (std::vector<Weapon*>::const_iterator itWeapons = weapons->begin(); itWeapons != weapons->end(); ++itWeapons) 135 { 136 this->weapons_.push_back(*itWeapons); 137 } 140 createHUDChilds(); 141 positionHUDChilds(); 138 142 } 139 140 createHUDChilds();141 positionHUDChilds();142 143 } 143 144 … … 146 147 int positionIndex = 0; 147 148 148 for ( std::vector<WeakPtr<Weapon> >::iterator it = weapons_.begin(); it != weapons_.end(); ++it)149 for (Weapon* weapon : weapons_) 149 150 { 150 151 HUDWeapon* hudWeapon = new HUDWeapon(this->getContext()); … … 152 153 hudWeapon->setOverlayGroup(this->getOverlayGroup()); 153 154 hudWeapon->setVisible(this->isVisible()); 154 hudWeapon->setWeapon( *it);155 hudWeapon->setWeapon(weapon); 155 156 hudWeapon->setAspectCorrection(false); 156 157 hudWeapon->setPickPoint(Vector2(0.0f,0.0f)); … … 167 168 Vector2 offset = this->getPosition(); 168 169 169 for ( std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)170 for (HUDWeapon* hudWeapon : hudWeapons_) 170 171 { 171 (*it)->setPositionOffset(offset);172 (*it)->setWeaponIndex(positionIndex);173 (*it)->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_);172 hudWeapon->setPositionOffset(offset); 173 hudWeapon->setWeaponIndex(positionIndex); 174 hudWeapon->setWeaponModeHUDActualSize(this->weaponModeHUDActualSize_); 174 175 175 176 ++ positionIndex; … … 179 180 void HUDWeaponSystem::destroyHUDChilds() 180 181 { 181 for ( std::vector<WeakPtr<HUDWeapon> >::iterator it = hudWeapons_.begin(); it != hudWeapons_.end(); ++it)182 for (HUDWeapon* hudWeapon : hudWeapons_) 182 183 { 183 (*it)->destroy();184 hudWeapon->destroy(); 184 185 } 185 186 -
code/trunk/src/modules/overlays/hud/HUDWeaponSystem.h
r11052 r11071 49 49 virtual ~HUDWeaponSystem(); 50 50 51 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;52 virtual void changedOwner() ;53 virtual void changedOverlayGroup() ;54 virtual void changedVisibility() ;55 virtual void changedName() ;56 virtual void positionChanged() ;57 virtual void sizeChanged() ;51 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 52 virtual void changedOwner() override; 53 virtual void changedOverlayGroup() override; 54 virtual void changedVisibility() override; 55 virtual void changedName() override; 56 virtual void positionChanged() override; 57 virtual void sizeChanged() override; 58 58 protected: 59 59 inline void setWeaponModeHUDSize(Vector2 vector) … … 64 64 { return weaponModeHUDSize_; } 65 65 private: 66 v irtual void updateWeaponList();67 v irtual void createHUDChilds();68 v irtual void positionHUDChilds();69 v irtual void destroyHUDChilds();66 void updateWeaponList(); 67 void createHUDChilds(); 68 void positionHUDChilds(); 69 void destroyHUDChilds(); 70 70 71 71 WeakPtr<Pawn> owner_; 72 72 73 std::vector<WeakPtr<Weapon> 74 std::vector<WeakPtr<HUDWeapon> 73 std::vector<WeakPtr<Weapon>> weapons_; 74 std::vector<WeakPtr<HUDWeapon>> hudWeapons_; 75 75 76 76 Vector2 weaponModeHUDSize_; -
code/trunk/src/modules/overlays/hud/KillMessage.cc
r9667 r11071 40 40 RegisterObject(KillMessage); 41 41 42 this->owner_ = 0;42 this->owner_ = nullptr; 43 43 44 44 this->setDelay(2.0f); -
code/trunk/src/modules/overlays/hud/KillMessage.h
r9667 r11071 43 43 virtual ~KillMessage() {} 44 44 45 virtual void changedOwner() ;45 virtual void changedOwner() override; 46 46 47 v oid killmessage(const GametypeInfo* gtinfo, const std::string& message);47 virtual void killmessage(const GametypeInfo* gtinfo, const std::string& message) override; 48 48 49 49 private: -
code/trunk/src/modules/overlays/hud/LastManStandingInfos.cc
r10624 r11071 43 43 RegisterObject(LastManStandingInfos); 44 44 45 this->lms_ = 0;46 this->player_ = 0;45 this->lms_ = nullptr; 46 this->player_ = nullptr; 47 47 this->bShowLives_ = false; 48 48 this->bShowPlayers_ = false; … … 91 91 else 92 92 { 93 this->player_ = 0;94 this->lms_ = 0;93 this->player_ = nullptr; 94 this->lms_ = nullptr; 95 95 } 96 96 } -
code/trunk/src/modules/overlays/hud/LastManStandingInfos.h
r9667 r11071 43 43 virtual ~LastManStandingInfos(); 44 44 45 virtual void tick(float dt) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;47 virtual void changedOwner() ;45 virtual void tick(float dt) override; 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 virtual void changedOwner() override; 48 48 49 49 inline void setShowLives(bool value) -
code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.cc
r10624 r11071 43 43 RegisterObject(LastTeamStandingInfos); 44 44 45 this->lts_ = 0;46 this->player_ = 0;45 this->lts_ = nullptr; 46 this->player_ = nullptr; 47 47 this->bShowLives_ = false; 48 48 this->bShowTeams_ = false; … … 91 91 else 92 92 { 93 this->player_ = 0;94 this->lts_ = 0;93 this->player_ = nullptr; 94 this->lts_ = nullptr; 95 95 } 96 96 } -
code/trunk/src/modules/overlays/hud/LastTeamStandingInfos.h
r9667 r11071 43 43 virtual ~LastTeamStandingInfos(); 44 44 45 virtual void tick(float dt) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;47 virtual void changedOwner() ;45 virtual void tick(float dt) override; 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 virtual void changedOwner() override; 48 48 49 49 inline void setShowLives(bool value) -
code/trunk/src/modules/overlays/hud/PauseNotice.cc
r9667 r11071 40 40 RegisterObject(PauseNotice); 41 41 42 this->owner_ = 0;42 this->owner_ = nullptr; 43 43 } 44 44 -
code/trunk/src/modules/overlays/hud/PauseNotice.h
r9667 r11071 42 42 PauseNotice(Context* context); 43 43 44 virtual void changedOwner() ;44 virtual void changedOwner() override; 45 45 46 46 protected: 47 virtual void changedTimeFactor(float factor_new, float factor_old) ;47 virtual void changedTimeFactor(float factor_new, float factor_old) override; 48 48 49 49 private: -
code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.cc
r10624 r11071 43 43 RegisterObject(TeamBaseMatchScore); 44 44 45 this->owner_ = 0;45 this->owner_ = nullptr; 46 46 47 47 this->bShowBases_ = false; … … 120 120 this->owner_ = orxonox_cast<TeamBaseMatch*>(this->getOwner()->getGametype()); 121 121 else 122 this->owner_ = 0;122 this->owner_ = nullptr; 123 123 } 124 124 } -
code/trunk/src/modules/overlays/hud/TeamBaseMatchScore.h
r9667 r11071 43 43 virtual ~TeamBaseMatchScore(); 44 44 45 virtual void tick(float dt) ;46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;47 virtual void changedOwner() ;45 virtual void tick(float dt) override; 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 virtual void changedOwner() override; 48 48 49 49 inline void setShowBases(bool value) -
code/trunk/src/modules/overlays/stats/CreateLines.cc
r6502 r11071 37 37 CreateLines::CreateLines(float leftOffset, float topOffset, float width, float height) 38 38 { 39 playerNameText_ = new OverlayText( 0);39 playerNameText_ = new OverlayText(nullptr); 40 40 playerNameText_->setTextSize(0.04f); 41 41 playerNameText_->setColour(ColourValue(0.0f, 0.75f, 0.2f, 1.0f)); 42 42 playerNameText_->setPosition(Vector2(0.1f, topOffset + 0.01f)); 43 43 44 scoreText_ = new OverlayText( 0);44 scoreText_ = new OverlayText(nullptr); 45 45 scoreText_->setTextSize(0.04f); 46 46 scoreText_->setColour(ColourValue(0.0f, 0.75f, 0.2f, 1.0f)); 47 47 scoreText_->setPosition(Vector2(0.6f, topOffset + 0.01f)); 48 48 49 deathsText_ = new OverlayText( 0);49 deathsText_ = new OverlayText(nullptr); 50 50 deathsText_->setTextSize(0.04f); 51 51 deathsText_->setColour(ColourValue(0, 0.75f, 0.2f, 1.0f)); 52 52 deathsText_->setPosition(Vector2(0.8f, topOffset + 0.01f)); 53 53 54 background_ = new Stats( 0);54 background_ = new Stats(nullptr); 55 55 background_->setPosition(Vector2(leftOffset, topOffset)); 56 56 background_->setSize(Vector2(width, height)); -
code/trunk/src/modules/overlays/stats/CreateLines.h
r5980 r11071 29 29 30 30 #include "overlays/OverlaysPrereqs.h" 31 32 #include <string> 31 33 32 34 namespace orxonox -
code/trunk/src/modules/overlays/stats/Scoreboard.cc
r9667 r11071 60 60 SUPER(Scoreboard, changedVisibility); 61 61 62 for ( unsigned int i = 0; i < this->lines_.size(); ++i)63 this->lines_[i]->changedVisibility();62 for (CreateLines* line : this->lines_) 63 line->changedVisibility(); 64 64 } 65 65 … … 94 94 95 95 unsigned int index = 0; 96 for ( std::map<PlayerInfo*, Player>::const_iterator it = playerList.begin(); it != playerList.end(); ++it)96 for (const auto& mapEntry : playerList) 97 97 { 98 this->lines_[index]->setPlayerName(multi_cast<std::string>( it->first->getName()));99 this->lines_[index]->setScore(multi_cast<std::string>( it->second.frags_));100 this->lines_[index]->setDeaths(multi_cast<std::string>( it->second.killed_));98 this->lines_[index]->setPlayerName(multi_cast<std::string>(mapEntry.first->getName())); 99 this->lines_[index]->setScore(multi_cast<std::string>(mapEntry.second.frags_)); 100 this->lines_[index]->setDeaths(multi_cast<std::string>(mapEntry.second.killed_)); 101 101 index++; 102 102 } -
code/trunk/src/modules/overlays/stats/Scoreboard.h
r9667 r11071 44 44 virtual ~Scoreboard(); 45 45 46 virtual void tick(float dt) ;46 virtual void tick(float dt) override; 47 47 48 48 inline void setCreateLines(CreateLines* cl) … … 51 51 { return this->createlines_; } 52 52 53 virtual void changedVisibility() ;53 virtual void changedVisibility() override; 54 54 55 55 private: // functions -
code/trunk/src/modules/overlays/stats/Stats.cc
r9667 r11071 46 46 Stats::Stats(Context* context) 47 47 : OrxonoxOverlay(context) 48 , statsOverlayNoise_( 0)49 , statsOverlayBorder_( 0)48 , statsOverlayNoise_(nullptr) 49 , statsOverlayBorder_(nullptr) 50 50 { 51 51 RegisterObject(Stats); -
code/trunk/src/modules/overlays/stats/Stats.h
r9667 r11071 46 46 void setConfigValues(); 47 47 48 virtual void tick(float dt) ;48 virtual void tick(float dt) override; 49 49 50 50 private: // variables
Note: See TracChangeset
for help on using the changeset viewer.