Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 8, 2008, 5:46:52 AM (16 years ago)
Author:
landauf
Message:
  • several small changes in most of the HUD classes (code cleanup): removed obsolete variables, privatized all member variables, removed resizing functioncalls from tick, destroying overlayelements, added some const qualifiers.
  • moved calculation functions for RadarObject-position to Math.h and changed the phi/right/radius format to Vector2. the functions are used too by SpaceShipAI.
  • cycleNavigationFocus takes the nearest object if focus was NULL
  • BarOverlayElement works in both directions (left to right and right to left)
  • fixed bug causing SpaceShipAI to not stop shooting when losing target - this also speeds up orxonox a lot, because there are less projectiles

####################################

!! UPDATE YOUR MEDIA REPOSITORY !!

####################################
…or the BarOverlayElement will look strange

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/hud/BarOverlayElement.h

    r1505 r1564  
    3939  class _OrxonoxExport BarOverlayElement : public Ogre::PanelOverlayElement
    4040  {
     41    public:
     42      BarOverlayElement(const Ogre::String& name);
     43      virtual ~BarOverlayElement();
     44
     45      void init(Real leftRel, Real topRel, Real dimRel, Ogre::OverlayContainer* container);
     46      void resize();
     47      void setValue(float value);
     48      void setColour(int colour);
     49
     50      inline void setRightToLeft(bool r2l)
     51        { this->right2Left_ = r2l; }
     52      inline bool getRightToLeft() const
     53        { return this->right2Left_; }
     54      inline float getValue() const
     55        { return this->value_; }
     56      inline int getBarColour() const
     57        { return this->colour_; }
     58
    4159    private:
    42       bool autoColor_;                    // whether bar changes color automatically
     60      static const int RED = 0;           // predefined colours
     61      static const int YELLOW = 1;
     62      static const int GREEN = 2;
     63
     64      bool right2Left_;
     65      bool autoColour_;                   // whether bar changes colour automatically
    4366      float value_;                       // progress of bar
    44       int color_;
     67      int colour_;
    4568      int left_;
    4669      int top_;
    4770      int width_;
    4871      int height_;
    49       int windowW_, windowH_;
     72      float widthratio_;
     73      int offset_;
     74      int barwidth_;
    5075      Ogre::Real leftRel_;
    5176      Ogre::Real topRel_;
    5277      Ogre::Real dimRel_;
    53       Ogre::OverlayManager* om;           // our overlay manager
    54       Ogre::OverlayContainer* container_; // our parent container to attach to
    5578      Ogre::OverlayContainer* background_;
    5679      Ogre::String name_;
    57 
    58     public:
    59       bool left2Right;
    60       static const int RED = 0;           // predefined colors
    61       static const int YELLOW = 1;
    62       static const int GREEN = 2;
    63 
    64       BarOverlayElement(const Ogre::String& name);
    65       virtual ~BarOverlayElement();
    66       void init(Real leftRel, Real topRel, Real dimRel, Ogre::OverlayContainer* container);
    67       void resize();
    68       void setValue(float value);
    69       void setColor(int color);
    70       float getValue();
    71       int getBarColor();
    7280    };
    7381}
Note: See TracChangeset for help on using the changeset viewer.