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

refacto: RenderingEngine::get_scene_manager() is now not callable from singleton

This permits to make evidence that we have some bad object passing on various code parts. I fixed majority of them to reduce the scope of passed objects

Unfortunately, for some edge cases i should have to expose ISceneManager from client, this should be fixed in the future when our POO will be cleaner client side (we have a mix of rendering and processing in majority of the client objects, it works but it's not clean)
This commit is contained in:
Loic Blot 2021-04-29 09:40:56 +02:00 committed by Loïc Blot
parent ccdd886e27
commit 5a02c376ea
11 changed files with 28 additions and 23 deletions

View file

@ -60,18 +60,16 @@ static constexpr u16 quad_indices[] = {0, 1, 2, 2, 3, 0};
const std::string MapblockMeshGenerator::raillike_groupname = "connect_to_raillike";
MapblockMeshGenerator::MapblockMeshGenerator(MeshMakeData *input, MeshCollector *output)
MapblockMeshGenerator::MapblockMeshGenerator(MeshMakeData *input, MeshCollector *output,
irr::scene::IMeshManipulator *mm):
data(input),
collector(output),
nodedef(data->m_client->ndef()),
meshmanip(mm),
blockpos_nodes(data->m_blockpos * MAP_BLOCKSIZE)
{
data = input;
collector = output;
nodedef = data->m_client->ndef();
meshmanip = RenderingEngine::get_scene_manager()->getMeshManipulator();
enable_mesh_cache = g_settings->getBool("enable_mesh_cache") &&
!data->m_smooth_lighting; // Mesh cache is not supported with smooth lighting
blockpos_nodes = data->m_blockpos * MAP_BLOCKSIZE;
}
void MapblockMeshGenerator::useTile(int index, u8 set_flags, u8 reset_flags, bool special)