Anvil support: Added a debugging section for inverting terrain (So that MC cave generator can be seen in action). Commented out, so that it doesn't make it into the release versions
git-svn-id: http://mc-server.googlecode.com/svn/trunk@414 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
b974b1ea59
commit
2386d79541
@ -258,6 +258,30 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, cNBTTag & a_NBT)
|
|||||||
BLOCKTYPE * ChunkData = BlockData;
|
BLOCKTYPE * ChunkData = BlockData;
|
||||||
#endif // else AXIS_ORDER_YZX
|
#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(
|
m_World->ChunkDataLoaded(
|
||||||
a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ,
|
a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ,
|
||||||
ChunkData,
|
ChunkData,
|
||||||
|
Loading…
Reference in New Issue
Block a user