From 7289d61e99625b46eb2c4d6b90a2a5de42f207e6 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Mon, 5 Jan 2015 01:18:53 -0500 Subject: Optionally specify propagateSunlight area in calcLighting This fixes the Mapgen V5 calcLighting segfault --- src/mapgen.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/mapgen.cpp') 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 *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); -- cgit v1.2.3