feat: TU0 leafs

This commit is contained in:
str1k3r committed 2026-10-10 13:45:33 -04:00
1 parent 6315c27226
commit 32b2e4f50e
4 files changed
+1 -80

No files matched your search

-22
View File
@@ -2946,28 +2946,6 @@ bool Level::isSolidRenderTile(int x, int y, int z)
Tile *tile = Tile::tiles[getTile(x, y, z)];
if (tile == NULL) return false;
// 4J - addition here to make rendering big blocks of leaves more efficient. Normally leaves never consider themselves as solid, so
// blocks of leaves will have all sides of each block completely visible. Changing to consider as solid if this block is surrounded by
// other leaves (or solid things). This is paired with another change in Tile::getTexture which makes such solid tiles actually visibly solid (these
// textures exist already for non-fancy graphics). Note: this tile-specific code is here rather than making some new virtual method in the tiles,
// for the sake of efficiency - I don't imagine we'll be doing much more of this sort of thing
if( tile->id == Tile::leaves_Id )
{
int axo[6] = { 1,-1, 0, 0, 0, 0};
int ayo[6] = { 0, 0, 1,-1, 0, 0};
int azo[6] = { 0, 0, 0, 0, 1,-1};
for( int i = 0; i < 6; i++ )
{
int t = getTile(x + axo[i], y + ayo[i] , z + azo[i]);
if( ( t != Tile::leaves_Id ) && ( ( Tile::tiles[t] == NULL ) || !Tile::tiles[t]->isSolidRender() ) )
{
return false;
}
}
return true;
}
return tile->isSolidRender(!isClientSide);
}