From c5f6f9f77ac1df4b223649fcaca9a66333aa8786 Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Wed, 10 Dec 2014 00:45:07 +1000 Subject: Increase performance of getLight() by at least 2x Leads to the following increases: getSmoothLight() approx. 40% increase getTileInfo() approx. 25% increase MapBlockMesh::MapBlockMesh() 25-30% --- src/mapblock_mesh.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mapblock_mesh.cpp') diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp index 0ca24a1f9..29b0e92f5 100644 --- a/src/mapblock_mesh.cpp +++ b/src/mapblock_mesh.cpp @@ -259,8 +259,8 @@ static u16 getSmoothLightCombined(v3s16 p, MeshMakeData *data) light_source_max = f.light_source; // Check f.solidness because fast-style leaves look better this way if (f.param_type == CPT_LIGHT && f.solidness != 2) { - light_day += decode_light(n.getLight(LIGHTBANK_DAY, ndef)); - light_night += decode_light(n.getLight(LIGHTBANK_NIGHT, ndef)); + light_day += decode_light(n.getLightNoChecks(LIGHTBANK_DAY, &f)); + light_night += decode_light(n.getLightNoChecks(LIGHTBANK_NIGHT, &f)); light_count++; } else { ambient_occlusion++; -- cgit v1.2.3