Restore fog and reachmap highlights to minimap

I don't like this solution, but it's the quickest way to get the effect back without
A: having to deal with surfaces
B: having to fiddle with color blend modes
C: having to apply the effect both to the base and the overlays (the old surface impl continuously
   blit a single surface together so it could just adjust the final product once)
This commit is contained in:
Charles Dang 2024-02-21 18:50:59 -05:00
parent d7ee5c1af8
commit 8ea8b6c7c3
3 changed files with 14 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

View file

@ -131,7 +131,6 @@ std::function<rect(rect)> prep_minimap_for_rendering(
const std::string base_file = "terrain/" + terrain_info.minimap_image() + ".png";
const texture& tile = image::get_texture(base_file); // image::HEXED
// TODO: handle fog (was a -50, -50, -50 adjust) and highlight (was a 50, 50, 50 adjust).
draw::blit(tile, dest);
// NOTE: we skip the overlay when base is missing (to avoid hiding the error)
@ -144,6 +143,20 @@ std::function<rect(rect)> prep_minimap_for_rendering(
// TODO: crop/center overlays?
draw::blit(overlay, dest);
}
// FIXME: use shaders instead of textures for this once we can actually do that
if(fogged(loc)) {
// Hex-shaped texture to apply #000000 at 40% opacity
static const texture fog_overlay = image::get_texture("terrain/minimap-fog.png");
draw::blit(fog_overlay, dest);
}
if(highlighted) {
// Hex-shaped texture to apply #ffffff at 40% opacity
static const texture fog_overlay = image::get_texture("terrain/minimap-highlight.png");
draw::blit(fog_overlay, dest);
}
}
} else {
//