Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7514 in orxonox.OLD for branches


Ignore:
Timestamp:
May 3, 2006, 3:02:39 PM (19 years ago)
Author:
hdavid
Message:

branches/atmospheric_engine: AtmosphericEngine ticks and draws the different weather effects

Location:
branches/atmospheric_engine/src/lib/graphics/effects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.cc

    r7509 r7514  
    3333{
    3434  this->setClassID(CL_ATMOSPHERIC_ENGINE, "AtmosphericEngine");
    35   // this->bActivated = false;
    3635}
    3736
     
    4948  AtmosphericEngine::singletonRef = NULL;
    5049
    51   this->weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
     50  const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
    5251
    53   if (this->weatherEffects != NULL)
     52  if (weatherEffects != NULL)
    5453  {
    55     //for (unsigned int i = 0; i < weatherEffects.size(); ++i)
    56       while(!this->weatherEffects->empty())
    57         delete this->weatherEffects->front();
     54      while(!weatherEffects->empty())
     55        delete weatherEffects->front();
    5856  }
    5957}
    60 
    61 
    6258
    6359/**
     
    9894
    9995/**
    100  *  initializes the graphics effect
    101  */
    102 //bool AtmosphericEngine::init()
    103 //{}
    104 
    105 
    106 
    107 /**
    10896 * draws the effect, if needed
    10997 */
    11098void AtmosphericEngine::draw() const
    111 {}
     99{
     100  const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
     101
     102  // draw the weather effects
     103  if (weatherEffects != NULL)
     104  {
     105    std::list<BaseObject*>::const_iterator it;
     106    for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
     107      dynamic_cast<WeatherEffect*>(*it)->draw();
     108  }
     109}
    112110
    113111
     
    117115 */
    118116void AtmosphericEngine::tick(float dt)
    119 {}
     117{
     118  const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
     119
     120  // tick the weather effects
     121  if (weatherEffects != NULL)
     122  {
     123    std::list<BaseObject*>::const_iterator it;
     124    for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
     125      dynamic_cast<WeatherEffect*>(*it)->tick(dt);
     126  }
     127}
  • branches/atmospheric_engine/src/lib/graphics/effects/atmospheric_engine.h

    r7503 r7514  
    2222    void loadParams(const TiXmlElement* root);
    2323
    24     // bool init();
     24    void init();
    2525
    2626    void draw() const;
     
    3737
    3838    static AtmosphericEngine*     singletonRef;       //!< Pointer to the only instance of this Class
    39     const std::list<BaseObject*>* weatherEffects;   //!< list of weather effects
    40 
    41   //protected:
    42   //  bool              bActivated;
    4339};
    4440
Note: See TracChangeset for help on using the changeset viewer.