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 a9be52c41a.
This commit is contained in:
Loki Rautio
2026-03-07 21:12:22 -06:00
parent a9be52c41a
commit 087b7e7abf
1373 changed files with 19449 additions and 19903 deletions

View File

@@ -39,7 +39,7 @@ void StrongholdFeature::_init()
// 4J added initialisers
for (int i = 0; i < strongholdPos_length; i++)
{
strongholdPos[i] = nullptr;
strongholdPos[i] = NULL;
}
isSpotSelected = false;
}
@@ -136,11 +136,11 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
}
#endif
int selectedX = static_cast<int>(Math::round(cos(angle) * dist));
int selectedZ = static_cast<int>(Math::round(sin(angle) * dist));
int selectedX = (int) (Math::round(cos(angle) * dist));
int selectedZ = (int) (Math::round(sin(angle) * dist));
TilePos *position = level->getBiomeSource()->findBiome((selectedX << 4) + 8, (selectedZ << 4) + 8, 7 << 4, allowedBiomes, &random);
if (position != nullptr)
if (position != NULL)
{
selectedX = position->x >> 4;
selectedZ = position->z >> 4;
@@ -164,7 +164,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
delete strongholdPos[i];
strongholdPos[i] = new ChunkPos(selectedX, selectedZ);
angle += PI * 2.0 / static_cast<double>(strongholdPos_length);
angle += PI * 2.0 / (double) strongholdPos_length;
}
// 4J Stu - We want to make sure that we have at least one stronghold in this world
@@ -172,7 +172,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
// 4J Stu - Randomise the angles for retries as well
#ifdef _LARGE_WORLDS
angle = random.nextDouble() * PI * 2.0 * circle / static_cast<double>(spread);
angle = random.nextDouble() * PI * 2.0 * circle / (double) spread;
#endif
}
while(!hasFoundValidPos && findAttempts < MAX_STRONGHOLD_ATTEMPTS);
@@ -191,7 +191,7 @@ bool StrongholdFeature::isFeatureChunk(int x, int z,bool bIsSuperflat)
{
bool forcePlacement = false;
LevelGenerationOptions *levelGenOptions = app.getLevelGenerationOptions();
if( levelGenOptions != nullptr )
if( levelGenOptions != NULL )
{
forcePlacement = levelGenOptions->isFeatureChunk(x,z,eFeature_Stronghold);
}
@@ -211,7 +211,7 @@ vector<TilePos> *StrongholdFeature::getGuesstimatedFeaturePositions()
for( int i = 0; i < strongholdPos_length; i++ )
{
ChunkPos *chunkPos = strongholdPos[i];
if (chunkPos != nullptr)
if (chunkPos != NULL)
{
positions->push_back(chunkPos->getMiddleBlockPosition(64));
}
@@ -225,7 +225,7 @@ StructureStart *StrongholdFeature::createStructureStart(int x, int z)
StrongholdStart *start = new StrongholdStart(level, random, x, z);
// 4J - front() was get(0)
while (start->getPieces()->empty() || static_cast<StrongholdPieces::StartPiece *>(start->getPieces()->front())->portalRoomPiece == nullptr)
while (start->getPieces()->empty() || ((StrongholdPieces::StartPiece *) start->getPieces()->front())->portalRoomPiece == NULL)
{
delete start;
// regenerate stronghold without changing seed
@@ -254,7 +254,7 @@ StrongholdFeature::StrongholdStart::StrongholdStart(Level *level, Random *random
vector<StructurePiece *> *pendingChildren = &startRoom->pendingChildren;
while (!pendingChildren->empty())
{
int pos = random->nextInt(static_cast<int>(pendingChildren->size()));
int pos = random->nextInt((int)pendingChildren->size());
auto it = pendingChildren->begin() + pos;
StructurePiece *structurePiece = *it;
pendingChildren->erase(it);