Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 4, 2016, 6:19:07 PM (9 years ago)
Author:
landauf
Message:

cleanup in hover module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS15/src/modules/hover/FlagHUD.cc

    r11030 r11041  
    3636#include <OgrePanelOverlayElement.h>
    3737
     38#include "util/StringUtils.h"
    3839#include "core/CoreIncludes.h"
    39 #include "core/XMLPort.h"
     40#include "Hover.h"
    4041
    4142namespace orxonox
     
    4748        RegisterObject(FlagHUD);
    4849
     50        this->hoverGame_ = NULL;
    4951        this->panel_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
    5052            .createOverlayElement("Panel", "FlagHUD_Panel_" + getUniqueNumberString()));
     
    5456        this->flagCount_ = 5;
    5557        setFlagCount(5);
     58    }
     59
     60    FlagHUD::~FlagHUD()
     61    {
     62        if (this->isInitialized())
     63        {
     64            Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->panel_);
     65        }
    5666    }
    5767
     
    7888        SUPER(FlagHUD, tick, dt);
    7989
    80             setFlagCount(this->hoverGame->getFlags());
    81        
     90        setFlagCount(this->hoverGame_->getFlags());
    8291    }
    8392
     
    8897        if (this->getOwner() && this->getOwner()->getGametype())
    8998        {
    90             this->hoverGame = orxonox_cast<Hover*>(this->getOwner()->getGametype());
     99            this->hoverGame_ = orxonox_cast<Hover*>(this->getOwner()->getGametype());
    91100        }
    92101        else
    93102        {
    94             this->hoverGame = 0;
    95         }
    96     }
    97 
    98     FlagHUD::~FlagHUD()
    99     {
    100         if (this->isInitialized())
    101         {
    102             Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->panel_);
     103            this->hoverGame_ = 0;
    103104        }
    104105    }
Note: See TracChangeset for help on using the changeset viewer.