summaryrefslogtreecommitdiff
path: root/src/mapnode.h
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2015-02-07 17:52:56 +1000
committerLoic Blot <loic.blot@unix-experience.fr>2015-02-10 16:23:37 +0100
commitcaf8d2a9d16a313bbc86a27ad0642efc76852e9f (patch)
tree9787d5960dc11c3fbe37ab05efb103fcbb3dcddc /src/mapnode.h
parentbb59a8543d44b566d8b39fd4727d552a8d4f3e90 (diff)
downloadminetest-caf8d2a9d16a313bbc86a27ad0642efc76852e9f.tar.gz
minetest-caf8d2a9d16a313bbc86a27ad0642efc76852e9f.tar.bz2
minetest-caf8d2a9d16a313bbc86a27ad0642efc76852e9f.zip
Increase MapBlock::actuallyUpdateDayNightDiff() performance by 2-8x. ok @celeron55
Before patch, function consumes up to ~8% of the main server loop. After, ~0% (below level of 2 places of significance)
Diffstat (limited to 'src/mapnode.h')
-rw-r--r--src/mapnode.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mapnode.h b/src/mapnode.h
index 82c53e7d4..b7d9f3acd 100644
--- a/src/mapnode.h
+++ b/src/mapnode.h
@@ -192,6 +192,14 @@ struct MapNode
}
void setLight(enum LightBank bank, u8 a_light, INodeDefManager *nodemgr);
+
+ /**
+ * Check if the light value for night differs from the light value for day.
+ *
+ * @return If the light values are equal, returns true; otherwise false
+ */
+ bool isLightDayNightEq(INodeDefManager *nodemgr) const;
+
u8 getLight(enum LightBank bank, INodeDefManager *nodemgr) const;
/**