Skip to content

Commit 20936e1

Browse files
numberZeroparamat
authored andcommittedJul 17, 2017
Mesh generation: Fix performance regression caused by 'plantlike_rooted' PR
Regression caused by ef285b2
1 parent d3d3638 commit 20936e1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎src/content_mapblock.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -1288,14 +1288,21 @@ void MapblockMeshGenerator::errorUnknownDrawtype()
12881288

12891289
void MapblockMeshGenerator::drawNode()
12901290
{
1291+
// skip some drawtypes early
1292+
switch (f->drawtype) {
1293+
case NDT_NORMAL: // Drawn by MapBlockMesh
1294+
case NDT_AIRLIKE: // Not drawn at all
1295+
case NDT_LIQUID: // Drawn by MapBlockMesh
1296+
return;
1297+
default:
1298+
break;
1299+
}
1300+
origin = intToFloat(p, BS);
12911301
if (data->m_smooth_lighting)
12921302
getSmoothLightFrame();
12931303
else
12941304
light = getInteriorLight(n, 1, nodedef);
12951305
switch (f->drawtype) {
1296-
case NDT_NORMAL: break; // Drawn by MapBlockMesh
1297-
case NDT_AIRLIKE: break; // Not drawn at all
1298-
case NDT_LIQUID: break; // Drawn by MapBlockMesh
12991306
case NDT_FLOWINGLIQUID: drawLiquidNode(); break;
13001307
case NDT_GLASSLIKE: drawGlasslikeNode(); break;
13011308
case NDT_GLASSLIKE_FRAMED: drawGlasslikeFramedNode(); break;
@@ -1324,7 +1331,6 @@ void MapblockMeshGenerator::generate()
13241331
for (p.X = 0; p.X < MAP_BLOCKSIZE; p.X++) {
13251332
n = data->m_vmanip.getNodeNoEx(blockpos_nodes + p);
13261333
f = &nodedef->get(n);
1327-
origin = intToFloat(p, BS);
13281334
drawNode();
13291335
}
13301336
}

0 commit comments

Comments
 (0)
Please sign in to comment.