Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 26, 2008, 4:05:31 PM (17 years ago)
Author:
rgrieder
Message:

fixed a bug with Bar loading. setValue wasn't called after setLeft2Right()

Location:
code/trunk/src/orxonox/overlays/hud
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/overlays/hud/HUDBar.cc

    r1625 r1626  
    113113    void HUDBar::setValue(float value)
    114114    {
    115         if (value == this->value_)
    116             return;
    117 
    118115        this->value_ = clamp<float>(value, 0, 1);
    119116        if (this->autoColour_ && this->textureUnitState_)
  • code/trunk/src/orxonox/overlays/hud/HUDBar.h

    r1625 r1626  
    7272
    7373        inline void setRightToLeft(bool r2l)
    74         { this->right2Left_ = r2l; }
     74        { this->right2Left_ = r2l; this->setValue(this->value_); }
    7575        inline bool getRightToLeft() const
    7676        { return this->right2Left_; }
  • code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.cc

    r1625 r1626  
    5353        {
    5454            float v = ship->getVelocity().length();
    55             float vmax = ship->getMaxSpeed();
    56             this->setValue(v/vmax);
     55            float value = v / ship->getMaxSpeed();
     56                        if (value != this->getValue())
     57                this->setValue(value);
    5758        }
    5859    }
Note: See TracChangeset for help on using the changeset viewer.