aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-06-20 21:24:28 +0200
committerGitHub <noreply@github.com>2022-06-20 21:24:28 +0200
commit0b41533763bc9f104a2da2e4191f4654b8d8dab4 (patch)
tree40e0ee5b892b1a81500ad666456b60a8e1341d51 /src/mapgen/mapgen.cpp
parente92a217bd19ee0b28890a7b33e5c6d7c037354cc (diff)
downloadhax-minetest-server-0b41533763bc9f104a2da2e4191f4654b8d8dab4.tar.gz
hax-minetest-server-0b41533763bc9f104a2da2e4191f4654b8d8dab4.zip
Annotate light spread functions with comments
Diffstat (limited to 'src/mapgen/mapgen.cpp')
-rw-r--r--src/mapgen/mapgen.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp
index 1f2ac491e..cca036b7b 100644
--- a/src/mapgen/mapgen.cpp
+++ b/src/mapgen/mapgen.cpp
@@ -453,9 +453,8 @@ void Mapgen::lightSpread(VoxelArea &a, std::queue<std::pair<v3s16, u8>> &queue,
!ndef->get(n).light_propagates)
return;
- // Since this recursive function only terminates when there is no light from
- // either bank left, we need to take the max of both banks into account for
- // the case where spreading has stopped for one light bank but not the other.
+ // MYMAX still needed here because we only exit early if both banks have
+ // nothing to propagate anymore.
light = MYMAX(light_day, n.param1 & 0x0F) |
MYMAX(light_night, n.param1 & 0xF0);
@@ -470,12 +469,9 @@ void Mapgen::calcLighting(v3s16 nmin, v3s16 nmax, v3s16 full_nmin, v3s16 full_nm
bool propagate_shadow)
{
ScopeProfiler sp(g_profiler, "EmergeThread: update lighting", SPT_AVG);
- //TimeTaker t("updateLighting");
propagateSunlight(nmin, nmax, propagate_shadow);
spreadLight(full_nmin, full_nmax);
-
- //printf("updateLighting: %dms\n", t.stop());
}