A barely working tool to find font characters and pick their color.

This commit is contained in:
Zed A. Shaw 2024-12-07 13:42:30 -05:00
parent 6b3ce5eb3d
commit 0edd948101
17 changed files with 406 additions and 72 deletions

View file

@ -188,8 +188,8 @@ void System::draw_map(DinkyECS::World &world, Map &game_map, const Matrix &light
size_t end_x = std::min(view_x, game_map.width() - start.x);
size_t end_y = std::min(view_y, game_map.height() - start.y);
for(size_t x = 0; x < end_x; ++x) {
for(size_t y = 0; y < end_y; ++y) {
for(size_t y = 0; y < end_y; ++y) {
for(size_t x = 0; x < end_x; ++x) {
string tile = walls[start.y+y][start.x+x] == 1 ? config.WALL_TILE : config.FLOOR_TILE;
int light_value = lighting[start.y+y][start.x+x];
@ -207,11 +207,24 @@ void System::draw_map(DinkyECS::World &world, Map &game_map, const Matrix &light
pixel.foreground_color = Color::HSV(dnum * 20, 150, 200);
pixel.background_color = Color::HSV(30, 20, light_value / 5);
});
} else if(tile == config.WATER_TILE) {
canvas.DrawText(x * 2, y * 4, tile, [light_value](auto &pixel) {
pixel.foreground_color = Color::HSV(132, 200, std::min(int(light_value * 1.5), 200));
pixel.background_color = Color::HSV(147, 220, light_value / 1.5);
});
} else {
canvas.DrawText(x * 2, y * 4, tile, [light_value](auto &pixel) {
pixel.foreground_color = Color::HSV(80, 100, light_value / 1.5);
pixel.background_color = Color::HSV(30, 20, light_value / 3);
});
/*
// swapped!
canvas.DrawText(x * 2, y * 4, tile, [light_value](auto &pixel) {
pixel.foreground_color = Color::HSV(30, 40, light_value);
pixel.background_color = Color::HSV(30, 20, light_value / 3);
});
*/
}
}
}