Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 10, 2016, 1:54:11 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v2 into cpp11_v3

Location:
code/branches/cpp11_v3
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/orxonox/overlays/GUISheet.h

    r9667 r11054  
    4444        ~GUISheet();
    4545
    46         void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     46        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    4747
    4848        void show();
  • code/branches/cpp11_v3/src/orxonox/overlays/InGameConsole.cc

    r10624 r11054  
    7575        : shell_(new Shell("InGameConsole", true))
    7676        , 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)
    8484    {
    8585        RegisterObject(InGameConsole);
     
    130130                    if (this->consoleOverlayTextAreas_[i])
    131131                        Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayTextAreas_[i]);
    132                     this->consoleOverlayTextAreas_[i] = 0;
     132                    this->consoleOverlayTextAreas_[i] = nullptr;
    133133                }
    134134
     
    140140        {
    141141            delete[] this->consoleOverlayTextAreas_;
    142             this->consoleOverlayTextAreas_ = 0;
     142            this->consoleOverlayTextAreas_ = nullptr;
    143143        }
    144144
     
    175175            else
    176176            {
    177                 inputState_->setMouseHandler(0);
    178                 inputState_->setJoyStickHandler(0);
     177                inputState_->setMouseHandler(nullptr);
     178                inputState_->setJoyStickHandler(nullptr);
    179179            }
    180180        }
  • code/branches/cpp11_v3/src/orxonox/overlays/InGameConsole.h

    r10624 r11054  
    5353        void setConfigValues();
    5454
    55         void preUpdate(const Clock& time);
    56         void postUpdate(const Clock& time) { /*no action*/ }
     55        virtual void preUpdate(const Clock& time) override;
     56        virtual void postUpdate(const Clock& time) override { /*no action*/ }
    5757
    5858        static void openConsole();
     
    6565        void deactivate();
    6666
    67         void linesChanged();
    68         void lineAdded();
    69         void inputChanged();
    70         void cursorChanged();
    71         void executed();
    72         void 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;
    7373
    7474        void shiftLines();
     
    7777        void print(const std::string& text, Shell::LineType type, int index, bool alwaysShift = false);
    7878
    79         void windowResized(unsigned int newWidth, unsigned int newHeight);
     79        virtual void windowResized(unsigned int newWidth, unsigned int newHeight) override;
    8080
    8181        // config value related
  • code/branches/cpp11_v3/src/orxonox/overlays/OrxonoxOverlay.cc

    r11052 r11054  
    7070        RegisterObject(OrxonoxOverlay);
    7171
    72         this->owner_ = 0;
    73         this->group_ = 0;
     72        this->owner_ = nullptr;
     73        this->group_ = nullptr;
    7474
    7575        if (!GameMode::showsGraphics())
  • code/branches/cpp11_v3/src/orxonox/overlays/OrxonoxOverlay.h

    r11052 r11054  
    9090        virtual ~OrxonoxOverlay();
    9191
    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;
    9595
    9696        //! Shows the overlay with an detour to BaseObject::visibility_
     
    167167        void setBackgroundColour(ColourValue colour);
    168168
    169         virtual void changedVisibility();
     169        virtual void changedVisibility() override;
    170170
    171171        inline void setOwner(BaseObject* owner)
     
    207207
    208208    private:
    209         void windowResized(unsigned int newWidth, unsigned int newHeight);
     209        virtual void windowResized(unsigned int newWidth, unsigned int newHeight) override;
    210210
    211211        static unsigned int hudOverlayCounter_s;   //!< Static counter for hud elements
  • code/branches/cpp11_v3/src/orxonox/overlays/OverlayGroup.cc

    r11052 r11054  
    5151        {
    5252            ArgumentCompletionList names;
    53             for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
     53            for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>().begin(); it; ++it)
    5454                names.push_back(ArgumentCompletionListElement(it->getName(), getLowercase(it->getName())));
    5555            return names;
     
    6969        RegisterObject(OverlayGroup);
    7070
    71         this->owner_ = 0;
     71        this->owner_ = nullptr;
    7272
    7373        setScale(Vector2(1.0, 1.0));
     
    7777    OverlayGroup::~OverlayGroup()
    7878    {
    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();
    8181        this->hudElements_.clear();
    8282    }
     
    101101    void OverlayGroup::setScale(const Vector2& scale)
    102102    {
    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_);
    105105        this->scale_ = scale;
    106106    }
     
    109109    void OverlayGroup::setScroll(const Vector2& scroll)
    110110    {
    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_);
    113113        this->scroll_ = scroll;
    114114    }
     
    148148        if (index < this->hudElements_.size())
    149149        {
    150             std::set< StrongPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin();
     150            std::set<StrongPtr<OrxonoxOverlay>>::const_iterator it = hudElements_.begin();
    151151            for (unsigned int i = 0; i != index; ++it, ++i)
    152152                ;
     
    154154        }
    155155        else
    156             return 0;
     156            return nullptr;
    157157    }
    158158
     
    162162        SUPER( OverlayGroup, changedVisibility );
    163163
    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 changed
     164        for (OrxonoxOverlay* hudElement : hudElements_)
     165            hudElement->changedVisibility(); //inform all Child Overlays that our visibility has changed
    166166    }
    167167
     
    170170        this->owner_ = owner;
    171171
    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);
    174174    }
    175175
     
    185185    /*static*/ void OverlayGroup::toggleVisibility(const std::string& name)
    186186    {
    187         for (ObjectList<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()));
    191191        }
    192192    }
     
    200200    /*static*/ void OverlayGroup::show(const std::string& name)
    201201    {
    202         for (ObjectList<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)
    205205            {
    206                 if((*it)->isVisible())
    207                     (*it)->changedVisibility();
     206                if(group->isVisible())
     207                    group->changedVisibility();
    208208                else
    209                     (*it)->setVisible(!((*it)->isVisible()));
     209                    group->setVisible(!(group->isVisible()));
    210210            }
    211211        }
     
    223223    /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale)
    224224    {
    225         for (ObjectList<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));
    229229        }
    230230    }
     
    241241    /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll)
    242242    {
    243         for (ObjectList<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);
    247247        }
    248248    }
  • code/branches/cpp11_v3/src/orxonox/overlays/OverlayGroup.h

    r10624 r11054  
    5858        ~OverlayGroup();
    5959
    60         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     60        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6161
    6262        static void toggleVisibility(const std::string& name);
     
    6565        static void scrollGroup(const std::string& name, const Vector2& scroll);
    6666
    67         inline const std::set< StrongPtr<OrxonoxOverlay> >& getOverlays() const
     67        inline const std::set<StrongPtr<OrxonoxOverlay>>& getOverlays() const
    6868            { return this->hudElements_; }
    6969
    70         virtual void changedVisibility();
     70        virtual void changedVisibility() override;
    7171
    7272        void setOwner(BaseObject* owner);
     
    9191
    9292    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.
    9494        Vector2 scale_;                            //!< Current scale (independent of the elements).
    9595        Vector2 scroll_;                           //!< Current scrolling offset.
Note: See TracChangeset for help on using the changeset viewer.