Changeset 6899 for code/branches/hudelements/src/modules
- Timestamp:
- May 13, 2010, 1:19:04 PM (15 years ago)
- 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 99 99 if (this->isInitialized()) 100 100 { 101 activeObjectListType::iterator it; 102 for( it = activeObjectList_.begin(); it!=activeObjectList_.end(); ++it ) 103 { 104 removeObject(it->first); 105 } 101 106 activeObjectList_.clear(); 102 respawnObjectSet_.clear();103 107 } 104 108 } … … 173 177 // float textLength = multi_cast<std::string>(dist).size() * navText_->getCharHeight() * 0.3f; 174 178 175 if (!activeObjectList_.empty()) { 179 if (!activeObjectList_.empty()) 180 { 176 181 for (tempRadarViewable = activeObjectList_.begin(); tempRadarViewable!=activeObjectList_.end(); ++tempRadarViewable) 177 182 { … … 293 298 } 294 299 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(); 297 303 } 298 304 … … 315 321 scales with scale(). Here we obviously have to adjust this. 316 322 */ 317 void HUDNavigation::sizeChanged() { 323 void HUDNavigation::sizeChanged() 324 { 318 325 // use size to compensate for aspect ratio if enabled. 319 326 float xScale = this->getActualSize().x; … … 336 343 337 344 338 void HUDNavigation::addObject(RadarViewable* object) { 345 void HUDNavigation::addObject(RadarViewable* object) 346 { 339 347 if (object == dynamic_cast<RadarViewable*>(this->getOwner())) 340 348 return; … … 382 390 this->background_->removeChild(it->second.first->getName()); 383 391 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); 384 395 385 396 activeObjectList_.erase(viewable); … … 387 398 } 388 399 389 void HUDNavigation::changedOwner() { 390 391 392 393 respawnObjectSet_ = this->getOwner()->getScene()->getRadar()->getRadarObjects(); 400 void HUDNavigation::changedOwner() 401 { 402 respawnObjectSetType respawnObjectSet = this->getOwner()->getScene()->getRadar()->getRadarObjects(); 394 403 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_); 399 408 } 400 409 -
code/branches/hudelements/src/modules/overlays/hud/HUDNavigation.h
r6898 r6899 115 115 116 116 typedef std::set<RadarViewable*> respawnObjectSetType; 117 respawnObjectSetType respawnObjectSet_;118 117 119 118
Note: See TracChangeset
for help on using the changeset viewer.