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

@@ -32,13 +32,13 @@ void Chunk::CreateNewThreadStorage()
void Chunk::ReleaseThreadStorage()
{
unsigned char *tileIds = static_cast<unsigned char *>(TlsGetValue(tlsIdx));
unsigned char *tileIds = (unsigned char *)TlsGetValue(tlsIdx);
delete tileIds;
}
unsigned char *Chunk::GetTileIdsStorage()
{
unsigned char *tileIds = static_cast<unsigned char *>(TlsGetValue(tlsIdx));
unsigned char *tileIds = (unsigned char *)TlsGetValue(tlsIdx);
return tileIds;
}
#else
@@ -148,7 +148,7 @@ void Chunk::setPos(int x, int y, int z)
void Chunk::translateToPos()
{
glTranslatef(static_cast<float>(xRenderOffs), static_cast<float>(yRenderOffs), static_cast<float>(zRenderOffs));
glTranslatef((float)xRenderOffs, (float)yRenderOffs, (float)zRenderOffs);
}
@@ -173,7 +173,7 @@ void Chunk::makeCopyForRebuild(Chunk *source)
this->ym = source->ym;
this->zm = source->zm;
this->bb = source->bb;
this->clipChunk = nullptr;
this->clipChunk = NULL;
this->id = source->id;
this->globalRenderableTileEntities = source->globalRenderableTileEntities;
this->globalRenderableTileEntities_cs = source->globalRenderableTileEntities_cs;
@@ -399,7 +399,7 @@ void Chunk::rebuild()
glTranslatef(zs / 2.0f, ys / 2.0f, zs / 2.0f);
#endif
t->begin();
t->offset(static_cast<float>(-this->x), static_cast<float>(-this->y), static_cast<float>(-this->z));
t->offset((float)(-this->x), (float)(-this->y), (float)(-this->z));
}
Tile *tile = Tile::tiles[tileId];
@@ -521,7 +521,7 @@ void Chunk::rebuild()
else
{
// Easy case - nothing already existing for this chunk. Add them all in.
for( size_t i = 0; i < renderableTileEntities.size(); i++ )
for( int i = 0; i < renderableTileEntities.size(); i++ )
{
(*globalRenderableTileEntities)[key].push_back(renderableTileEntities[i]);
}
@@ -680,7 +680,7 @@ void Chunk::rebuild_SPU()
// render chunk is 16 x 16 x 16. We wouldn't have to actually get all of it if the data was ordered differently, but currently
// it is ordered by x then z then y so just getting a small range of y out of it would involve getting the whole thing into
// the cache anyway.
ChunkRebuildData* pOutData = nullptr;
ChunkRebuildData* pOutData = NULL;
g_rebuildDataIn.buildForChunk(&region, level, x0, y0, z0);
Tesselator::Bounds bounds;
@@ -826,7 +826,7 @@ void Chunk::rebuild_SPU()
}
// Now go through the current list. If these are already in the list, then unflag the remove flag. If they aren't, then add
for( size_t i = 0; i < renderableTileEntities.size(); i++ )
for( int i = 0; i < renderableTileEntities.size(); i++ )
{
auto it2 = find( it->second.begin(), it->second.end(), renderableTileEntities[i] );
if( it2 == it->second.end() )
@@ -842,7 +842,7 @@ void Chunk::rebuild_SPU()
else
{
// Easy case - nothing already existing for this chunk. Add them all in.
for( size_t i = 0; i < renderableTileEntities.size(); i++ )
for( int i = 0; i < renderableTileEntities.size(); i++ )
{
(*globalRenderableTileEntities)[key].push_back(renderableTileEntities[i]);
}
@@ -936,17 +936,17 @@ void Chunk::rebuild_SPU()
float Chunk::distanceToSqr(shared_ptr<Entity> player) const
{
float xd = static_cast<float>(player->x - xm);
float yd = static_cast<float>(player->y - ym);
float zd = static_cast<float>(player->z - zm);
float xd = (float) (player->x - xm);
float yd = (float) (player->y - ym);
float zd = (float) (player->z - zm);
return xd * xd + yd * yd + zd * zd;
}
float Chunk::squishedDistanceToSqr(shared_ptr<Entity> player)
{
float xd = static_cast<float>(player->x - xm);
float yd = static_cast<float>(player->y - ym) * 2;
float zd = static_cast<float>(player->z - zm);
float xd = (float) (player->x - xm);
float yd = (float) (player->y - ym) * 2;
float zd = (float) (player->z - zm);
return xd * xd + yd * yd + zd * zd;
}
@@ -981,7 +981,7 @@ void Chunk::reset()
void Chunk::_delete()
{
reset();
level = nullptr;
level = NULL;
}
int Chunk::getList(int layer)