- Timestamp:
- Nov 21, 2015, 7:05:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/overlays/hud/HUDNavigation.cc
r10774 r10821 131 131 } 132 132 this->fontName_ = font; 133 for ( std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)134 { 135 if ( it->second.text_ != nullptr)136 it->second.text_->setFontName(this->fontName_);133 for (auto & elem : this->activeObjectList_) 134 { 135 if (elem.second.text_ != nullptr) 136 elem.second.text_->setFontName(this->fontName_); 137 137 } 138 138 } … … 151 151 } 152 152 this->textSize_ = size; 153 for ( std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it!=this->activeObjectList_.end(); ++it)154 { 155 if ( it->second.text_)156 it->second.text_->setCharHeight(size);153 for (auto & elem : this->activeObjectList_) 154 { 155 if (elem.second.text_) 156 elem.second.text_->setCharHeight(size); 157 157 } 158 158 } … … 186 186 const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix(); 187 187 188 for ( std::list<std::pair<RadarViewable*, unsigned int>>::iterator listIt = this->sortedObjectList_.begin(); listIt != this->sortedObjectList_.end(); ++listIt)189 listIt->second = (int)((listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f);188 for (auto & elem : this->sortedObjectList_) 189 elem.second = (int)((elem.first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition()).length() + 0.5f); 190 190 191 191 this->sortedObjectList_.sort(compareDistance); … … 531 531 float yScale = this->getActualSize().y; 532 532 533 for ( std::map<RadarViewable*, ObjectInfo>::iterator it = this->activeObjectList_.begin(); it != this->activeObjectList_.end(); ++it)534 { 535 if ( it->second.health_ != nullptr)536 it->second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale);537 if ( it->second.healthLevel_ != nullptr)538 it->second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale);539 if ( it->second.panel_ != nullptr)540 it->second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale);541 if ( it->second.text_ != nullptr)542 it->second.text_->setCharHeight(this->textSize_ * yScale);543 if ( it->second.target_ != nullptr)544 it->second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale);533 for (auto & elem : this->activeObjectList_) 534 { 535 if (elem.second.health_ != nullptr) 536 elem.second.health_->setDimensions(this->healthMarkerSize_ * xScale, this->healthMarkerSize_ * yScale); 537 if (elem.second.healthLevel_ != nullptr) 538 elem.second.healthLevel_->setDimensions(this->healthLevelMarkerSize_ * xScale, this->healthLevelMarkerSize_ * yScale); 539 if (elem.second.panel_ != nullptr) 540 elem.second.panel_->setDimensions(this->navMarkerSize_ * xScale, this->navMarkerSize_ * yScale); 541 if (elem.second.text_ != nullptr) 542 elem.second.text_->setCharHeight(this->textSize_ * yScale); 543 if (elem.second.target_ != nullptr) 544 elem.second.target_->setDimensions(this->aimMarkerSize_ * xScale, this->aimMarkerSize_ * yScale); 545 545 } 546 546 } … … 670 670 { 671 671 const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects(); 672 for ( std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it)673 { 674 if (!( *it)->isHumanShip_)675 this->addObject( *it);672 for (const auto & respawnObject : respawnObjects) 673 { 674 if (!(respawnObject)->isHumanShip_) 675 this->addObject(respawnObject); 676 676 } 677 677 }
Note: See TracChangeset
for help on using the changeset viewer.