Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 697


Ignore:
Timestamp:
Dec 27, 2007, 5:06:55 AM (16 years ago)
Author:
landauf
Message:

put all SetConfigValue macro calls into the setConfigValues function (this is needed to allow changes of the config values at runtime)

Location:
code/branches/FICN/src/orxonox
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/core/OrxonoxClass.cc

    r695 r697  
    3838    OrxonoxClass::OrxonoxClass()
    3939    {
     40        this->setConfigValues();
     41
    4042        this->identifier_ = 0;
    4143        this->parents_ = 0;
     
    4345        this->bActive_ = true;
    4446        this->bVisible_ = true;
    45 
    46         this->setConfigValues();
    4747    }
    4848
  • code/branches/FICN/src/orxonox/objects/Fighter.cc

    r668 r697  
    4747        RegisterObject(Fighter);
    4848
    49         SetConfigValue(bInvertMouse_, false);
     49        this->setConfigValues();
    5050
    5151        this->setMouseEventCallback_ = false;
     
    104104    }
    105105
     106    void Fighter::setConfigValues()
     107    {
     108        SetConfigValue(bInvertMouse_, false);
     109    }
     110
    106111    void Fighter::setMaxSpeedValues(float maxSpeedForward, float maxSpeedRotateUpDown, float maxSpeedRotateRightLeft, float maxSpeedLoopRightLeft)
    107112    {
  • code/branches/FICN/src/orxonox/objects/Fighter.h

    r673 r697  
    1818            Fighter();
    1919            ~Fighter();
     20            void setConfigValues();
    2021            virtual void loadParams(TiXmlElement* xmlElem);
    2122            void setMaxSpeedValues(float maxSpeedForward, float maxSpeedRotateUpDown, float maxSpeedRotateRightLeft, float maxSpeedLoopRightLeft);
  • code/branches/FICN/src/orxonox/objects/Projectile.cc

    r670 r697  
    3939        RegisterObject(Projectile);
    4040
     41        this->setConfigValues();
     42
    4143        this->owner_ = owner;
    42 
    43         SetConfigValue(lifetime_, 10.0);
    44         SetConfigValue(speed_, 2000.0);
    4544
    4645        this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
     
    6463    }
    6564
     65    void Projectile::setConfigValues()
     66    {
     67        SetConfigValue(lifetime_, 10.0);
     68        SetConfigValue(speed_, 2000.0);
     69    }
     70
    6671    void Projectile::tick(float dt)
    6772    {
     
    7782                if (this->getPosition().squaredDistance(it->getPosition()) <= (radius*radius))
    7883                {
    79                     Explosion* explosion = new Explosion(this);
     84                    new Explosion(this);
    8085                    delete this;
    8186                    return;
  • code/branches/FICN/src/orxonox/objects/Projectile.h

    r673 r697  
    1414            Projectile(SpaceShip* owner = 0);
    1515            virtual ~Projectile();
     16            void setConfigValues();
    1617            void destroyObject();
    1718            virtual void tick(float dt);
  • code/branches/FICN/src/orxonox/objects/SpaceShip.cc

    r670 r697  
    4545        RegisterObject(SpaceShip);
    4646
    47         SetConfigValue(bInvertYAxis_, false);
    48         SetConfigValue(reloadTime_, 0.125);
     47        this->setConfigValues();
    4948
    5049        this->setMouseEventCallback_ = false;
     
    123122    }
    124123
     124    void SpaceShip::setConfigValues()
     125    {
     126        SetConfigValue(bInvertYAxis_, false);
     127        SetConfigValue(reloadTime_, 0.125);
     128    }
     129
    125130    void SpaceShip::loadParams(TiXmlElement* xmlElem)
    126131    {
     
    363368        if (this->bLMousePressed_ && this->timeToReload_ <= 0)
    364369        {
    365             // FIXME, unused var; try recycling of projectiles
    366             Projectile* proj = new Projectile(this);
     370            new Projectile(this);
    367371            this->timeToReload_ = this->reloadTime_;
    368372        }
  • code/branches/FICN/src/orxonox/objects/SpaceShip.h

    r673 r697  
    1818            SpaceShip();
    1919            ~SpaceShip();
     20            void setConfigValues();
    2021            virtual void loadParams(TiXmlElement* xmlElem);
    2122            virtual void tick(float dt);
Note: See TracChangeset for help on using the changeset viewer.