Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 21, 2008, 12:57:10 PM (16 years ago)
Author:
FelixSchulthess
Message:

removed some warnings caused by implicit conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud3/src/orxonox/hud/BarOverlayElement.cc

    r1329 r1342  
    4242    BarOverlayElement::~BarOverlayElement(){}
    4343
    44     void BarOverlayElement::init(Real leftRel, Real topRel, Real widthRel, Real heightRel, Ogre::OverlayContainer* container){
     44    void BarOverlayElement::init(Real leftRel, Real topRel, Real dimRel, Ogre::OverlayContainer* container){
    4545        // init some values...
    4646        container_ = container;
     
    4949        color_ = 2;
    5050        autoColor_ = true;
    51         left2Right = false; // default: right to left progress
    52 
    53         // get window data...
    54         windowW_ = GraphicsEngine::getSingleton().getWindowWidth();
    55         windowH_ = GraphicsEngine::getSingleton().getWindowHeight();
     51        left2Right = false;     // default is right to left progress
    5652        leftRel_ = leftRel;
    5753        topRel_ = topRel;
    58         widthRel_ = widthRel;
    59         heightRel_ = heightRel;
    60 
    61         // cálculate absolute coordinates...
    62         left_ = leftRel_ * windowW_;
    63         top_ = topRel_ * windowH_;
    64         width_ = widthRel_ * windowW_;
    65         height_ = heightRel_ * windowH_;
    66 
     54        dimRel_ = dimRel;
     55       
    6756        // create background...
    6857        background_ = static_cast<OverlayContainer*>(om->createOverlayElement("Panel", name_+"container"));
     
    7261        background_->setMaterialName("Orxonox/BarBackground");
    7362
     63        // calculate absolute coordinates...
     64        resize();
     65
    7466        show();
    75         background_->addChild(this);
    7667        setMetricsMode(Ogre::GMM_PIXELS);
    7768        setMaterialName("Orxonox/Green");
    78         resize();
     69        background_->addChild(this);
    7970    }
    8071
     
    8273        windowW_ = GraphicsEngine::getSingleton().getWindowWidth();
    8374        windowH_ = GraphicsEngine::getSingleton().getWindowHeight();
    84         // cálculate new absolute coordinates...
    85         left_ = leftRel_ * windowW_;
    86         top_ = topRel_ * windowH_;
    87         width_ = widthRel_ * windowW_;
    88         height_ = heightRel_ * windowH_;
     75        // calculate new absolute coordinates...
     76        left_ = (int) (leftRel_ * windowW_);
     77        top_ = (int) (topRel_ * windowH_);
     78        width_ = (int) (dimRel_ * windowW_);
     79        height_ = (int) (0.1*width_);   // the texture has dimensions height:length = 1:10
    8980        // adapt background
    9081        background_->setPosition(left_, top_);
Note: See TracChangeset for help on using the changeset viewer.