1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-06 17:41:04 +00:00

Cache grouped sparse buffers (#15594)

continuation of #15531
This commit is contained in:
sfan5 2025-01-14 23:40:57 +01:00 committed by GitHub
parent 7053348e31
commit cf074dd271
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 178 additions and 61 deletions

View file

@ -170,13 +170,11 @@ private:
/*
Holds a mesh for a mapblock.
Besides the SMesh*, this contains information used for animating
the vertex positions, colors and texture coordinates of the mesh.
Besides the SMesh*, this contains information used fortransparency sorting
and texture animation.
For example:
- cracks [implemented]
- day/night transitions [implemented]
- animated flowing liquids [not implemented]
- animating vertex positions for e.g. axles [not implemented]
- cracks
- day/night transitions
*/
class MapBlockMesh
{
@ -193,13 +191,17 @@ public:
// Returns true if anything has been changed.
bool animate(bool faraway, float time, int crack, u32 daynight_ratio);
/// @warning ClientMap requires that the vertex and index data is not modified
scene::IMesh *getMesh()
{
return m_mesh[0].get();
}
/// @param layer layer index
/// @warning ClientMap requires that the vertex and index data is not modified
scene::IMesh *getMesh(u8 layer)
{
assert(layer < MAX_TILE_LAYERS);
return m_mesh[layer].get();
}