aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornumber Zero <silverunicorn2011@yandex.ru>2017-07-16 23:43:01 +0300
committerparamat <mat.gregory@virginmedia.com>2017-07-17 20:13:53 +0100
commit20936e1c3e3ccc0bea2fbf212ebfff11f3cda8c3 (patch)
treeb1dd5b9d3acbb6083325170e94be868d4deaa188
parentd3d3638f48211689c3f548b1e6b9d38f53d0c330 (diff)
downloadminetest-20936e1c3e3ccc0bea2fbf212ebfff11f3cda8c3.tar.gz
minetest-20936e1c3e3ccc0bea2fbf212ebfff11f3cda8c3.tar.bz2
minetest-20936e1c3e3ccc0bea2fbf212ebfff11f3cda8c3.zip
Mesh generation: Fix performance regression caused by 'plantlike_rooted' PR
Regression caused by ef285b2815962a7a01791059ed984cb12fdba4dd
-rw-r--r--src/content_mapblock.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index 8eedade6e..935240dae 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -1288,14 +1288,21 @@ void MapblockMeshGenerator::errorUnknownDrawtype()
void MapblockMeshGenerator::drawNode()
{
+ // skip some drawtypes early
+ switch (f->drawtype) {
+ case NDT_NORMAL: // Drawn by MapBlockMesh
+ case NDT_AIRLIKE: // Not drawn at all
+ case NDT_LIQUID: // Drawn by MapBlockMesh
+ return;
+ default:
+ break;
+ }
+ origin = intToFloat(p, BS);
if (data->m_smooth_lighting)
getSmoothLightFrame();
else
light = getInteriorLight(n, 1, nodedef);
switch (f->drawtype) {
- case NDT_NORMAL: break; // Drawn by MapBlockMesh
- case NDT_AIRLIKE: break; // Not drawn at all
- case NDT_LIQUID: break; // Drawn by MapBlockMesh
case NDT_FLOWINGLIQUID: drawLiquidNode(); break;
case NDT_GLASSLIKE: drawGlasslikeNode(); break;
case NDT_GLASSLIKE_FRAMED: drawGlasslikeFramedNode(); break;
@@ -1324,7 +1331,6 @@ void MapblockMeshGenerator::generate()
for (p.X = 0; p.X < MAP_BLOCKSIZE; p.X++) {
n = data->m_vmanip.getNodeNoEx(blockpos_nodes + p);
f = &nodedef->get(n);
- origin = intToFloat(p, BS);
drawNode();
}
}