summaryrefslogtreecommitdiff
path: root/src/mapblock_mesh.cpp
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2014-12-10 00:45:07 +1000
committerCraig Robbins <kde.psych@gmail.com>2014-12-10 00:52:02 +1000
commitc5f6f9f77ac1df4b223649fcaca9a66333aa8786 (patch)
tree87c5efb5da53fb26c1cfca4ab717258ab12ad897 /src/mapblock_mesh.cpp
parenta1ea017b512ea8f99c40dca52a57ff58054c5acc (diff)
downloadminetest-c5f6f9f77ac1df4b223649fcaca9a66333aa8786.tar.gz
minetest-c5f6f9f77ac1df4b223649fcaca9a66333aa8786.tar.bz2
minetest-c5f6f9f77ac1df4b223649fcaca9a66333aa8786.zip
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%
Diffstat (limited to 'src/mapblock_mesh.cpp')
-rw-r--r--src/mapblock_mesh.cpp4
1 files changed, 2 insertions, 2 deletions
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++;