1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-05-10 19:13:44 +00:00

Little fix to world map partial reveal method coloring.

Bug has gone unnoticed until now.
This commit is contained in:
fgenesis 2015-07-05 22:31:59 +02:00
parent eb56a93200
commit 43a4f60ab1

View file

@ -48,7 +48,7 @@ namespace WorldMapRenderNamespace
VIS_WRITE = 1 // Uses render-to-texture instead VIS_WRITE = 1 // Uses render-to-texture instead
}; };
VisMethod visMethod = VIS_VERTEX; const VisMethod visMethod = VIS_VERTEX;
WorldMapRevealMethod revMethod = REVEAL_DEFAULT; WorldMapRevealMethod revMethod = REVEAL_DEFAULT;
std::vector<Quad *> tiles; std::vector<Quad *> tiles;
@ -512,6 +512,7 @@ static void tileDataToVis(WorldMapTile *tile, Vector **vis)
if (data != 0) if (data != 0)
{ {
const float a = tile->prerevealed ? 0.4f : baseMapSegAlpha;
const unsigned int rowSize = MAPVIS_SUBDIV/8; const unsigned int rowSize = MAPVIS_SUBDIV/8;
for (unsigned int y = 0; y < MAPVIS_SUBDIV; y++, data += rowSize) for (unsigned int y = 0; y < MAPVIS_SUBDIV; y++, data += rowSize)
{ {
@ -520,18 +521,19 @@ static void tileDataToVis(WorldMapTile *tile, Vector **vis)
unsigned char dataByte = data[x/8]; unsigned char dataByte = data[x/8];
for (unsigned int x2 = 0; x2 < 8; x2++) for (unsigned int x2 = 0; x2 < 8; x2++)
{ {
vis[x+x2][y].z = (dataByte & (1 << x2)) ? visibleMapSegAlpha : baseMapSegAlpha; vis[x+x2][y].z = (dataByte & (1 << x2)) ? visibleMapSegAlpha : a;
} }
} }
} }
} }
else else
{ {
const float a = tile->prerevealed ? 0.4f : baseMapSegAlpha;
for (int x = 0; x < MAPVIS_SUBDIV; x++) for (int x = 0; x < MAPVIS_SUBDIV; x++)
{ {
for (int y = 0; y < MAPVIS_SUBDIV; y++) for (int y = 0; y < MAPVIS_SUBDIV; y++)
{ {
vis[x][y].z = baseMapSegAlpha; vis[x][y].z = a;
} }
} }
return; return;