From c071efaa43ad3dcba7d60a7a67e942aae2a7dc83 Mon Sep 17 00:00:00 2001 From: Dániel Juhász Date: Thu, 20 Oct 2016 21:41:38 +0200 Subject: Improved lighting This commit rewrites the procedure that is responsible for light updating. this commit -provides iterative solutions for unlighting and light spreading -introduces a new priority queue-like container for the iteration -creates per-node MapBlock caching to reduce retrieving MapBlocks from the map -calculates with map block positions and in-block relative node coordinates -skips light updating if it is not necessary since the node's new light will be the same as its old light was --- src/map.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/map.h') diff --git a/src/map.h b/src/map.h index c73fa92bf..e8d40e982 100644 --- a/src/map.h +++ b/src/map.h @@ -211,24 +211,10 @@ public: std::set & light_sources, std::map & modified_blocks); - void unLightNeighbors(enum LightBank bank, - v3s16 pos, u8 lightwas, - std::set & light_sources, - std::map & modified_blocks); - void spreadLight(enum LightBank bank, std::set & from_nodes, std::map & modified_blocks); - - void lightNeighbors(enum LightBank bank, - v3s16 pos, - std::map & modified_blocks); - - v3s16 getBrightestNeighbour(enum LightBank bank, v3s16 p); - - s16 propagateSunlight(v3s16 start, - std::map & modified_blocks); - + void updateLighting(enum LightBank bank, std::map & a_blocks, std::map & modified_blocks); -- cgit v1.2.3