From 68f3ea56bdcf4664ee119016a0745d46f2c31a65 Mon Sep 17 00:00:00 2001 From: faketruth Date: Sat, 10 Mar 2012 02:39:36 +0000 Subject: You can change axis ordering by setting AXIS_ORDER to AXIS_ORDER_XZY in cChunk.h !THIS WILL SCREW UP YOUR WORLDS THOUGH! Still need to update world storage schemes, converters and such git-svn-id: http://mc-server.googlecode.com/svn/trunk@390 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.inl.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/cChunk.inl.h') diff --git a/source/cChunk.inl.h b/source/cChunk.inl.h index 4301f0486..0f0c25c09 100644 --- a/source/cChunk.inl.h +++ b/source/cChunk.inl.h @@ -38,7 +38,11 @@ char cChunk::GetNibble(char* a_Buffer, int x, int y, int z) if( x < c_ChunkWidth && x > -1 && y < c_ChunkHeight && y > -1 && z < c_ChunkWidth && z > -1 ) { const int cindex = MakeIndexNoCheck(x, y, z)/2; +#if AXIS_ORDER == AXIS_ORDER_XZY + if( (x & 1) == 0 ) +#else if AXIS_ORDER == AXIS_ORDER_YZX if( (y & 1) == 0 ) +#endif { // First half byte return (a_Buffer[cindex] & 0x0f); } @@ -83,7 +87,11 @@ void cChunk::SetNibble(char* a_Buffer, int x, int y, int z, char light) if( x < c_ChunkWidth && x > -1 && y < c_ChunkHeight && y > -1 && z < c_ChunkWidth && z > -1 ) { int cindex = MakeIndexNoCheck(x, y, z)/2; +#if AXIS_ORDER == AXIS_ORDER_XZY + if( (x & 1) == 0 ) +#else if AXIS_ORDER == AXIS_ORDER_YZX if( (y & 1) == 0 ) +#endif { // First half byte a_Buffer[cindex] &= 0xf0; // Set first half to 0 a_Buffer[cindex] |= (light) & 0x0f; -- cgit v1.2.3