mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-23 09:36:02 +00:00
Standardise fixed-width integer usage in touched files
This commit is contained in:
@@ -164,11 +164,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 = (uint8_t) Tile::rock_Id;
|
||||
tileId = (std::uint8_t) Tile::rock_Id;
|
||||
}
|
||||
else if (yc * CHUNK_HEIGHT + y < waterHeight)
|
||||
{
|
||||
tileId = (uint8_t) Tile::calmWater_Id;
|
||||
tileId = (std::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
|
||||
@@ -226,8 +226,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
|
||||
int run = -1;
|
||||
|
||||
uint8_t top = b->topMaterial;
|
||||
uint8_t material = b->material;
|
||||
std::uint8_t top = b->topMaterial;
|
||||
std::uint8_t material = b->material;
|
||||
|
||||
LevelGenerationOptions *lgo = app.getLevelGenerationOptions();
|
||||
if(lgo != NULL)
|
||||
@@ -250,7 +250,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] = (uint8_t) Tile::unbreakable_Id;
|
||||
blocks[offs] = (std::uint8_t) Tile::unbreakable_Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -267,7 +267,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
if (runDepth <= 0)
|
||||
{
|
||||
top = 0;
|
||||
material = (uint8_t) Tile::rock_Id;
|
||||
material = (std::uint8_t) Tile::rock_Id;
|
||||
}
|
||||
else if (y >= waterHeight - 4 && y <= waterHeight + 1)
|
||||
{
|
||||
@@ -281,8 +281,8 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
|
||||
if (y < waterHeight && top == 0)
|
||||
{
|
||||
if (temp < 0.15f) top = (uint8_t) Tile::ice_Id;
|
||||
else top = (uint8_t) Tile::calmWater_Id;
|
||||
if (temp < 0.15f) top = (std::uint8_t) Tile::ice_Id;
|
||||
else top = (std::uint8_t) Tile::calmWater_Id;
|
||||
}
|
||||
|
||||
run = runDepth;
|
||||
@@ -299,7 +299,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi
|
||||
if (run == 0 && material == Tile::sand_Id)
|
||||
{
|
||||
run = random->nextInt(4);
|
||||
material = (uint8_t) Tile::sandStone_Id;
|
||||
material = (std::uint8_t) Tile::sandStone_Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,7 +328,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;
|
||||
uint8_t *tileData = (uint8_t *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE);
|
||||
std::uint8_t *tileData = (std::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);
|
||||
|
||||
Reference in New Issue
Block a user