aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen.cpp
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-10-09 10:50:26 -0400
committerGitHub <noreply@github.com>2022-10-09 10:50:26 -0400
commit9676364c1fe5fe5eae69c55e7d7a45392decfb2d (patch)
treeb21c99ce54820b24bfef9028c39b01f28ed3c1ca /src/mapgen/mapgen.cpp
parent440d966b939059dfa51604eb68d61eecb12baeb4 (diff)
downloadminetest-9676364c1fe5fe5eae69c55e7d7a45392decfb2d.tar.xz
Optimize lighting calculation (#12797)
Diffstat (limited to 'src/mapgen/mapgen.cpp')
-rw-r--r--src/mapgen/mapgen.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp
index 99db50426..943ac4c4f 100644
--- a/src/mapgen/mapgen.cpp
+++ b/src/mapgen/mapgen.cpp
@@ -450,7 +450,7 @@ void Mapgen::lightSpread(VoxelArea &a, std::queue<std::pair<v3s16, u8>> &queue,
// we hit a solid block that light cannot pass through.
if ((light_day <= (n.param1 & 0x0F) &&
light_night <= (n.param1 & 0xF0)) ||
- !ndef->get(n).light_propagates)
+ !ndef->getLightingFlags(n).light_propagates)
return;
// MYMAX still needed here because we only exit early if both banks have
@@ -500,7 +500,7 @@ void Mapgen::propagateSunlight(v3s16 nmin, v3s16 nmax, bool propagate_shadow)
for (int y = a.MaxEdge.Y; y >= a.MinEdge.Y; y--) {
MapNode &n = vm->m_data[i];
- if (!ndef->get(n).sunlight_propagates)
+ if (!ndef->getLightingFlags(n).sunlight_propagates)
break;
n.param1 = LIGHT_SUN;
VoxelArea::add_y(em, i, -1);
@@ -525,7 +525,7 @@ void Mapgen::spreadLight(const v3s16 &nmin, const v3s16 &nmax)
if (n.getContent() == CONTENT_IGNORE)
continue;
- const ContentFeatures &cf = ndef->get(n);
+ ContentLightingFlags cf = ndef->getLightingFlags(n);
if (!cf.light_propagates)
continue;