From caf8d2a9d16a313bbc86a27ad0642efc76852e9f Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Sat, 7 Feb 2015 17:52:56 +1000 Subject: 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) --- src/mapnode.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mapnode.h') 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; /** -- cgit v1.2.3