diff --git a/src/client/content_mapblock.cpp b/src/client/content_mapblock.cpp index e9d2fdd1948bb..58f7ebe05cb42 100644 --- a/src/client/content_mapblock.cpp +++ b/src/client/content_mapblock.cpp @@ -1768,7 +1768,11 @@ void MapblockMeshGenerator::generate() for (cur_node.p.Z = 0; cur_node.p.Z < data->side_length; cur_node.p.Z++) for (cur_node.p.Y = 0; cur_node.p.Y < data->side_length; cur_node.p.Y++) for (cur_node.p.X = 0; cur_node.p.X < data->side_length; cur_node.p.X++) { - cur_node.n = data->m_vmanip.getNodeNoEx(blockpos_nodes + cur_node.p); + v3s16 p_abs = blockpos_nodes + cur_node.p; + if (!data->m_vmanip.m_area.contains(p_abs) || + data->m_vmanip.getFlagsRefUnsafe(p_abs) & VMANIP_FLAG_MESHGEN_IGNORE) + continue; + cur_node.n = data->m_vmanip.getNodeNoEx(p_abs); cur_node.f = &nodedef->get(cur_node.n); drawNode(); } diff --git a/src/client/content_mapblock.h b/src/client/content_mapblock.h index 88b0e8a79817f..0d591ff970f23 100644 --- a/src/client/content_mapblock.h +++ b/src/client/content_mapblock.h @@ -10,6 +10,8 @@ struct MeshMakeData; struct MeshCollector; +#define VMANIP_FLAG_MESHGEN_IGNORE VOXELFLAG_CHECKED1 + struct LightPair { u8 lightDay; u8 lightNight; diff --git a/src/client/mapblock_mesh.cpp b/src/client/mapblock_mesh.cpp index 0922b9500baee..ffdbc8f508e57 100644 --- a/src/client/mapblock_mesh.cpp +++ b/src/client/mapblock_mesh.cpp @@ -625,17 +625,21 @@ MapBlockMesh::MapBlockMesh(Client *client, MeshMakeData *data, v3s16 camera_offs v3f offset = intToFloat((data->m_blockpos - mesh_grid.getMeshPos(data->m_blockpos)) * MAP_BLOCKSIZE, BS); MeshCollector collector(m_bounding_sphere_center, offset); - /* - Add special graphics: - - torches - - flowing water - - fences - - whatever - */ + + { //tmp + v3s16 p = v3s16(0, 0, 0); + for (p.Y = 0; p.Y < data->side_length; p.Y++) { + v3s16 p_abs = data->m_blockpos * MAP_BLOCKSIZE + p; + if (!data->m_vmanip.m_area.contains(p_abs)) + continue; + data->m_vmanip.getFlagsRefUnsafe(p_abs) |= VMANIP_FLAG_MESHGEN_IGNORE; + } + } { MapblockMeshGenerator(data, &collector, - client->getSceneManager()->getMeshManipulator()).generate(); + client->getSceneManager()->getMeshManipulator()) + .generate(); } /*