summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-14 22:45:04 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-14 22:45:04 +0100
commit2386d7954154d48d0c8b66d7e8f77f56319e26e8 (patch)
tree833a7360567c4483d103d8d1776cdf0db3155e56
parentUnified the chunk data to use the BLOCKDATA datatype. (diff)
downloadcuberite-2386d7954154d48d0c8b66d7e8f77f56319e26e8.tar
cuberite-2386d7954154d48d0c8b66d7e8f77f56319e26e8.tar.gz
cuberite-2386d7954154d48d0c8b66d7e8f77f56319e26e8.tar.bz2
cuberite-2386d7954154d48d0c8b66d7e8f77f56319e26e8.tar.lz
cuberite-2386d7954154d48d0c8b66d7e8f77f56319e26e8.tar.xz
cuberite-2386d7954154d48d0c8b66d7e8f77f56319e26e8.tar.zst
cuberite-2386d7954154d48d0c8b66d7e8f77f56319e26e8.zip
Diffstat (limited to '')
-rw-r--r--source/WSSAnvil.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/WSSAnvil.cpp b/source/WSSAnvil.cpp
index ddb9a6be6..0a13ea899 100644
--- a/source/WSSAnvil.cpp
+++ b/source/WSSAnvil.cpp
@@ -258,6 +258,30 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, cNBTTag & a_NBT)
BLOCKTYPE * ChunkData = BlockData;
#endif // else AXIS_ORDER_YZX
+ //*
+ // Delete the comment above for really cool stuff :)
+ // DEBUG magic: Invert the underground, so that we can see the MC generator in action :)
+ bool ShouldInvert[cChunkDef::Width * cChunkDef::Width];
+ memset(ShouldInvert, 0, sizeof(ShouldInvert));
+ for (int y = cChunkDef::Height - 1; y >= 0; y--)
+ {
+ for (int x = 0; x < cChunkDef::Width; x++) for (int z = 0; z < cChunkDef::Width; z++)
+ {
+ int Index = cChunkDef::MakeIndexNoCheck(x, y, z);
+ if (ShouldInvert[x + cChunkDef::Width * z])
+ {
+ ChunkData[Index] = (ChunkData[Index] == E_BLOCK_AIR) ? E_BLOCK_STONE : E_BLOCK_AIR;
+ }
+ else
+ {
+ ShouldInvert[x + cChunkDef::Width * z] = (ChunkData[Index] != E_BLOCK_AIR);
+ }
+ }
+ } // for y
+ // Set everything alight, so that we can see:
+ memset(ChunkData + cChunkDef::SkyLightOffset, 0xff, cChunkDef::NumBlocks / 2);
+ //*/
+
m_World->ChunkDataLoaded(
a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ,
ChunkData,