Color Tile::getColor(const ViewObject& object) { if (object.hasModifier(ViewObject::Modifier::INVISIBLE)) return colors[ColorId::DARK_GRAY]; if (object.hasModifier(ViewObject::Modifier::HIDDEN)) return colors[ColorId::LIGHT_GRAY]; double bleeding = object.getAttribute(ViewObject::Attribute::BLEEDING); if (bleeding > 0) bleeding = 0.5 + bleeding / 2; bleeding = min(1., bleeding); Color color = getAsciiTile(object).color; return Color( (1 - bleeding) * color.r + bleeding * 255, (1 - bleeding) * color.g, (1 - bleeding) * color.b); }
const Tile& Tile::getTile(const ViewObject& obj, bool sprite) { if (sprite) return getSpriteTile(obj); else return getAsciiTile(obj); }