mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-25 03:20:46 +00:00
fix: remove byte type alias
This commit is contained in:
@@ -8,7 +8,7 @@ void BlockReplacements::staticCtor()
|
||||
{
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
byte b = (byte) i;
|
||||
uint8_t b = (uint8_t) i;
|
||||
if (b != 0 && Tile::tiles[b & 0xff] == NULL)
|
||||
{
|
||||
b = 0;
|
||||
|
||||
@@ -202,11 +202,11 @@ void CustomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks)
|
||||
// 4J - this comparison used to just be with 0.0f but is now varied by block above
|
||||
if (yc * CHUNK_HEIGHT + y < mapHeight)
|
||||
{
|
||||
tileId = (byte) Tile::rock_Id;
|
||||
tileId = (uint8_t) Tile::rock_Id;
|
||||
}
|
||||
else if (yc * CHUNK_HEIGHT + y < waterHeight)
|
||||
{
|
||||
tileId = (byte) Tile::calmWater_Id;
|
||||
tileId = (uint8_t) Tile::calmWater_Id;
|
||||
}
|
||||
|
||||
// 4J - more extra code to make sure that the column at the edge of the world is just water & rock, to match the infinite sea that
|
||||
@@ -264,8 +264,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
|
||||
int run = -1;
|
||||
|
||||
byte top = b->topMaterial;
|
||||
byte material = b->material;
|
||||
uint8_t top = b->topMaterial;
|
||||
uint8_t material = b->material;
|
||||
|
||||
LevelGenerationOptions *lgo = app.getLevelGenerationOptions();
|
||||
if(lgo != NULL)
|
||||
@@ -288,7 +288,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
if (y <= 1 + random->nextInt(2)) // 4J - changed to make the bedrock not have bits you can get stuck in
|
||||
// if (y <= 0 + random->nextInt(5))
|
||||
{
|
||||
blocks[offs] = (byte) Tile::unbreakable_Id;
|
||||
blocks[offs] = (uint8_t) Tile::unbreakable_Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -305,7 +305,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
if (runDepth <= 0)
|
||||
{
|
||||
top = 0;
|
||||
material = (byte) Tile::rock_Id;
|
||||
material = (uint8_t) Tile::rock_Id;
|
||||
}
|
||||
else if (y >= waterHeight - 4 && y <= waterHeight + 1)
|
||||
{
|
||||
@@ -319,8 +319,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
|
||||
if (y < waterHeight && top == 0)
|
||||
{
|
||||
if (temp < 0.15f) top = (byte) Tile::ice_Id;
|
||||
else top = (byte) Tile::calmWater_Id;
|
||||
if (temp < 0.15f) top = (uint8_t) Tile::ice_Id;
|
||||
else top = (uint8_t) Tile::calmWater_Id;
|
||||
}
|
||||
|
||||
run = runDepth;
|
||||
@@ -337,7 +337,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
if (run == 0 && material == Tile::sand_Id)
|
||||
{
|
||||
run = random->nextInt(4);
|
||||
material = (byte) Tile::sandStone_Id;
|
||||
material = (uint8_t) Tile::sandStone_Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -366,7 +366,7 @@ LevelChunk *CustomLevelSource::getChunk(int xOffs, int zOffs)
|
||||
|
||||
// 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed
|
||||
int blocksSize = Level::maxBuildHeight * 16 * 16;
|
||||
byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE);
|
||||
uint8_t *tileData = (uint8_t *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE);
|
||||
XMemSet128(tileData,0,blocksSize);
|
||||
byteArray blocks = byteArray(tileData,blocksSize);
|
||||
// byteArray blocks = byteArray(16 * level->depth * 16);
|
||||
|
||||
@@ -19,9 +19,9 @@ void HellDimension::init()
|
||||
Vec3 *HellDimension::getFogColor(float td, float a) const
|
||||
{
|
||||
int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Nether_Fog_Colour );
|
||||
byte redComponent = ((colour>>16)&0xFF);
|
||||
byte greenComponent = ((colour>>8)&0xFF);
|
||||
byte blueComponent = ((colour)&0xFF);
|
||||
uint8_t redComponent = ((colour>>16)&0xFF);
|
||||
uint8_t greenComponent = ((colour>>8)&0xFF);
|
||||
uint8_t blueComponent = ((colour)&0xFF);
|
||||
|
||||
float rr = (float)redComponent/256;//0.2f;
|
||||
float gg = (float)greenComponent/256;//0.03f;
|
||||
|
||||
@@ -184,7 +184,7 @@ int EmptyLevelChunk::getBlocksAndData(byteArray data, int x0, int y0, int z0, in
|
||||
}
|
||||
|
||||
|
||||
Arrays::fill(data, p, p + len, (byte) 0);
|
||||
Arrays::fill(data, p, p + len, (uint8_t) 0);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
@@ -4425,7 +4425,7 @@ bool Level::mayInteract(shared_ptr<Player> player, int xt, int yt, int zt, int c
|
||||
}
|
||||
|
||||
|
||||
void Level::broadcastEntityEvent(shared_ptr<Entity> e, byte event)
|
||||
void Level::broadcastEntityEvent(shared_ptr<Entity> e, uint8_t event)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -458,7 +458,7 @@ public:
|
||||
void setSpawnPos(Pos *spawnPos);
|
||||
void ensureAdded(shared_ptr<Entity> entity);
|
||||
virtual bool mayInteract(shared_ptr<Player> player, int xt, int yt, int zt, int content);
|
||||
virtual void broadcastEntityEvent(shared_ptr<Entity> e, byte event);
|
||||
virtual void broadcastEntityEvent(shared_ptr<Entity> e, uint8_t event);
|
||||
ChunkSource *getChunkSource();
|
||||
virtual void tileEvent(int x, int y, int z, int tile, int b0, int b1);
|
||||
LevelStorage *getLevelStorage();
|
||||
|
||||
@@ -525,7 +525,7 @@ void LevelChunk::recalcHeightmapOnly()
|
||||
blocks = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT?upperBlocks : lowerBlocks;
|
||||
}
|
||||
#endif
|
||||
heightmap[z << 4 | x] = (byte) y;
|
||||
heightmap[z << 4 | x] = (uint8_t) y;
|
||||
if (y < min) min = y;
|
||||
}
|
||||
|
||||
@@ -581,7 +581,7 @@ void LevelChunk::recalcHeightmap()
|
||||
blocks = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT?upperBlocks : lowerBlocks;
|
||||
}
|
||||
#endif
|
||||
heightmap[z << 4 | x] = (byte) y;
|
||||
heightmap[z << 4 | x] = (uint8_t) y;
|
||||
if (y < min) min = y;
|
||||
|
||||
if (!level->dimension->hasCeiling)
|
||||
@@ -803,7 +803,7 @@ void LevelChunk::recalcHeight(int x, int yStart, int z)
|
||||
if (y == yOld) return;
|
||||
|
||||
// level->lightColumnChanged(x, z, y, yOld); // 4J - this call moved below & corrected - see comment further down
|
||||
heightmap[z << 4 | x] = (byte) y;
|
||||
heightmap[z << 4 | x] = (uint8_t) y;
|
||||
|
||||
if (y < minHeight)
|
||||
{
|
||||
@@ -910,7 +910,7 @@ int LevelChunk::getTile(int x, int y, int z)
|
||||
|
||||
bool LevelChunk::setTileAndData(int x, int y, int z, int _tile, int _data)
|
||||
{
|
||||
byte tile = (byte) _tile;
|
||||
uint8_t tile = (uint8_t) _tile;
|
||||
|
||||
// Optimisation brought forward from 1.8.2, change from int to unsigned char & this special value changed from -999 to 255
|
||||
int slot = z << 4 | x;
|
||||
@@ -1984,7 +1984,7 @@ Biome *LevelChunk::getBiome(int x, int z, BiomeSource *biomeSource)
|
||||
{
|
||||
Biome *biome = biomeSource->getBiome((this->x << 4) + x, (this->z << 4) + z);
|
||||
value = biome->id;
|
||||
biomes[(z << 4) | x] = (byte) (value & 0xff);
|
||||
biomes[(z << 4) | x] = (uint8_t) (value & 0xff);
|
||||
}
|
||||
if (Biome::biomes[value] == NULL)
|
||||
{
|
||||
|
||||
@@ -200,11 +200,11 @@ void RandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks)
|
||||
// 4J - this comparison used to just be with 0.0f but is now varied by block above
|
||||
if ((val += vala) > comp)
|
||||
{
|
||||
tileId = (byte) Tile::rock_Id;
|
||||
tileId = (uint8_t) Tile::rock_Id;
|
||||
}
|
||||
else if (yc * CHUNK_HEIGHT + y < waterHeight)
|
||||
{
|
||||
tileId = (byte) Tile::calmWater_Id;
|
||||
tileId = (uint8_t) Tile::calmWater_Id;
|
||||
}
|
||||
|
||||
// 4J - more extra code to make sure that the column at the edge of the world is just water & rock, to match the infinite sea that
|
||||
@@ -266,8 +266,8 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
|
||||
int run = -1;
|
||||
|
||||
byte top = b->topMaterial;
|
||||
byte material = b->material;
|
||||
uint8_t top = b->topMaterial;
|
||||
uint8_t material = b->material;
|
||||
|
||||
LevelGenerationOptions *lgo = app.getLevelGenerationOptions();
|
||||
if(lgo != NULL)
|
||||
@@ -282,7 +282,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
if (y <= 1 + random->nextInt(2)) // 4J - changed to make the bedrock not have bits you can get stuck in
|
||||
// if (y <= 0 + random->nextInt(5))
|
||||
{
|
||||
blocks[offs] = (byte) Tile::unbreakable_Id;
|
||||
blocks[offs] = (uint8_t) Tile::unbreakable_Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -299,7 +299,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
if (runDepth <= 0)
|
||||
{
|
||||
top = 0;
|
||||
material = (byte) Tile::rock_Id;
|
||||
material = (uint8_t) Tile::rock_Id;
|
||||
}
|
||||
else if (y >= waterHeight - 4 && y <= waterHeight + 1)
|
||||
{
|
||||
@@ -313,8 +313,8 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
|
||||
if (y < waterHeight && top == 0)
|
||||
{
|
||||
if (temp < 0.15f) top = (byte) Tile::ice_Id;
|
||||
else top = (byte) Tile::calmWater_Id;
|
||||
if (temp < 0.15f) top = (uint8_t) Tile::ice_Id;
|
||||
else top = (uint8_t) Tile::calmWater_Id;
|
||||
}
|
||||
|
||||
run = runDepth;
|
||||
@@ -331,7 +331,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
if (run == 0 && material == Tile::sand_Id)
|
||||
{
|
||||
run = random->nextInt(4);
|
||||
material = (byte) Tile::sandStone_Id;
|
||||
material = (uint8_t) Tile::sandStone_Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -355,7 +355,7 @@ LevelChunk *RandomLevelSource::getChunk(int xOffs, int zOffs)
|
||||
|
||||
// 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed
|
||||
int blocksSize = Level::genDepth * 16 * 16;
|
||||
byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE);
|
||||
uint8_t *tileData = (uint8_t *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE);
|
||||
XMemSet128(tileData,0,blocksSize);
|
||||
byteArray blocks = byteArray(tileData,blocksSize);
|
||||
// byteArray blocks = byteArray(16 * level->depth * 16);
|
||||
|
||||
@@ -40,10 +40,10 @@ void DataLayer::set(int x, int y, int z, int val)
|
||||
|
||||
if (part == 0)
|
||||
{
|
||||
data[slot] = (byte) ((data[slot] & 0xf0) | (val & 0xf));
|
||||
data[slot] = (uint8_t) ((data[slot] & 0xf0) | (val & 0xf));
|
||||
} else
|
||||
{
|
||||
data[slot] = (byte) ((data[slot] & 0x0f) | ((val & 0xf) << 4));
|
||||
data[slot] = (uint8_t) ((data[slot] & 0x0f) | ((val & 0xf) << 4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ bool DataLayer::isValid()
|
||||
|
||||
void DataLayer::setAll(int br)
|
||||
{
|
||||
byte val = (byte) (br & (br << 4));
|
||||
uint8_t val = (uint8_t) (br & (br << 4));
|
||||
for (unsigned int i = 0; i < data.length; i++)
|
||||
{
|
||||
data[i] = val;
|
||||
|
||||
@@ -19,7 +19,7 @@ _MapDataMappings::_MapDataMappings()
|
||||
#ifndef _DURANGO
|
||||
ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA);
|
||||
#endif
|
||||
ZeroMemory(dimensions,sizeof(byte)*(MAXIMUM_MAP_SAVE_DATA/4));
|
||||
ZeroMemory(dimensions,sizeof(uint8_t)*(MAXIMUM_MAP_SAVE_DATA/4));
|
||||
}
|
||||
|
||||
int _MapDataMappings::getDimension(int id)
|
||||
@@ -84,7 +84,7 @@ _MapDataMappings_old::_MapDataMappings_old()
|
||||
#ifndef _DURANGO
|
||||
ZeroMemory(xuids,sizeof(PlayerUID)*MAXIMUM_MAP_SAVE_DATA);
|
||||
#endif
|
||||
ZeroMemory(dimensions,sizeof(byte)*(MAXIMUM_MAP_SAVE_DATA/8));
|
||||
ZeroMemory(dimensions,sizeof(uint8_t)*(MAXIMUM_MAP_SAVE_DATA/8));
|
||||
}
|
||||
|
||||
int _MapDataMappings_old::getDimension(int id)
|
||||
|
||||
@@ -36,7 +36,7 @@ class ConsoleSaveFile;
|
||||
typedef struct _MapDataMappings
|
||||
{
|
||||
PlayerUID xuids[MAXIMUM_MAP_SAVE_DATA];
|
||||
byte dimensions[MAXIMUM_MAP_SAVE_DATA/4];
|
||||
uint8_t dimensions[MAXIMUM_MAP_SAVE_DATA/4];
|
||||
|
||||
_MapDataMappings();
|
||||
int getDimension(int id);
|
||||
@@ -47,7 +47,7 @@ typedef struct _MapDataMappings
|
||||
typedef struct _MapDataMappings_old
|
||||
{
|
||||
PlayerUID xuids[MAXIMUM_MAP_SAVE_DATA];
|
||||
byte dimensions[MAXIMUM_MAP_SAVE_DATA/8];
|
||||
uint8_t dimensions[MAXIMUM_MAP_SAVE_DATA/8];
|
||||
|
||||
_MapDataMappings_old();
|
||||
int getDimension(int id);
|
||||
|
||||
@@ -302,10 +302,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr<Player> player, shared_ptr<ItemI
|
||||
if (xd < -size || yd < -size || xd > size || yd > size)
|
||||
{
|
||||
|
||||
if (xd <= -size) x = (byte) (size * 2 + 2.5);
|
||||
if (yd <= -size) y = (byte) (size * 2 + 2.5);
|
||||
if (xd >= size) x = (byte) (size * 2 + 1);
|
||||
if (yd >= size) y = (byte) (size * 2 + 1);
|
||||
if (xd <= -size) x = (uint8_t) (size * 2 + 2.5);
|
||||
if (yd <= -size) y = (uint8_t) (size * 2 + 2.5);
|
||||
if (xd >= size) x = (uint8_t) (size * 2 + 1);
|
||||
if (yd >= size) y = (uint8_t) (size * 2 + 1);
|
||||
}
|
||||
#endif
|
||||
//decorations.push_back(new MapDecoration(4, x, y, 0));
|
||||
@@ -339,10 +339,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr<Player> player, shared_ptr<ItemI
|
||||
if (xd < -size || yd < -size || xd > size || yd > size)
|
||||
{
|
||||
|
||||
if (xd <= -size) x = (byte) (size * 2 + 2.5);
|
||||
if (yd <= -size) y = (byte) (size * 2 + 2.5);
|
||||
if (xd >= size) x = (byte) (size * 2 + 1);
|
||||
if (yd >= size) y = (byte) (size * 2 + 1);
|
||||
if (xd <= -size) x = (uint8_t) (size * 2 + 2.5);
|
||||
if (yd <= -size) y = (uint8_t) (size * 2 + 2.5);
|
||||
if (xd >= size) x = (uint8_t) (size * 2 + 1);
|
||||
if (yd >= size) y = (uint8_t) (size * 2 + 1);
|
||||
}
|
||||
#endif
|
||||
//decorations.push_back(new MapDecoration(7, x, y, 0));
|
||||
@@ -373,10 +373,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr<Player> player, shared_ptr<ItemI
|
||||
if (xd < -size || yd < -size || xd > size || yd > size)
|
||||
{
|
||||
|
||||
if (xd <= -size) x = (byte) (size * 2 + 2.5);
|
||||
if (yd <= -size) y = (byte) (size * 2 + 2.5);
|
||||
if (xd >= size) x = (byte) (size * 2 + 1);
|
||||
if (yd >= size) y = (byte) (size * 2 + 1);
|
||||
if (xd <= -size) x = (uint8_t) (size * 2 + 2.5);
|
||||
if (yd <= -size) y = (uint8_t) (size * 2 + 2.5);
|
||||
if (xd >= size) x = (uint8_t) (size * 2 + 1);
|
||||
if (yd >= size) y = (uint8_t) (size * 2 + 1);
|
||||
}
|
||||
#endif
|
||||
//decorations.push_back(new MapDecoration(7, x, y, 0));
|
||||
@@ -432,10 +432,10 @@ void MapItemSavedData::tickCarriedBy(shared_ptr<Player> player, shared_ptr<ItemI
|
||||
|
||||
rot = 0;
|
||||
size--; // Added to match the old adjusted size
|
||||
if (xd <= -size) x = (byte) (size * 2 + 2.5);
|
||||
if (yd <= -size) y = (byte) (size * 2 + 2.5);
|
||||
if (xd >= size) x = (byte) (size * 2 + 1);
|
||||
if (yd >= size) y = (byte) (size * 2 + 1);
|
||||
if (xd <= -size) x = (uint8_t) (size * 2 + 2.5);
|
||||
if (yd <= -size) y = (uint8_t) (size * 2 + 2.5);
|
||||
if (xd >= size) x = (uint8_t) (size * 2 + 1);
|
||||
if (yd >= size) y = (uint8_t) (size * 2 + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -546,8 +546,8 @@ void MapItemSavedData::mergeInMapData(shared_ptr<MapItemSavedData> dataToAdd)
|
||||
|
||||
for (int z = 0; z < h; z++)
|
||||
{
|
||||
byte oldColor = colors[x + z * w];
|
||||
byte newColor = dataToAdd->colors[x + z * w];
|
||||
uint8_t oldColor = colors[x + z * w];
|
||||
uint8_t newColor = dataToAdd->colors[x + z * w];
|
||||
if (oldColor == 0 && oldColor != newColor)
|
||||
{
|
||||
if (yd0 > z) yd0 = z;
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
public:
|
||||
int x, z;
|
||||
char dimension;
|
||||
byte scale;
|
||||
uint8_t scale;
|
||||
byteArray colors;
|
||||
int step;
|
||||
vector<shared_ptr<HoldingPlayer> > carriedBy;
|
||||
|
||||
@@ -57,10 +57,10 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path)
|
||||
//if ((GetFileSize(file,NULL) & 0xfff) != 0)
|
||||
if ((fileEntry->getFileSize() & 0xfff) != 0)
|
||||
{
|
||||
//byte zero = 0;
|
||||
//uint8_t zero = 0;
|
||||
DWORD numberOfBytesWritten = 0;
|
||||
DWORD bytesToWrite = 0x1000 - (fileEntry->getFileSize() & 0xfff);
|
||||
byte *zeroBytes = new byte[ bytesToWrite ];
|
||||
uint8_t *zeroBytes = new uint8_t[ bytesToWrite ];
|
||||
ZeroMemory(zeroBytes, bytesToWrite);
|
||||
|
||||
/* the file size is not a multiple of 4KB, grow it */
|
||||
@@ -233,8 +233,8 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was
|
||||
}
|
||||
|
||||
MemSect(50);
|
||||
byte *data = new byte[length];
|
||||
byte *decomp = new byte[decompLength];
|
||||
uint8_t *data = new uint8_t[length];
|
||||
uint8_t *decomp = new uint8_t[decompLength];
|
||||
MemSect(0);
|
||||
readDecompLength = decompLength;
|
||||
m_saveFile->readFile(fileEntry,data,length,&numberOfBytesRead);
|
||||
@@ -273,10 +273,10 @@ DataOutputStream *RegionFile::getChunkDataOutputStream(int x, int z)
|
||||
}
|
||||
|
||||
/* write a chunk at (x,z) with length bytes of data to disk */
|
||||
void RegionFile::write(int x, int z, byte *data, int length) // TODO - was synchronized
|
||||
void RegionFile::write(int x, int z, uint8_t *data, int length) // TODO - was synchronized
|
||||
{
|
||||
// 4J Stu - Do the compression here so that we know how much space we need to store the compressed data
|
||||
byte *compData = new byte[length + 2048]; // presuming compression is going to make this smaller... UPDATE - for some really small things this isn't the case. Added 2K on here to cover those.
|
||||
uint8_t *compData = new uint8_t[length + 2048]; // presuming compression is going to make this smaller... UPDATE - for some really small things this isn't the case. Added 2K on here to cover those.
|
||||
unsigned int compLength = length;
|
||||
Compression::getCompression()->CompressLZXRLE(compData,&compLength,data,length);
|
||||
|
||||
@@ -403,7 +403,7 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync
|
||||
}
|
||||
|
||||
/* write a chunk data to the region file at specified sector number */
|
||||
void RegionFile::write(int sectorNumber, byte *data, int length, unsigned int compLength)
|
||||
void RegionFile::write(int sectorNumber, uint8_t *data, int length, unsigned int compLength)
|
||||
{
|
||||
DWORD numberOfBytesWritten = 0;
|
||||
//SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN);
|
||||
@@ -451,7 +451,7 @@ void RegionFile::insertInitialSectors()
|
||||
{
|
||||
m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_BEGIN );
|
||||
DWORD numberOfBytesWritten = 0;
|
||||
byte zeroBytes[ SECTOR_BYTES ];
|
||||
uint8_t zeroBytes[ SECTOR_BYTES ];
|
||||
ZeroMemory(zeroBytes, SECTOR_BYTES);
|
||||
|
||||
/* we need to write the chunk offset table */
|
||||
|
||||
@@ -71,11 +71,11 @@ public:
|
||||
|
||||
/* write a chunk at (x,z) with length bytes of data to disk */
|
||||
protected:
|
||||
void write(int x, int z, byte *data, int length);
|
||||
void write(int x, int z, uint8_t *data, int length);
|
||||
|
||||
/* write a chunk data to the region file at specified sector number */
|
||||
private:
|
||||
void write(int sectorNumber, byte *data, int length, unsigned int compLength);
|
||||
void write(int sectorNumber, uint8_t *data, int length, unsigned int compLength);
|
||||
void zero(int sectorNumber, int length); // 4J added
|
||||
|
||||
/* is this an invalid chunk coordinate? */
|
||||
|
||||
Reference in New Issue
Block a user