aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/TheEndLevelRandomLevelSource.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/TheEndLevelRandomLevelSource.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (diff)
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.World/TheEndLevelRandomLevelSource.cpp')
-rw-r--r--Minecraft.World/TheEndLevelRandomLevelSource.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/TheEndLevelRandomLevelSource.cpp
index 3b42f8ca..f9f38470 100644
--- a/Minecraft.World/TheEndLevelRandomLevelSource.cpp
+++ b/Minecraft.World/TheEndLevelRandomLevelSource.cpp
@@ -53,7 +53,7 @@ void TheEndLevelRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArra
{
for (int yc = 0; yc < Level::genDepth / CHUNK_HEIGHT; yc++)
{
- double yStep = 1 / static_cast<double>(CHUNK_HEIGHT);
+ double yStep = 1 / (double) CHUNK_HEIGHT;
double s0 = buffer[((xc + 0) * zSize + (zc + 0)) * ySize + (yc + 0)];
double s1 = buffer[((xc + 0) * zSize + (zc + 1)) * ySize + (yc + 0)];
double s2 = buffer[((xc + 1) * zSize + (zc + 0)) * ySize + (yc + 0)];
@@ -66,7 +66,7 @@ void TheEndLevelRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArra
for (int y = 0; y < CHUNK_HEIGHT; y++)
{
- double xStep = 1 / static_cast<double>(CHUNK_WIDTH);
+ double xStep = 1 / (double) CHUNK_WIDTH;
double _s0 = s0;
double _s1 = s1;
@@ -77,7 +77,7 @@ void TheEndLevelRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArra
{
int offs = (x + xc * CHUNK_WIDTH) << Level::genDepthBitsPlusFour | (0 + zc * CHUNK_WIDTH) << Level::genDepthBits | (yc * CHUNK_HEIGHT + y);
int step = 1 << Level::genDepthBits;
- double zStep = 1 / static_cast<double>(CHUNK_WIDTH);
+ double zStep = 1 / (double) CHUNK_WIDTH;
double val = _s0;
double vala = (_s1 - _s0) * zStep;
@@ -90,7 +90,7 @@ void TheEndLevelRandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArra
} else {
}
- blocks[offs] = static_cast<byte>(tileId);
+ blocks[offs] = (byte) tileId;
offs += step;
val += vala;
}
@@ -139,7 +139,7 @@ void TheEndLevelRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray
if (runDepth <= 0)
{
top = 0;
- material = static_cast<byte>(Tile::endStone_Id);
+ material = (byte) Tile::endStone_Id;
}
run = runDepth;
@@ -169,7 +169,7 @@ LevelChunk *TheEndLevelRandomLevelSource::getChunk(int xOffs, int zOffs)
BiomeArray biomes;
// 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed
unsigned int blocksSize = Level::genDepth * 16 * 16;
- byte *tileData = static_cast<byte *>(XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE));
+ byte *tileData = (byte *)XPhysicalAlloc(blocksSize, MAXULONG_PTR, 4096, PAGE_READWRITE);
XMemSet128(tileData,0,blocksSize);
byteArray blocks = byteArray(tileData,blocksSize);
// byteArray blocks = byteArray(16 * level->depth * 16);
@@ -195,7 +195,7 @@ LevelChunk *TheEndLevelRandomLevelSource::getChunk(int xOffs, int zOffs)
doubleArray TheEndLevelRandomLevelSource::getHeights(doubleArray buffer, int x, int y, int z, int xSize, int ySize, int zSize)
{
- if (buffer.data == nullptr)
+ if (buffer.data == NULL)
{
buffer = doubleArray(xSize * ySize * zSize);
}
@@ -407,16 +407,16 @@ wstring TheEndLevelRandomLevelSource::gatherStats()
vector<Biome::MobSpawnerData *> *TheEndLevelRandomLevelSource::getMobsAt(MobCategory *mobCategory, int x, int y, int z)
{
Biome *biome = level->getBiome(x, z);
- if (biome == nullptr)
+ if (biome == NULL)
{
- return nullptr;
+ return NULL;
}
return biome->getMobs(mobCategory);
}
TilePos *TheEndLevelRandomLevelSource::findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z)
{
- return nullptr;
+ return NULL;
}
void TheEndLevelRandomLevelSource::recreateLogicStructuresForChunk(int chunkX, int chunkZ)