Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2008, 6:01:13 PM (17 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.cc

    r2087 r2485  
    5151        RegisterObject(BarColour);
    5252
    53         setColour(ColourValue(1.0, 1.0, 1.0, 1.0));
    54         setPosition(0.0);
     53        this->setColour(ColourValue(1.0, 1.0, 1.0, 1.0));
     54        this->setPosition(0.0);
    5555    }
    5656
     
    8484        this->bar_->setMaterialName(materialname);
    8585
    86         setValue(0.4567654f);
    87         setRightToLeft(false);
    88         setAutoColour(true);
     86        this->value_ = 1.0f;  // initielize with 1.0f to trigger a change when calling setValue(0.0f) on the line below
     87        this->setValue(0.0f); // <--
     88        this->setRightToLeft(false);
     89        this->setAutoColour(true);
     90        this->currentColour_ = ColourValue::White;
    8991
    9092        this->background_->addChild(bar_);
     
    101103        SUPER(HUDBar, XMLPort, xmlElement, mode);
    102104
    103         XMLPortParam(HUDBar, "initialValue", setValue,       getValue,       xmlElement, mode);
    104         XMLPortParam(HUDBar, "rightToLeft",  setRightToLeft, getRightToLeft, xmlElement, mode);
    105         XMLPortParam(HUDBar, "autoColour",   setAutoColour,  getAutoColour,  xmlElement, mode);
     105        XMLPortParam(HUDBar, "initialvalue", setValue,       getValue,       xmlElement, mode);
     106        XMLPortParam(HUDBar, "righttoleft",  setRightToLeft, getRightToLeft, xmlElement, mode);
     107        XMLPortParam(HUDBar, "autocolour",   setAutoColour,  getAutoColour,  xmlElement, mode);
     108        XMLPortParam(HUDBar, "bartexture",   setBarTexture,  getBarTexture, xmlElement, mode);
    106109        XMLPortObject(HUDBar, BarColour, "", addColour, getColour, xmlElement, mode);
    107110    }
     
    130133                {
    131134                    this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour2);
     135                    this->currentColour_ = colour2;
    132136                }
    133137                else if (value1 < this->value_)
    134138                {
    135139                    this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour1);
     140                    this->currentColour_ = colour1;
    136141                }
    137142                else
     
    139144                    //float interpolationfactor = (this->value_ - value2) / (value1 - value2);
    140145                    float interpolationfactor = interpolateSmooth((this->value_ - value2) / (value1 - value2), 0.0f, 1.0f);
    141                     this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, colour1 * interpolationfactor + colour2 * (1 - interpolationfactor));
     146                    this->currentColour_ = colour1 * interpolationfactor + colour2 * (1 - interpolationfactor);
     147                    this->textureUnitState_->setColourOperationEx(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_CURRENT, this->currentColour_);
     148
    142149                }
    143150            }
     
    181188        this->colours_.clear();
    182189    }
     190
     191    void HUDBar::setBarTexture(const std::string& texture)
     192    {
     193        this->textureUnitState_->setTextureName(texture);
     194    }
     195
     196    const std::string& HUDBar::getBarTexture() const
     197    {
     198        return this->textureUnitState_->getTextureName();
     199    }
    183200}
Note: See TracChangeset for help on using the changeset viewer.