Enemies now actually adopt their color and all items too.

This commit is contained in:
Zed A. Shaw 2025-01-28 14:04:01 -05:00
parent 59a6882b70
commit 7c56f350ab
4 changed files with 29 additions and 15 deletions

View file

@ -213,8 +213,8 @@ void System::draw_entities(DinkyECS::World &world, Map &map, const Matrix &light
const TileCell& cell = tiles.at(pos.location.x, pos.location.y);
// the 2 and 4 are from ftxui::Canvas since it does a kind of "subpixel" drawing
canvas.DrawText(loc.x*2, loc.y*4, tile.chr, [light_value, cell](auto &pixel) {
pixel.foreground_color = Color::HSV(255, 200, 180 * light_value);
canvas.DrawText(loc.x*2, loc.y*4, tile.chr, [tile, light_value, cell](auto &pixel) {
pixel.foreground_color = Color::HSV(tile.fg_h, tile.fg_s, tile.fg_v * light_value);
pixel.background_color = Color::HSV(cell.bg_h, cell.bg_s, cell.bg_v * light_value);
});
}