Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 15, 2006, 1:43:24 PM (18 years ago)
Author:
amaechler
Message:

atmospheric: void etc bugfixes

File:
1 edited

Legend:

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

    r8190 r8457  
    3030 * @param root The XML-element to load the AtmosphericEngine from
    3131 */
    32 AtmosphericEngine::AtmosphericEngine()
    33 {
    34   this->setClassID(CL_ATMOSPHERIC_ENGINE, "AtmosphericEngine");
     32AtmosphericEngine::AtmosphericEngine() {
     33    this->setClassID(CL_ATMOSPHERIC_ENGINE, "AtmosphericEngine");
    3534}
    3635
     
    4443 *  destroys a AtmosphericEngine
    4544 */
    46 AtmosphericEngine::~AtmosphericEngine()
    47 {
    48   AtmosphericEngine::singletonRef = NULL;
     45AtmosphericEngine::~AtmosphericEngine() {
     46    AtmosphericEngine::singletonRef = NULL;
    4947
    50   const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
     48    const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
    5149
    52   if (weatherEffects != NULL)
    53   {
    54       while(!weatherEffects->empty())
    55         delete weatherEffects->front();
    56   }
     50    if (weatherEffects != NULL) {
     51        while(!weatherEffects->empty())
     52            delete weatherEffects->front();
     53    }
    5754}
    5855
     
    6057 * @param root The XML-element to load the AtmosphericEngine from
    6158 */
    62 void AtmosphericEngine::loadParams(const TiXmlElement* root)
    63 {
    64   LoadParamXML(root, "WeatherEffect", this, AtmosphericEngine, loadWeatherEffect);
    65   LoadParamXML(root, "SunEffect", this, AtmosphericEngine, loadSunEffect);
     59void AtmosphericEngine::loadParams(const TiXmlElement* root) {
     60    LoadParamXML(root, "WeatherEffect", this, AtmosphericEngine, loadWeatherEffect);
     61    LoadParamXML(root, "SunEffect", this, AtmosphericEngine, loadSunEffect);
    6662}
    6763
     
    6965 * @param root The XML-element to load WeatherEffects from
    7066 */
    71 void AtmosphericEngine::loadWeatherEffect(const TiXmlElement* root)
    72 {
    73   LOAD_PARAM_START_CYCLE(root, element);
    74   {
    75     PRINTF(4)("element is: %s\n", element->Value());
    76     // Factory::fabricate(element);
     67void AtmosphericEngine::loadWeatherEffect(const TiXmlElement* root) {
     68    LOAD_PARAM_START_CYCLE(root, element);
     69    {
     70        PRINTF(4)("element is: %s\n", element->Value());
     71        // Factory::fabricate(element);
    7772
    78     BaseObject* bo = Factory::fabricate(element);
    79     if( bo == NULL)
    80       PRINTF(0)(" Could not create Element %s\n", element->Value());
    81   }
    82   LOAD_PARAM_END_CYCLE(element);
     73        BaseObject* bo = Factory::fabricate(element);
     74        if( bo == NULL)
     75            PRINTF(0)(" Could not create Element %s\n", element->Value());
     76    }
     77    LOAD_PARAM_END_CYCLE(element);
    8378}
    8479
     
    8681 * @param root The XML-element to load SunEffects from
    8782 */
    88 void AtmosphericEngine::loadSunEffect(const TiXmlElement* root)
    89 {
    90   LOAD_PARAM_START_CYCLE(root, element);
    91   {
    92     PRINTF(4)("element is: %s\n", element->Value());
    93   }
    94   LOAD_PARAM_END_CYCLE(element);
     83void AtmosphericEngine::loadSunEffect(const TiXmlElement* root) {
     84    LOAD_PARAM_START_CYCLE(root, element);
     85    {
     86        PRINTF(4)("element is: %s\n", element->Value());
     87    }
     88    LOAD_PARAM_END_CYCLE(element);
    9589}
    9690
     
    9993 * draws the effect, if needed
    10094 */
    101 void AtmosphericEngine::draw() const
    102 {
    103   const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
     95void AtmosphericEngine::draw() const {
     96    const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
    10497
    105   // draw the weather effects
    106   if (weatherEffects != NULL)
    107   {
    108     std::list<BaseObject*>::const_iterator it;
    109     for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
    110       dynamic_cast<WeatherEffect*>(*it)->draw();
    111   }
     98    // draw the weather effects
     99    if (weatherEffects != NULL) {
     100        std::list<BaseObject*>::const_iterator it;
     101        for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
     102            dynamic_cast<WeatherEffect*>(*it)->draw();
     103    }
    112104}
    113105
     
    117109 * ticks the effect if there is any time dependancy
    118110 */
    119 void AtmosphericEngine::tick(float dt)
    120 {
    121   const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
     111void AtmosphericEngine::tick(float dt) {
     112    const std::list<BaseObject*>* weatherEffects = ClassList::getList( CL_WEATHER_EFFECT);
    122113
    123   // tick the weather effects
    124   if (weatherEffects != NULL)
    125   {
    126     std::list<BaseObject*>::const_iterator it;
    127     for (it = weatherEffects->begin(); it != weatherEffects->end(); it++)
    128     {
    129 /*      printf("%s::%s \n", (*it)->getClassName(), (*it)->getName());*/
    130       dynamic_cast<WeatherEffect*>(*it)->tick(dt);
     114    // tick the weather effects
     115    if (weatherEffects != NULL) {
     116        std::list<BaseObject*>::const_iterator it;
     117        for (it = weatherEffects->begin(); it != weatherEffects->end(); it++) {
     118            /*      printf("%s::%s \n", (*it)->getClassName(), (*it)->getName());*/
     119            dynamic_cast<WeatherEffect*>(*it)->tick(dt);
     120        }
    131121    }
    132   }
    133122}
Note: See TracChangeset for help on using the changeset viewer.