Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 22, 2008, 12:06:55 AM (16 years ago)
Author:
rgrieder
Message:
  • added blankString to String so you can return ""; even if it's a const std::string&
  • fixed several bugs with aspect correct and margin alignment
  • added console commands for OrxonoxOverlays and OverlayGroups for rotate, scale and scroll (you can access the by name (from name=.. in xml file), e.g. "OrxonoxOverlay rotateOverlay SpeedBar 90)
  • converted everything in overlays/ to 4 spaces/tab ;)
  • removed all using namespace Ogre;
  • added background_ Panel to OrxonoxOverlay, since most of the derived classes can use that
  • should work now, but I'll have to test on a tardis box first
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/overlays/hud/HUDSpeedBar.cc

    r1614 r1615  
    3434namespace orxonox
    3535{
    36   CreateFactory(HUDSpeedBar);
     36    CreateFactory(HUDSpeedBar);
    3737
    38   using namespace Ogre;
     38    HUDSpeedBar::HUDSpeedBar()
     39    {
     40        RegisterObject(HUDSpeedBar);
    3941
    40   HUDSpeedBar::HUDSpeedBar()
    41   {
    42     RegisterObject(HUDSpeedBar);
     42    }
    4343
    44   }
    45 
    46   HUDSpeedBar::~HUDSpeedBar()
    47   {
    48     if (this->isInitialized())
     44    HUDSpeedBar::~HUDSpeedBar()
    4945    {
    5046    }
    51   }
    5247
    53   void HUDSpeedBar::tick(float dt)
    54   {
    55     SpaceShip* ship = SpaceShip::getLocalShip();
    56     if (ship)
     48    void HUDSpeedBar::tick(float dt)
    5749    {
    58       float v = ship->getVelocity().length();
    59       float vmax = ship->getMaxSpeed();
    60       this->setValue(v/vmax);
     50        SpaceShip* ship = SpaceShip::getLocalShip();
     51        if (ship)
     52        {
     53            float v = ship->getVelocity().length();
     54            float vmax = ship->getMaxSpeed();
     55            this->setValue(v/vmax);
     56        }
    6157    }
    62   }
    6358}
Note: See TracChangeset for help on using the changeset viewer.