Changeset 8875 for code/branches/ai2/src/modules/overlays
- Timestamp:
- Sep 4, 2011, 10:27:17 PM (13 years ago)
- Location:
- code/branches/ai2/src/modules/overlays/hud
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai2/src/modules/overlays/hud/HUDNavigation.cc
r8874 r8875 164 164 165 165 unsigned int markerCount_ = 0; 166 bool closeEnough_ = false; // inly display objects that are close enough to be relevant for the player166 bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player 167 167 // for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it) 168 168 for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt ) 169 169 { 170 170 ObjectMap::iterator it = activeObjectList_.find ( listIt->first ); 171 if( detectionLimit_ < 0 ) 172 closeEnough_ = true ; 173 else 174 closeEnough_ = listIt->second < detectionLimit_ ; 175 if ( markerCount_ < markerLimit_ && closeEnough_ ) // display on HUD íf statement is true 171 closeEnough_ = listIt->second < detectionLimit_ ; 172 if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) ) // display on HUD if the statement is true 176 173 { 177 174 -
code/branches/ai2/src/modules/overlays/hud/HUDRadar.cc
r8874 r8875 124 124 125 125 void HUDRadar::objectChanged( RadarViewable* rv ) 126 { 127 if(rv == dynamic_cast<RadarViewable*>(this->owner_)) //case: player changed 128 return; 129 if( showObject(rv) == false ) //case: (radar) invisible object changed 130 return; 131 if( this->radarObjects_.find(rv) == this->radarObjects_.end() ) // if (radar) invisibility becomes (radar) visible 132 this->addObject(rv); 133 assert( this->radarObjects_.find(rv) != this->radarObjects_.end() ); 134 Ogre::PanelOverlayElement* panel = this->radarObjects_[rv]; 135 panel->setMaterialName(TextureGenerator::getMaterialName( 136 shapeMaterials_[rv->getRadarObjectShape()], rv->getRadarObjectColour())); 126 {// The new implementation behaves more precisely, since inactive RadarViewables are not displayed anymore. 127 this->removeObject(rv); 128 this->addObject(rv); 137 129 } 138 130
Note: See TracChangeset
for help on using the changeset viewer.