Changeset 11071 for code/trunk/src/orxonox/overlays
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/overlays/GUISheet.h
r9667 r11071 44 44 ~GUISheet(); 45 45 46 v oid XMLPort(Element& xmlelement, XMLPort::Mode mode);46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 47 47 48 48 void show(); -
code/trunk/src/orxonox/overlays/InGameConsole.cc
r10624 r11071 75 75 : shell_(new Shell("InGameConsole", true)) 76 76 , bShowCursor_(false) 77 , consoleOverlay_( 0)78 , consoleOverlayContainer_( 0)79 , consoleOverlayNoise_( 0)80 , consoleOverlayCursor_( 0)81 , consoleOverlayBorder_( 0)82 , consoleOverlayTextAreas_( 0)83 , inputState_( 0)77 , consoleOverlay_(nullptr) 78 , consoleOverlayContainer_(nullptr) 79 , consoleOverlayNoise_(nullptr) 80 , consoleOverlayCursor_(nullptr) 81 , consoleOverlayBorder_(nullptr) 82 , consoleOverlayTextAreas_(nullptr) 83 , inputState_(nullptr) 84 84 { 85 85 RegisterObject(InGameConsole); … … 130 130 if (this->consoleOverlayTextAreas_[i]) 131 131 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayTextAreas_[i]); 132 this->consoleOverlayTextAreas_[i] = 0;132 this->consoleOverlayTextAreas_[i] = nullptr; 133 133 } 134 134 … … 140 140 { 141 141 delete[] this->consoleOverlayTextAreas_; 142 this->consoleOverlayTextAreas_ = 0;142 this->consoleOverlayTextAreas_ = nullptr; 143 143 } 144 144 … … 175 175 else 176 176 { 177 inputState_->setMouseHandler( 0);178 inputState_->setJoyStickHandler( 0);177 inputState_->setMouseHandler(nullptr); 178 inputState_->setJoyStickHandler(nullptr); 179 179 } 180 180 } … … 292 292 293 293 for (int i = LINES - 1; i > max; --i) 294 this->print("", Shell:: DebugOutput, i, true);294 this->print("", Shell::LineType::DebugOutput, i, true); 295 295 296 296 for (int i = max; i >= 1; --i) … … 318 318 { 319 319 if (LINES > 0) 320 this->print(this->shell_->getInput(), Shell:: Input, 0);320 this->print(this->shell_->getInput(), Shell::LineType::Input, 0); 321 321 322 322 if (this->shell_->getInput().empty()) … … 342 342 void InGameConsole::executed() 343 343 { 344 this->shell_->addOutput(this->shell_->getInput(), Shell:: Command);344 this->shell_->addOutput(this->shell_->getInput(), Shell::LineType::Command); 345 345 } 346 346 … … 562 562 switch (type) 563 563 { 564 case Shell:: Message:565 case Shell:: DebugOutput: colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;566 567 case Shell:: UserError: colourTop = ColourValue(0.9f, 0.0f, 0.0f); break;568 case Shell:: UserWarning: colourTop = ColourValue(0.9f, 0.5f, 0.0f); break;569 case Shell:: UserStatus: colourTop = ColourValue(0.0f, 0.9f, 0.0f); break;570 case Shell:: UserInfo: colourTop = ColourValue(0.0f, 0.8f, 0.8f); break;571 572 case Shell:: InternalError: colourTop = ColourValue(0.5f, 0.0f, 0.0f); break;573 case Shell:: InternalWarning: colourTop = ColourValue(0.5f, 0.2f, 0.0f); break;574 case Shell:: InternalStatus: colourTop = ColourValue(0.0f, 0.5f, 0.0f); break;575 case Shell:: InternalInfo: colourTop = ColourValue(0.0f, 0.4f, 0.4f); break;576 577 case Shell:: Verbose: colourTop = ColourValue(0.3f, 0.3f, 0.9f); break;578 case Shell:: VerboseMore: colourTop = ColourValue(0.2f, 0.2f, 0.7f); break;579 case Shell:: VerboseUltra: colourTop = ColourValue(0.1f, 0.1f, 0.5f); break;580 581 case Shell:: Command: colourTop = ColourValue(0.8f, 0.2f, 0.8f); break;582 case Shell:: Hint: colourTop = ColourValue(0.4f, 0.0f, 0.4f); break;583 case Shell:: Input: colourTop = ColourValue(0.9f, 0.9f, 0.9f); break;584 585 default: colourTop = ColourValue(0.5f, 0.5f, 0.5f); break;564 case Shell::LineType::Message: 565 case Shell::LineType::DebugOutput: colourTop = ColourValue(0.9f, 0.9f, 0.9f); break; 566 567 case Shell::LineType::UserError: colourTop = ColourValue(0.9f, 0.0f, 0.0f); break; 568 case Shell::LineType::UserWarning: colourTop = ColourValue(0.9f, 0.5f, 0.0f); break; 569 case Shell::LineType::UserStatus: colourTop = ColourValue(0.0f, 0.9f, 0.0f); break; 570 case Shell::LineType::UserInfo: colourTop = ColourValue(0.0f, 0.8f, 0.8f); break; 571 572 case Shell::LineType::InternalError: colourTop = ColourValue(0.5f, 0.0f, 0.0f); break; 573 case Shell::LineType::InternalWarning: colourTop = ColourValue(0.5f, 0.2f, 0.0f); break; 574 case Shell::LineType::InternalStatus: colourTop = ColourValue(0.0f, 0.5f, 0.0f); break; 575 case Shell::LineType::InternalInfo: colourTop = ColourValue(0.0f, 0.4f, 0.4f); break; 576 577 case Shell::LineType::Verbose: colourTop = ColourValue(0.3f, 0.3f, 0.9f); break; 578 case Shell::LineType::VerboseMore: colourTop = ColourValue(0.2f, 0.2f, 0.7f); break; 579 case Shell::LineType::VerboseUltra: colourTop = ColourValue(0.1f, 0.1f, 0.5f); break; 580 581 case Shell::LineType::Command: colourTop = ColourValue(0.8f, 0.2f, 0.8f); break; 582 case Shell::LineType::Hint: colourTop = ColourValue(0.4f, 0.0f, 0.4f); break; 583 case Shell::LineType::Input: colourTop = ColourValue(0.9f, 0.9f, 0.9f); break; 584 585 default: colourTop = ColourValue(0.5f, 0.5f, 0.5f); break; 586 586 } 587 587 -
code/trunk/src/orxonox/overlays/InGameConsole.h
r10624 r11071 53 53 void setConfigValues(); 54 54 55 v oid preUpdate(const Clock& time);56 v oid postUpdate(const Clock& time){ /*no action*/ }55 virtual void preUpdate(const Clock& time) override; 56 virtual void postUpdate(const Clock& time) override { /*no action*/ } 57 57 58 58 static void openConsole(); … … 65 65 void deactivate(); 66 66 67 v oid linesChanged();68 v oid lineAdded();69 v oid inputChanged();70 v oid cursorChanged();71 v oid executed();72 v oid exit();67 virtual void linesChanged() override; 68 virtual void lineAdded() override; 69 virtual void inputChanged() override; 70 virtual void cursorChanged() override; 71 virtual void executed() override; 72 virtual void exit() override; 73 73 74 74 void shiftLines(); … … 77 77 void print(const std::string& text, Shell::LineType type, int index, bool alwaysShift = false); 78 78 79 v oid windowResized(unsigned int newWidth, unsigned int newHeight);79 virtual void windowResized(unsigned int newWidth, unsigned int newHeight) override; 80 80 81 81 // config value related -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r11052 r11071 70 70 RegisterObject(OrxonoxOverlay); 71 71 72 this->owner_ = 0;73 this->group_ = 0;72 this->owner_ = nullptr; 73 this->group_ = nullptr; 74 74 75 75 if (!GameMode::showsGraphics()) … … 94 94 this->angle_ = Degree(0.0); 95 95 this->bCorrectAspect_ = false; 96 this->rotState_ = Horizontal;96 this->rotState_ = RotationState::Horizontal; 97 97 this->angleChanged(); // updates all other values as well 98 98 … … 259 259 { 260 260 tempAspect = 1.0f / this->windowAspectRatio_; 261 rotState_ = Vertical;261 rotState_ = RotationState::Vertical; 262 262 } 263 263 else if (angle > 179 || angle < 1) 264 264 { 265 265 tempAspect = this->windowAspectRatio_; 266 rotState_ = Horizontal;266 rotState_ = RotationState::Horizontal; 267 267 } 268 268 else 269 269 { 270 270 tempAspect = 1.0f; 271 rotState_ = Inbetween;271 rotState_ = RotationState::Inbetween; 272 272 } 273 273 -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.h
r11052 r11071 79 79 and in between is everything else. 80 80 */ 81 enum RotationState81 enum class RotationState 82 82 { 83 83 Horizontal, … … 90 90 virtual ~OrxonoxOverlay(); 91 91 92 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;93 94 virtual void changedName() ;92 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 93 94 virtual void changedName() override; 95 95 96 96 //! Shows the overlay with an detour to BaseObject::visibility_ … … 167 167 void setBackgroundColour(ColourValue colour); 168 168 169 virtual void changedVisibility() ;169 virtual void changedVisibility() override; 170 170 171 171 inline void setOwner(BaseObject* owner) … … 186 186 virtual void changedOverlayGroup() 187 187 { this->changedVisibility(); } 188 v irtual void setZOrder(unsigned short order);188 void setZOrder(unsigned short order); 189 189 190 190 protected: … … 207 207 208 208 private: 209 v oid windowResized(unsigned int newWidth, unsigned int newHeight);209 virtual void windowResized(unsigned int newWidth, unsigned int newHeight) override; 210 210 211 211 static unsigned int hudOverlayCounter_s; //!< Static counter for hud elements -
code/trunk/src/orxonox/overlays/OverlayGroup.cc
r11052 r11071 51 51 { 52 52 ArgumentCompletionList names; 53 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)54 names.push_back(ArgumentCompletionListElement( it->getName(), getLowercase(it->getName())));53 for (OverlayGroup* overlayGroup : ObjectList<OverlayGroup>()) 54 names.push_back(ArgumentCompletionListElement(overlayGroup->getName(), getLowercase(overlayGroup->getName()))); 55 55 return names; 56 56 } … … 69 69 RegisterObject(OverlayGroup); 70 70 71 this->owner_ = 0;71 this->owner_ = nullptr; 72 72 73 73 setScale(Vector2(1.0, 1.0)); … … 77 77 OverlayGroup::~OverlayGroup() 78 78 { 79 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)80 (*it)->destroy();79 for (OrxonoxOverlay* hudElement : hudElements_) 80 hudElement->destroy(); 81 81 this->hudElements_.clear(); 82 82 } … … 101 101 void OverlayGroup::setScale(const Vector2& scale) 102 102 { 103 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)104 (*it)->scale(scale / this->scale_);103 for (OrxonoxOverlay* hudElement : hudElements_) 104 hudElement->scale(scale / this->scale_); 105 105 this->scale_ = scale; 106 106 } … … 109 109 void OverlayGroup::setScroll(const Vector2& scroll) 110 110 { 111 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)112 (*it)->scroll(scroll - this->scroll_);111 for (OrxonoxOverlay* hudElement : hudElements_) 112 hudElement->scroll(scroll - this->scroll_); 113 113 this->scroll_ = scroll; 114 114 } … … 148 148 if (index < this->hudElements_.size()) 149 149 { 150 std::set< StrongPtr<OrxonoxOverlay>>::const_iterator it = hudElements_.begin();150 std::set<StrongPtr<OrxonoxOverlay>>::const_iterator it = hudElements_.begin(); 151 151 for (unsigned int i = 0; i != index; ++it, ++i) 152 152 ; … … 154 154 } 155 155 else 156 return 0;156 return nullptr; 157 157 } 158 158 … … 162 162 SUPER( OverlayGroup, changedVisibility ); 163 163 164 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)165 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed164 for (OrxonoxOverlay* hudElement : hudElements_) 165 hudElement->changedVisibility(); //inform all Child Overlays that our visibility has changed 166 166 } 167 167 … … 170 170 this->owner_ = owner; 171 171 172 for ( std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)173 (*it)->setOwner(owner);172 for (OrxonoxOverlay* hudElement : hudElements_) 173 hudElement->setOwner(owner); 174 174 } 175 175 … … 185 185 /*static*/ void OverlayGroup::toggleVisibility(const std::string& name) 186 186 { 187 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)188 { 189 if ( (*it)->getName() == name)190 (*it)->setVisible(!((*it)->isVisible()));187 for (OverlayGroup* group : ObjectList<OverlayGroup>()) 188 { 189 if (group->getName() == name) 190 group->setVisible(!(group->isVisible())); 191 191 } 192 192 } … … 200 200 /*static*/ void OverlayGroup::show(const std::string& name) 201 201 { 202 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)203 { 204 if ( (*it)->getName() == name)202 for (OverlayGroup* group : ObjectList<OverlayGroup>()) 203 { 204 if (group->getName() == name) 205 205 { 206 if( (*it)->isVisible())207 (*it)->changedVisibility();206 if(group->isVisible()) 207 group->changedVisibility(); 208 208 else 209 (*it)->setVisible(!((*it)->isVisible()));209 group->setVisible(!(group->isVisible())); 210 210 } 211 211 } … … 223 223 /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale) 224 224 { 225 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)226 { 227 if ( (*it)->getName() == name)228 (*it)->scale(Vector2(scale, scale));225 for (OverlayGroup* group : ObjectList<OverlayGroup>()) 226 { 227 if (group->getName() == name) 228 group->scale(Vector2(scale, scale)); 229 229 } 230 230 } … … 241 241 /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll) 242 242 { 243 for (O bjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)244 { 245 if ( (*it)->getName() == name)246 (*it)->scroll(scroll);243 for (OverlayGroup* group : ObjectList<OverlayGroup>()) 244 { 245 if (group->getName() == name) 246 group->scroll(scroll); 247 247 } 248 248 } -
code/trunk/src/orxonox/overlays/OverlayGroup.h
r10624 r11071 58 58 ~OverlayGroup(); 59 59 60 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;60 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 61 61 62 62 static void toggleVisibility(const std::string& name); … … 65 65 static void scrollGroup(const std::string& name, const Vector2& scroll); 66 66 67 inline const std::set< StrongPtr<OrxonoxOverlay>>& getOverlays() const67 inline const std::set<StrongPtr<OrxonoxOverlay>>& getOverlays() const 68 68 { return this->hudElements_; } 69 69 70 virtual void changedVisibility() ;70 virtual void changedVisibility() override; 71 71 72 72 void setOwner(BaseObject* owner); … … 91 91 92 92 private: 93 std::set< StrongPtr<OrxonoxOverlay>> hudElements_; //!< Contains all the OrxonoxOverlays of the this group.93 std::set<StrongPtr<OrxonoxOverlay>> hudElements_; //!< Contains all the OrxonoxOverlays of the this group. 94 94 Vector2 scale_; //!< Current scale (independent of the elements). 95 95 Vector2 scroll_; //!< Current scrolling offset.
Note: See TracChangeset
for help on using the changeset viewer.