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

Some refactoring and fixes to VoxelArea and VoxelManip

In particular this validates the edges of VoxelArea and fixes
all the nonsense tests uncovered by it.
This commit is contained in:
sfan5 2024-10-07 17:48:19 +02:00
parent 5532248cd7
commit 6d5103900f
11 changed files with 178 additions and 183 deletions

View file

@ -943,14 +943,18 @@ bool propagate_block_sunlight(Map *map, const NodeDefManager *ndef,
* The areas do not overlap.
* Compatible with type 'direction'.
*/
const VoxelArea block_pad[] = {
VoxelArea(v3s16(15, 0, 0), v3s16(15, 15, 15)), //X+
VoxelArea(v3s16(1, 15, 0), v3s16(14, 15, 15)), //Y+
VoxelArea(v3s16(1, 1, 15), v3s16(14, 14, 15)), //Z+
VoxelArea(v3s16(1, 1, 0), v3s16(14, 14, 0)), //Z-
VoxelArea(v3s16(1, 0, 0), v3s16(14, 0, 15)), //Y-
VoxelArea(v3s16(0, 0, 0), v3s16(0, 15, 15)) //X-
#define B_1 (MAP_BLOCKSIZE - 1)
#define B_2 (MAP_BLOCKSIZE - 2)
const static VoxelArea block_pad[] = {
VoxelArea({B_1, 0, 0}, {B_1, B_1, B_1}), //X+
VoxelArea({1, B_1, 0}, {B_2, B_1, B_1}), //Y+
VoxelArea({1, 1, B_1}, {B_2, B_2, B_1}), //Z+
VoxelArea({1, 1, 0}, {B_2, B_2, 0}), //Z-
VoxelArea({1, 0, 0}, {B_2, 0, B_1}), //Y-
VoxelArea({0, 0, 0}, {0, B_1, B_1}) //X-
};
#undef B_1
#undef B_2
/*!
* The common part of bulk light updates - it is always executed.