mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Use Irrlicht's mesh cache for animated meshes.
Fixes #6676. Allow animated meshes to be cached in Irrlicht's builtin mesh cache. Use Material.EmmissiveColor instead of manipulating the mesh' vertex colors.
This commit is contained in:
@@ -1836,7 +1836,7 @@ ParticleManager* Client::getParticleManager()
|
||||
return &m_particle_manager;
|
||||
}
|
||||
|
||||
scene::IAnimatedMesh* Client::getMesh(const std::string &filename)
|
||||
scene::IAnimatedMesh* Client::getMesh(const std::string &filename, bool cache)
|
||||
{
|
||||
StringMap::const_iterator it = m_mesh_data.find(filename);
|
||||
if (it == m_mesh_data.end()) {
|
||||
@@ -1855,10 +1855,9 @@ scene::IAnimatedMesh* Client::getMesh(const std::string &filename)
|
||||
|
||||
scene::IAnimatedMesh *mesh = RenderingEngine::get_scene_manager()->getMesh(rfile);
|
||||
rfile->drop();
|
||||
// NOTE: By playing with Irrlicht refcounts, maybe we could cache a bunch
|
||||
// of uniquely named instances and re-use them
|
||||
mesh->grab();
|
||||
RenderingEngine::get_mesh_cache()->removeMesh(mesh);
|
||||
if (!cache)
|
||||
RenderingEngine::get_mesh_cache()->removeMesh(mesh);
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user