diff options
Diffstat (limited to 'src/client/mapblock_mesh.cpp')
-rw-r--r-- | src/client/mapblock_mesh.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/src/client/mapblock_mesh.cpp b/src/client/mapblock_mesh.cpp index fbd7e2ab7..f65864599 100644 --- a/src/client/mapblock_mesh.cpp +++ b/src/client/mapblock_mesh.cpp @@ -818,9 +818,9 @@ static void getTileInfo( u16 *lights, u8 &waving, TileSpec &tile, + // lol more Input bool xray, - std::set<content_t> xraySet - ) + std::set<content_t> xraySet) { VoxelManipulator &vmanip = data->m_vmanip; const NodeDefManager *ndef = data->m_client->ndef(); @@ -831,7 +831,6 @@ static void getTileInfo( content_t c0 = n0.getContent(); if (xray && xraySet.find(c0) != xraySet.end()) c0 = CONTENT_AIR; - // Don't even try to get n1 if n0 is already CONTENT_IGNORE if (c0 == CONTENT_IGNORE) { makes_face = false; @@ -946,7 +945,7 @@ static void updateFastFaceRow( // the face must be drawn anyway if (j != MAP_BLOCKSIZE - 1) { p += translate_dir; - + getTileInfo(data, p, face_dir, next_makes_face, next_p_corrected, next_face_dir_corrected, next_lights, @@ -954,7 +953,7 @@ static void updateFastFaceRow( next_tile, xray, xraySet); - + if (next_makes_face == makes_face && next_p_corrected == p_corrected + translate_dir && next_face_dir_corrected == face_dir_corrected @@ -1096,10 +1095,12 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset): X-Ray */ bool xray = g_settings->getBool("xray"); - std::set<content_t> xraySet; + std::set<content_t> xraySet, nodeESPSet; if (xray) xraySet = splitToContentT(g_settings->get("xray_nodes"), data->m_client->ndef()); + nodeESPSet = splitToContentT(g_settings->get("node_esp_nodes"), data->m_client->ndef()); + /* We are including the faces of the trailing edges of the block. This means that when something changes, the caller must @@ -1115,6 +1116,23 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset): // End of slow part /* + NodeESP + */ + { + v3s16 blockpos_nodes = data->m_blockpos * MAP_BLOCKSIZE; + for (s16 x = 0; x < MAP_BLOCKSIZE; x++) { + for (s16 y = 0; y < MAP_BLOCKSIZE; y++) { + for (s16 z = 0; z < MAP_BLOCKSIZE; z++) { + v3s16 pos = v3s16(x, y, z) + blockpos_nodes; + const MapNode &node = data->m_vmanip.getNodeRefUnsafeCheckFlags(pos); + if (nodeESPSet.find(node.getContent()) != nodeESPSet.end()) + esp_nodes.insert(pos); + } + } + } + } + + /* Convert FastFaces to MeshCollector */ |