From 74125a74d34e9b1a003107d4ef6b95b8483d2464 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 28 Apr 2021 11:07:28 +0200 Subject: refacto: hide mesh_cache inside the rendering engine This permit cleaner access to meshCache and ensure we don't access to it from all the code --- src/client/renderingengine.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/client/renderingengine.cpp') diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp index 970bcf95b..da9022477 100644 --- a/src/client/renderingengine.cpp +++ b/src/client/renderingengine.cpp @@ -225,12 +225,17 @@ bool RenderingEngine::print_video_modes() return videomode_list != NULL; } +void RenderingEngine::removeMesh(const irr::scene::IMesh* mesh) +{ + m_device->getSceneManager()->getMeshCache()->removeMesh(mesh); +} + void RenderingEngine::cleanupMeshCache() { auto mesh_cache = m_device->getSceneManager()->getMeshCache(); while (mesh_cache->getMeshCount() != 0) { if (scene::IAnimatedMesh *mesh = mesh_cache->getMeshByIndex(0)) - m_rendering_engine->get_mesh_cache()->removeMesh(mesh); + mesh_cache->removeMesh(mesh); } } -- cgit v1.2.3