Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

File:
1 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}
Note: See TracChangeset for help on using the changeset viewer.