From 925eb92d8600e13b83444496d3163d8d4e37b3de Mon Sep 17 00:00:00 2001 From: fgenesis Date: Fri, 15 Nov 2024 06:12:32 +0100 Subject: [PATCH] fix alpha handling for prev commit also, with proper uncovering now done also for prerevealed maps, don't set a prerevealed maps as actually revealed on load. This applies the correct alpha now. --- Aquaria/WorldMapRender.cpp | 14 ++++++++------ Aquaria/WorldMapTiles.cpp | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Aquaria/WorldMapRender.cpp b/Aquaria/WorldMapRender.cpp index dd2c5c3..d9511cc 100644 --- a/Aquaria/WorldMapRender.cpp +++ b/Aquaria/WorldMapRender.cpp @@ -408,24 +408,26 @@ BeaconRenders beaconRenders; void WorldMapRender::setProperTileColor(WorldMapTileContainer& wt) { const WorldMapTile& t = wt.tile; + float amod; if(selectedTile != &wt) { - float amod = (t.revealed || t.prerevealed) ? 0.5f : 0.0f; - - if(!t.revealed) - amod *= float(WORLDMAP_REVEALED_BUT_UNEXPLORED_ALPHA) / float(0xff); + amod = (t.revealed || t.prerevealed) ? 0.5f : 0.0f; if (selectedTile && t.layer != selectedTile->tile.layer) amod *= 0.5f; - wt.q.alphaMod = amod; wt.q.color = Vector(0.7f, 0.8f, 1); } else { wt.q.color = Vector(1,1,1); - wt.q.alphaMod = 1; + amod = 1; } + + if(!t.revealed) + amod *= float(WORLDMAP_REVEALED_BUT_UNEXPLORED_ALPHA) / float(0xff); + + wt.q.alphaMod = amod; } static HintGemQuad *addHintGem(const char *tex) diff --git a/Aquaria/WorldMapTiles.cpp b/Aquaria/WorldMapTiles.cpp index 4839fda..1a096df 100644 --- a/Aquaria/WorldMapTiles.cpp +++ b/Aquaria/WorldMapTiles.cpp @@ -360,7 +360,6 @@ void WorldMap::_load(const std::string &file) WorldMapTile t; std::istringstream is(line); is >> t.index >> t.stringIndex >> t.name >> t.layer >> t.scale >> t.gridPos.x >> t.gridPos.y >> t.prerevealed >> t.scale2; - t.revealed = t.prerevealed; stringToUpper(t.name); worldMapTiles.push_back(t); }