mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/GabsPuNs-MinecraftConsoles.git
synced 2026-06-02 03:45:49 +00:00
Use BYTE Win Typedef instead of byte typedef from Minecraft.World
"byte" wasnt working anymore for some reason
This commit is contained in:
@@ -162,7 +162,7 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset)
|
||||
//int shift = 4 * part;
|
||||
const unsigned char *pucIn = &dataIn[ (y >> 1) + inOffset];
|
||||
|
||||
for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination byte
|
||||
for( int xz = 0; xz < 128; xz++ ) // 128 ( 16 x 16 x 0.5 ) in loop as packing 2 values into each destination BYTE
|
||||
{
|
||||
*pucOut = ( ( *pucIn ) >> ( part * 4 ) ) & 15;
|
||||
pucIn += 64;
|
||||
@@ -209,7 +209,7 @@ void SparseDataStorage::getData(byteArray retArray, unsigned int retOffset)
|
||||
const int shift = 4 * part;
|
||||
unsigned char *pucOut = &retArray.data[ (y >> 1) + + retOffset];
|
||||
const unsigned char *pucIn = &data[ planeIndices[ y ] * 128 ];
|
||||
for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same byte
|
||||
for( int xz = 0; xz < 128; xz++ ) // 128 in loop (16 x 16 x 0.5) as input data is being treated in pairs of nybbles that are packed in the same BYTE
|
||||
{
|
||||
unsigned char value = (*pucIn) & 15;
|
||||
*pucOut |= ( value << shift );
|
||||
@@ -238,8 +238,8 @@ int SparseDataStorage::get(int x, int y, int z)
|
||||
else
|
||||
{
|
||||
const int planeIndex = x * 16 + z; // Index within this xz plane
|
||||
const int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte)
|
||||
const int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte
|
||||
const int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per BYTE)
|
||||
const int shift = ( planeIndex & 1 ) * 4; // Bit shift within the BYTE
|
||||
const int retval = ( data[ planeIndices[y] * 128 + byteIndex ] >> shift ) & 15;
|
||||
|
||||
return retval;
|
||||
@@ -271,8 +271,8 @@ void SparseDataStorage::set(int x, int y, int z, int val)
|
||||
// Either data was already allocated, or we've just done that. Now store our value into the right place.
|
||||
|
||||
const int planeIndex = x * 16 + z; // Index within this xz plane
|
||||
const int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per byte)
|
||||
const int shift = ( planeIndex & 1 ) * 4; // Bit shift within the byte
|
||||
const int byteIndex = planeIndex / 2; // Byte index within the plane (2 tiles stored per BYTE)
|
||||
const int shift = ( planeIndex & 1 ) * 4; // Bit shift within the BYTE
|
||||
const int mask = 0xf0 >> shift;
|
||||
|
||||
const int idx = planeIndices[y] * 128 + byteIndex;
|
||||
|
||||
Reference in New Issue
Block a user