Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/overlays/GUISheet.h

    r9667 r11071  
    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/trunk/src/orxonox/overlays/InGameConsole.cc

    r10624 r11071  
    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        }
     
    292292
    293293        for (int i = LINES - 1; i > max; --i)
    294             this->print("", Shell::DebugOutput, i, true);
     294            this->print("", Shell::LineType::DebugOutput, i, true);
    295295
    296296        for (int i = max; i >= 1; --i)
     
    318318    {
    319319        if (LINES > 0)
    320             this->print(this->shell_->getInput(), Shell::Input, 0);
     320            this->print(this->shell_->getInput(), Shell::LineType::Input, 0);
    321321
    322322        if (this->shell_->getInput().empty())
     
    342342    void InGameConsole::executed()
    343343    {
    344         this->shell_->addOutput(this->shell_->getInput(), Shell::Command);
     344        this->shell_->addOutput(this->shell_->getInput(), Shell::LineType::Command);
    345345    }
    346346
     
    562562        switch (type)
    563563        {
    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;
    586586        }
    587587
  • code/trunk/src/orxonox/overlays/InGameConsole.h

    r10624 r11071  
    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/trunk/src/orxonox/overlays/OrxonoxOverlay.cc

    r11052 r11071  
    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())
     
    9494        this->angle_ = Degree(0.0);
    9595        this->bCorrectAspect_ = false;
    96         this->rotState_ = Horizontal;
     96        this->rotState_ = RotationState::Horizontal;
    9797        this->angleChanged(); // updates all other values as well
    9898
     
    259259            {
    260260                tempAspect = 1.0f / this->windowAspectRatio_;
    261                 rotState_ = Vertical;
     261                rotState_ = RotationState::Vertical;
    262262            }
    263263            else if (angle > 179 || angle < 1)
    264264            {
    265265                tempAspect = this->windowAspectRatio_;
    266                 rotState_ = Horizontal;
     266                rotState_ = RotationState::Horizontal;
    267267            }
    268268            else
    269269            {
    270270                tempAspect = 1.0f;
    271                 rotState_ = Inbetween;
     271                rotState_ = RotationState::Inbetween;
    272272            }
    273273
  • code/trunk/src/orxonox/overlays/OrxonoxOverlay.h

    r11052 r11071  
    7979            and in between is everything else.
    8080        */
    81         enum RotationState
     81        enum class RotationState
    8282        {
    8383            Horizontal,
     
    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)
     
    186186        virtual void changedOverlayGroup()
    187187            { this->changedVisibility(); }
    188         virtual void setZOrder(unsigned short order);
     188        void setZOrder(unsigned short order);
    189189
    190190    protected:
     
    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/trunk/src/orxonox/overlays/OverlayGroup.cc

    r11052 r11071  
    5151        {
    5252            ArgumentCompletionList names;
    53             for (ObjectList<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())));
    5555            return names;
    5656        }
     
    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/trunk/src/orxonox/overlays/OverlayGroup.h

    r10624 r11071  
    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.