void Tile::blitNonInfantryGroundUnits(int xPos, int yPos) { if(hasANonInfantryGroundObject() && !isFogged(pLocalHouse->getHouseID())) { std::list<Uint32>::const_iterator iter; for(iter = assignedNonInfantryGroundObjectList.begin(); iter != assignedNonInfantryGroundObjectList.end() ; ++iter) { ObjectBase* current = currentGame->getObjectManager().getObject(*iter); if(current->isAUnit() && current->isVisible(pLocalHouse->getTeam())) { if(location == current->getLocation()) { current->blitToScreen(); } } } } }
Uint32 Tile::getRadarColor(House* pHouse, bool radar) { if(isExplored(pHouse->getHouseID()) || debug) { if(isFogged(pHouse->getHouseID()) && radar) { return fogColor; } else { ObjectBase* pObject = getObject(); if(pObject != NULL) { int color; if(pObject->getItemID() == Unit_Sandworm) { color = COLOR_WHITE; } else { switch(pObject->getOwner()->getHouseID()) { case HOUSE_HARKONNEN: color = COLOR_HARKONNEN; break; case HOUSE_ATREIDES: color = COLOR_ATREIDES; break; case HOUSE_ORDOS: color = COLOR_ORDOS; break; case HOUSE_FREMEN: color = COLOR_FREMEN; break; case HOUSE_SARDAUKAR: color = COLOR_SARDAUKAR; break; case HOUSE_MERCENARY: color = COLOR_MERCENARY; break; default: color = COLOR_BLACK; break; } } if(pObject->isAUnit()) { fogColor = getColorByTerrainType(getType()); } else { fogColor = color; } // units and structures of the enemy are not visible if no radar if(!radar && !debug && (pObject->getOwner()->getTeam() != pHouse->getTeam())) { return COLOR_BLACK; } else { return color; } } else { fogColor = getColorByTerrainType(getType()); if(!radar && !debug) { return COLOR_BLACK; } else { return fogColor; } } } } else { return COLOR_BLACK; } }