Changeset 10624 for code/trunk/src/orxonox/overlays
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/orxonox/overlays/InGameConsole.cc
r9667 r10624 45 45 #include "util/Math.h" 46 46 #include "util/DisplayStringConversions.h" 47 #include "util/ScopedSingletonManager.h"48 47 #include "util/output/MemoryWriter.h" 49 48 #include "util/output/OutputManager.h" 50 49 #include "core/CoreIncludes.h" 51 50 #include "core/config/ConfigValueIncludes.h" 52 #include "core/command/ConsoleCommand.h" 51 #include "core/command/ConsoleCommandIncludes.h" 52 #include "core/singleton/ScopedSingletonIncludes.h" 53 53 #include "core/GUIManager.h" 54 54 #include "core/input/InputManager.h" … … 65 65 SetConsoleCommand("InGameConsole", "closeConsole", &InGameConsole::closeConsole); 66 66 67 ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false); 67 ManageScopedSingleton(InGameConsole, ScopeID::GRAPHICS, false); 68 69 RegisterAbstractClass(InGameConsole).inheritsFrom<WindowEventListener>().inheritsFrom<UpdateListener>(); 68 70 69 71 /** -
code/trunk/src/orxonox/overlays/InGameConsole.h
r8858 r10624 39 39 #include "core/WindowEventListener.h" 40 40 #include "core/command/Shell.h" 41 #include "core/UpdateListener.h" 41 42 42 43 namespace orxonox 43 44 { 44 class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener 45 class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener, public UpdateListener 45 46 { 46 47 friend class Singleton<InGameConsole>; … … 53 54 54 55 void preUpdate(const Clock& time); 56 void postUpdate(const Clock& time) { /*no action*/ } 55 57 56 58 static void openConsole(); -
code/trunk/src/orxonox/overlays/OrxonoxOverlay.cc
r9667 r10624 48 48 #include "core/CoreIncludes.h" 49 49 #include "core/XMLPort.h" 50 #include "core/command/ConsoleCommand .h"50 #include "core/command/ConsoleCommandIncludes.h" 51 51 52 52 #include "OverlayGroup.h" -
code/trunk/src/orxonox/overlays/OverlayGroup.cc
r9667 r10624 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 #include "core/command/ConsoleCommand .h"38 #include "core/command/ConsoleCommandIncludes.h" 39 39 #include "OrxonoxOverlay.h" 40 #include "gametypes/Gametype.h" 40 41 41 42 namespace orxonox … … 61 62 OverlayGroup::~OverlayGroup() 62 63 { 63 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)64 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 64 65 (*it)->destroy(); 65 66 this->hudElements_.clear(); … … 85 86 void OverlayGroup::setScale(const Vector2& scale) 86 87 { 87 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)88 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 88 89 (*it)->scale(scale / this->scale_); 89 90 this->scale_ = scale; … … 93 94 void OverlayGroup::setScroll(const Vector2& scroll) 94 95 { 95 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)96 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 96 97 (*it)->scroll(scroll - this->scroll_); 97 98 this->scroll_ = scroll; … … 106 107 void OverlayGroup::addElement(OrxonoxOverlay* element) 107 108 { 108 hudElements_.insert( SmartPtr<OrxonoxOverlay>(element));109 hudElements_.insert(element); 109 110 element->setOverlayGroup( this ); 110 111 if (this->owner_) … … 122 123 bool OverlayGroup::removeElement(OrxonoxOverlay* element) 123 124 { 124 if(this->hudElements_.erase( SmartPtr<OrxonoxOverlay>(element)) == 0)125 if(this->hudElements_.erase(element) == 0) 125 126 return false; 126 127 return true; … … 132 133 if (index < this->hudElements_.size()) 133 134 { 134 std::set< S martPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();135 std::set< StrongPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin(); 135 136 for (unsigned int i = 0; i != index; ++it, ++i) 136 137 ; 137 return it->get();138 return *it; 138 139 } 139 140 else … … 146 147 SUPER( OverlayGroup, changedVisibility ); 147 148 148 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)149 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 149 150 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed 150 151 } 151 152 152 //! Changes the gametype of all elements153 void OverlayGroup::changedGametype()154 {155 SUPER( OverlayGroup, changedGametype );156 157 for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)158 (*it)->setGametype(this->getGametype());159 }160 161 153 void OverlayGroup::setOwner(BaseObject* owner) 162 154 { 163 155 this->owner_ = owner; 164 156 165 for (std::set< S martPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)157 for (std::set< StrongPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 166 158 (*it)->setOwner(owner); 167 159 } -
code/trunk/src/orxonox/overlays/OverlayGroup.h
r9667 r10624 65 65 static void scrollGroup(const std::string& name, const Vector2& scroll); 66 66 67 inline const std::set< S martPtr<OrxonoxOverlay> >& getOverlays() const67 inline const std::set< StrongPtr<OrxonoxOverlay> >& getOverlays() const 68 68 { return this->hudElements_; } 69 69 70 70 virtual void changedVisibility(); 71 virtual void changedGametype();72 71 73 72 void setOwner(BaseObject* owner); … … 92 91 93 92 private: 94 std::set< S martPtr<OrxonoxOverlay> > hudElements_; //!< Contains all the OrxonoxOverlays of the this group.93 std::set< StrongPtr<OrxonoxOverlay> > hudElements_; //!< Contains all the OrxonoxOverlays of the this group. 95 94 Vector2 scale_; //!< Current scale (independent of the elements). 96 95 Vector2 scroll_; //!< Current scrolling offset.
Note: See TracChangeset
for help on using the changeset viewer.