1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 03:33:48 +00:00

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.
This commit is contained in:
fgenesis 2024-11-15 06:12:32 +01:00
parent 9d142bbd0c
commit 925eb92d86
2 changed files with 8 additions and 7 deletions

View file

@ -408,24 +408,26 @@ BeaconRenders beaconRenders;
void WorldMapRender::setProperTileColor(WorldMapTileContainer& wt) void WorldMapRender::setProperTileColor(WorldMapTileContainer& wt)
{ {
const WorldMapTile& t = wt.tile; const WorldMapTile& t = wt.tile;
float amod;
if(selectedTile != &wt) if(selectedTile != &wt)
{ {
float amod = (t.revealed || t.prerevealed) ? 0.5f : 0.0f; amod = (t.revealed || t.prerevealed) ? 0.5f : 0.0f;
if(!t.revealed)
amod *= float(WORLDMAP_REVEALED_BUT_UNEXPLORED_ALPHA) / float(0xff);
if (selectedTile && t.layer != selectedTile->tile.layer) if (selectedTile && t.layer != selectedTile->tile.layer)
amod *= 0.5f; amod *= 0.5f;
wt.q.alphaMod = amod;
wt.q.color = Vector(0.7f, 0.8f, 1); wt.q.color = Vector(0.7f, 0.8f, 1);
} }
else else
{ {
wt.q.color = Vector(1,1,1); 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) static HintGemQuad *addHintGem(const char *tex)

View file

@ -360,7 +360,6 @@ void WorldMap::_load(const std::string &file)
WorldMapTile t; WorldMapTile t;
std::istringstream is(line); 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; 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); stringToUpper(t.name);
worldMapTiles.push_back(t); worldMapTiles.push_back(t);
} }