1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Annotate light spread functions with comments

This commit is contained in:
sfan5 2022-06-20 21:24:28 +02:00 committed by GitHub
parent e92a217bd1
commit 0b41533763
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 8 deletions

View file

@ -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());
}