1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00

Refactor meshgen-related code

This commit is contained in:
sfan5 2025-06-23 12:30:44 +02:00
parent 0ea89d4112
commit 6545710c8e
6 changed files with 95 additions and 61 deletions

View file

@ -212,6 +212,20 @@ public:
return minimap_mapblocks;
}
/// @return true if the mesh contains nothing to draw
bool isEmpty() const
{
if (!m_transparent_triangles.empty())
return false;
for (auto &mesh : m_mesh) {
for (u32 i = 0; i < mesh->getMeshBufferCount(); i++) {
if (mesh->getMeshBuffer(i)->getIndexCount() != 0)
return false;
}
}
return true;
}
bool isAnimationForced() const
{
return m_animation_force_timer == 0;
@ -242,7 +256,7 @@ public:
/// get the list of transparent buffers
const std::vector<PartialMeshBuffer> &getTransparentBuffers() const
{
return this->m_transparent_buffers;
return m_transparent_buffers;
}
private: