Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2008, 6:01:13 PM (15 years ago)
Author:
landauf
Message:

Merged objecthierarchy2 into presentation branch

Couln't merge 2 lines in Gamestate.cc and a whole block of code in GSDedicated.cc (it seems like oli implemented in both branches something like a network-tick-limiter but with different approaches)

Not yet tested in network mode and with bots
The SpaceShips movement is also not yet fully adopted to the new physics (see Engine class)

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/overlays/hud/HUDBar.h

    r2087 r2485  
    7171        void clearColours();
    7272
    73         void setRightToLeft(bool r2l) { this->right2Left_ = r2l; this->valueChanged(); }
    74         bool getRightToLeft() const   { return this->right2Left_; }
     73        inline void setRightToLeft(bool r2l)
     74        {
     75            if (r2l != this->right2Left_)
     76            {
     77                this->right2Left_ = r2l;
     78                this->valueChanged();
     79            }
     80        }
     81        inline bool getRightToLeft() const
     82            { return this->right2Left_; }
    7583
    76         void setValue(float value)    { this->value_ = clamp(value, 0.0f, 1.0f); this->valueChanged(); }
    77         float getValue() const        { return this->value_; }
     84        inline void setValue(float value)
     85        {
     86            float temp = clamp(value, 0.0f, 1.0f);
     87            if (temp != this->value_)
     88            {
     89                this->value_ = temp;
     90                this->valueChanged();
     91            }
     92        }
     93        inline float getValue() const
     94            { return this->value_; }
    7895
    79         void setAutoColour(bool val)  { this->autoColour_ = val; this->valueChanged(); }
    80         bool getAutoColour() const    { return this->autoColour_; }
     96        inline void setAutoColour(bool val)
     97        {
     98            if (val != this->autoColour_)
     99            {
     100                this->autoColour_ = val;
     101                this->valueChanged();
     102
     103                if (!val)
     104                    this->currentColour_ = ColourValue::White;
     105            }
     106        }
     107        inline bool getAutoColour() const
     108            { return this->autoColour_; }
     109
     110        void setBarTexture(const std::string& texture);
     111        const std::string& getBarTexture() const;
     112
     113        inline const ColourValue& getCurrentBarColour() const
     114            { return this->currentColour_; }
    81115
    82116    protected:
     
    90124        bool autoColour_;                   //!< whether bar changes colour automatically
    91125        float value_;                       //!< progress of bar
     126        ColourValue currentColour_;
    92127
    93128        Ogre::PanelOverlayElement* bar_;
Note: See TracChangeset for help on using the changeset viewer.