flip generator minimap
This commit is contained in:
@@ -286,27 +286,28 @@ void Hud::updateWorldGenDebugVisualization() {
|
|||||||
for (int x = 0; x < width; x++) {
|
for (int x = 0; x < width; x++) {
|
||||||
int cx = x + ox;
|
int cx = x + ox;
|
||||||
int cz = z + oz;
|
int cz = z + oz;
|
||||||
|
int flippedZ = height - z - 1;
|
||||||
|
|
||||||
int ax = x - (width - areaWidth) / 2;
|
int ax = x - (width - areaWidth) / 2;
|
||||||
int az = z - (height - areaHeight) / 2;
|
int az = z - (height - areaHeight) / 2;
|
||||||
|
|
||||||
data[(z * width + x) * 4 + 1] =
|
data[(flippedZ * width + x) * 4 + 1] =
|
||||||
level->chunks->getChunk(ax + ox, az + oz) ? 255 : 0;
|
level->chunks->getChunk(ax + ox, az + oz) ? 255 : 0;
|
||||||
data[(z * width + x) * 4 + 0] =
|
data[(flippedZ * width + x) * 4 + 0] =
|
||||||
level->chunksStorage->get(ax + ox, az + oz) ? 255 : 0;
|
level->chunksStorage->get(ax + ox, az + oz) ? 255 : 0;
|
||||||
|
|
||||||
if (ax < 0 || az < 0 ||
|
if (ax < 0 || az < 0 ||
|
||||||
ax >= areaWidth || az >= areaHeight) {
|
ax >= areaWidth || az >= areaHeight) {
|
||||||
data[(z * width + x) * 4 + 2] = 0;
|
data[(flippedZ * width + x) * 4 + 2] = 0;
|
||||||
data[(z * width + x) * 4 + 3] = 0;
|
data[(flippedZ * width + x) * 4 + 3] = 0;
|
||||||
data[(z * width + x) * 4 + 3] = 100;
|
data[(flippedZ * width + x) * 4 + 3] = 100;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto value = debugInfo.areaLevels[az * areaWidth + ax] * 25;
|
auto value = debugInfo.areaLevels[az * areaWidth + ax] * 25;
|
||||||
|
|
||||||
// Chunk is already generated
|
// Chunk is already generated
|
||||||
data[(z * width + x) * 4 + 2] = value;
|
data[(flippedZ * width + x) * 4 + 2] = value;
|
||||||
data[(z * width + x) * 4 + 3] = 150;
|
data[(flippedZ * width + x) * 4 + 3] = 150;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto texture = assets->get<Texture>(DEBUG_WORLDGEN_IMAGE);
|
auto texture = assets->get<Texture>(DEBUG_WORLDGEN_IMAGE);
|
||||||
|
|||||||
Reference in New Issue
Block a user