Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6899 for code/branches


Ignore:
Timestamp:
May 13, 2010, 1:19:04 PM (15 years ago)
Author:
scheusso
Message:

some cleaning up
still segfault when terminating

Location:
code/branches/hudelements/src/modules/overlays/hud
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.cc

    r6898 r6899  
    9999    if (this->isInitialized())
    100100    {
     101        activeObjectListType::iterator it;
     102        for( it = activeObjectList_.begin(); it!=activeObjectList_.end(); ++it )
     103        {
     104            removeObject(it->first);
     105        }
    101106        activeObjectList_.clear();
    102         respawnObjectSet_.clear();
    103107    }
    104108}
     
    173177//         float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3f;
    174178
    175     if (!activeObjectList_.empty()) {
     179    if (!activeObjectList_.empty())
     180    {
    176181        for (tempRadarViewable = activeObjectList_.begin(); tempRadarViewable!=activeObjectList_.end(); ++tempRadarViewable)
    177182        {
     
    293298            }
    294299
    295              tempRadarViewable->second.first->show();
    296              tempRadarViewable->second.second->show();
     300            tempRadarViewable->second.first->show();
     301            tempRadarViewable->second.second->show();
     302//             tempRadarViewable->second.second->hide();
    297303        }
    298304
     
    315321       scales with scale(). Here we obviously have to adjust this.
    316322*/
    317 void HUDNavigation::sizeChanged() {
     323void HUDNavigation::sizeChanged()
     324{
    318325    // use size to compensate for aspect ratio if enabled.
    319326    float xScale = this->getActualSize().x;
     
    336343
    337344
    338 void HUDNavigation::addObject(RadarViewable* object) {
     345void HUDNavigation::addObject(RadarViewable* object)
     346{
    339347    if (object == dynamic_cast<RadarViewable*>(this->getOwner()))
    340348        return;
     
    382390        this->background_->removeChild(it->second.first->getName());
    383391        this->background_->removeChild(it->second.second->getName());
     392        // correctly destroy the overlay elements
     393        Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.first);
     394        Ogre::OverlayManager::getSingleton().destroyOverlayElement(it->second.second);
    384395
    385396        activeObjectList_.erase(viewable);
     
    387398}
    388399
    389 void HUDNavigation::changedOwner() {
    390      
    391 
    392  
    393     respawnObjectSet_ = this->getOwner()->getScene()->getRadar()->getRadarObjects();
     400void HUDNavigation::changedOwner()
     401{
     402    respawnObjectSetType respawnObjectSet = this->getOwner()->getScene()->getRadar()->getRadarObjects();
    394403    respawnObjectSetType::iterator respawnObjectSetIt_;
    395     for (respawnObjectSetIt_ = respawnObjectSet_.begin(); respawnObjectSetIt_ != respawnObjectSet_.end();
    396             ++respawnObjectSetIt_)
    397     {
    398         if (!(*respawnObjectSetIt_)->isHumanShip_)  HUDNavigation::addObject(*respawnObjectSetIt_);
     404    for (respawnObjectSetIt_ = respawnObjectSet.begin(); respawnObjectSetIt_ != respawnObjectSet.end(); ++respawnObjectSetIt_)
     405    {
     406        if (!(*respawnObjectSetIt_)->isHumanShip_)
     407            this->addObject(*respawnObjectSetIt_);
    399408    }
    400409
  • code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.h

    r6898 r6899  
    115115       
    116116    typedef std::set<RadarViewable*> respawnObjectSetType;
    117     respawnObjectSetType respawnObjectSet_;
    118117   
    119118
Note: See TracChangeset for help on using the changeset viewer.