void Mapgen::setLighting(v3s16 nmin, v3s16 nmax, u8 light) {
ScopeProfiler sp(g_profiler, "EmergeThread: mapgen lighting update", SPT_AVG);
- VoxelArea a(nmin - v3s16(1,0,1) * MAP_BLOCKSIZE,
- nmax + v3s16(1,0,1) * MAP_BLOCKSIZE);
+ VoxelArea a(nmin, nmax);
for (int z = a.MinEdge.Z; z <= a.MaxEdge.Z; z++) {
for (int y = a.MinEdge.Y; y <= a.MaxEdge.Y; y++) {
void Mapgen::calcLighting(v3s16 nmin, v3s16 nmax) {
- VoxelArea a(nmin - v3s16(1,0,1) * MAP_BLOCKSIZE,
- nmax + v3s16(1,0,1) * MAP_BLOCKSIZE);
+ VoxelArea a(nmin, nmax);
bool block_is_underground = (water_level >= nmax.Y);
ScopeProfiler sp(g_profiler, "EmergeThread: mapgen lighting update", SPT_AVG);
void Mapgen::calcLightingOld(v3s16 nmin, v3s16 nmax) {
enum LightBank banks[2] = {LIGHTBANK_DAY, LIGHTBANK_NIGHT};
-
- VoxelArea a(nmin - v3s16(1,0,1) * MAP_BLOCKSIZE,
- nmax + v3s16(1,0,1) * MAP_BLOCKSIZE);
+ VoxelArea a(nmin, nmax);
bool block_is_underground = (water_level > nmax.Y);
bool sunlight = !block_is_underground;
updateLiquid(&data->transforming_liquid, node_min, node_max);
// Calculate lighting
- calcLighting(node_min, node_max);
+ calcLighting(node_min - v3s16(1, 0, 1) * MAP_BLOCKSIZE,
+ node_max + v3s16(1, 0, 1) * MAP_BLOCKSIZE);
this->generating = false;
}
}
// Calculate lighting
- calcLighting(node_min, node_max);
+ calcLighting(node_min - v3s16(1, 1, 1) * MAP_BLOCKSIZE,
+ node_max + v3s16(1, 0, 1) * MAP_BLOCKSIZE);
this->generating = false;
}
//printf("makeChunk: %dms\n", t.stop());
updateLiquid(&data->transforming_liquid, full_node_min, full_node_max);
- calcLighting(node_min, node_max);
+
+ calcLighting(node_min - v3s16(1, 0, 1) * MAP_BLOCKSIZE,
+ node_max + v3s16(1, 0, 1) * MAP_BLOCKSIZE);
//setLighting(node_min, node_max, 0xFF);
this->generating = false;