summaryrefslogtreecommitdiffstats
path: root/source/packets
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-10 03:39:36 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-10 03:39:36 +0100
commit68f3ea56bdcf4664ee119016a0745d46f2c31a65 (patch)
treeedbf0523589e4a458c999c076c041ad61dcdb8b2 /source/packets
parentUsing more of the index functions in cChunk, so it should be easy enough to flip the axis ordering now (diff)
downloadcuberite-68f3ea56bdcf4664ee119016a0745d46f2c31a65.tar
cuberite-68f3ea56bdcf4664ee119016a0745d46f2c31a65.tar.gz
cuberite-68f3ea56bdcf4664ee119016a0745d46f2c31a65.tar.bz2
cuberite-68f3ea56bdcf4664ee119016a0745d46f2c31a65.tar.lz
cuberite-68f3ea56bdcf4664ee119016a0745d46f2c31a65.tar.xz
cuberite-68f3ea56bdcf4664ee119016a0745d46f2c31a65.tar.zst
cuberite-68f3ea56bdcf4664ee119016a0745d46f2c31a65.zip
Diffstat (limited to 'source/packets')
-rw-r--r--source/packets/cPacket_MapChunk.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/packets/cPacket_MapChunk.cpp b/source/packets/cPacket_MapChunk.cpp
index 6fdd73f12..037b94396 100644
--- a/source/packets/cPacket_MapChunk.cpp
+++ b/source/packets/cPacket_MapChunk.cpp
@@ -38,6 +38,8 @@ cPacket_MapChunk::cPacket_MapChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cha
unsigned int DataSize = (cChunk::c_ChunkHeight / 16) * (4096 + 2048 + 2048 + 2048);
std::auto_ptr<char> AllData(new char[ DataSize ]);
+
+#if AXIS_ORDER == AXIS_ORDER_YZX
memset( AllData.get(), 0, DataSize );
unsigned int iterator = 0;
@@ -93,6 +95,13 @@ cPacket_MapChunk::cPacket_MapChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cha
}
}
}
+#else if AXIS_ORDER == AXIS_ORDER_XZY
+ for ( int i = 0; i < 16; ++i )
+ {
+ m_BitMap1 |= (1 << i);
+ }
+ memcpy( AllData.get(), a_BlockData, DataSize );
+#endif
uLongf CompressedSize = compressBound( DataSize );
char * CompressedBlockData = new char[CompressedSize];
@@ -159,6 +168,7 @@ cPacket_MapChunk::cPacket_MapChunk( const cPacket_MapChunk & a_Copy )
void cPacket_MapChunk::Serialize(AString & a_Data) const
{
+ LOG("Sending chunk [%i, %i]", m_PosX, m_PosZ );
AppendByte (a_Data, m_PacketID);
#if (MINECRAFT_1_2_2 == 1 )