Optional and configurable zone colors

This commit is contained in:
Allan Ference
2013-08-17 23:06:58 +02:00
parent 5849136526
commit 5eabf6f518
5 changed files with 91 additions and 24 deletions

View File

@@ -305,6 +305,30 @@ void Map::cleanTile(const Position& pos)
}
}
void Map::setShowZone(tileflags_t zone, bool show)
{
if(show)
m_zoneFlags |= (uint32)zone;
else
m_zoneFlags &= ~(uint32)zone;
}
void Map::setShowZones(bool show)
{
static constexpr uint32 defaultZoneFlags
= TILESTATE_HOUSE | TILESTATE_PROTECTIONZONE;
if(!show)
m_zoneFlags = 0;
else if(m_zoneFlags == 0)
m_zoneFlags = defaultZoneFlags;
}
void Map::setZoneColor(tileflags_t zone, const Color& color)
{
if((m_zoneFlags & zone) == zone)
m_zoneColors[zone] = color;
}
void Map::addCreature(const CreaturePtr& creature)
{
m_knownCreatures[creature->getId()] = creature;