summaryrefslogtreecommitdiff
path: root/src/mapgen.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2015-01-05 01:18:53 -0500
committerkwolekr <kwolekr@minetest.net>2015-01-05 01:20:36 -0500
commit7289d61e99625b46eb2c4d6b90a2a5de42f207e6 (patch)
tree1a383f05cda6a085e07734c308efed80c2d3b2e8 /src/mapgen.cpp
parent00bca11f5988cfe7ce019c15c056ae258c254023 (diff)
downloadminetest-7289d61e99625b46eb2c4d6b90a2a5de42f207e6.tar.gz
minetest-7289d61e99625b46eb2c4d6b90a2a5de42f207e6.tar.bz2
minetest-7289d61e99625b46eb2c4d6b90a2a5de42f207e6.zip
Optionally specify propagateSunlight area in calcLighting
This fixes the Mapgen V5 calcLighting segfault
Diffstat (limited to 'src/mapgen.cpp')
-rw-r--r--src/mapgen.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index d61e56819..3f83d2178 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -202,7 +202,7 @@ void Mapgen::updateLiquid(UniqueQueue<v3s16> *trans_liquid, v3s16 nmin, v3s16 nm
}
-void Mapgen::setLighting(v3s16 nmin, v3s16 nmax, u8 light)
+void Mapgen::setLighting(u8 light, v3s16 nmin, v3s16 nmax)
{
ScopeProfiler sp(g_profiler, "EmergeThread: mapgen lighting update", SPT_AVG);
VoxelArea a(nmin, nmax);
@@ -241,6 +241,19 @@ void Mapgen::lightSpread(VoxelArea &a, v3s16 p, u8 light)
}
+void Mapgen::calcLighting(v3s16 nmin, v3s16 nmax, v3s16 full_nmin, v3s16 full_nmax)
+{
+ ScopeProfiler sp(g_profiler, "EmergeThread: mapgen lighting update", SPT_AVG);
+ //TimeTaker t("updateLighting");
+
+ propagateSunlight(nmin, nmax);
+ spreadLight(full_nmin, full_nmax);
+
+ //printf("updateLighting: %dms\n", t.stop());
+}
+
+
+
void Mapgen::calcLighting(v3s16 nmin, v3s16 nmax)
{
ScopeProfiler sp(g_profiler, "EmergeThread: mapgen lighting update", SPT_AVG);