mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +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:
parent
5532248cd7
commit
6d5103900f
11 changed files with 178 additions and 183 deletions
|
@ -178,13 +178,13 @@ void MapBlock::copyTo(VoxelManipulator &dst)
|
|||
getPosRelative(), data_size);
|
||||
}
|
||||
|
||||
void MapBlock::copyFrom(VoxelManipulator &dst)
|
||||
void MapBlock::copyFrom(const VoxelManipulator &src)
|
||||
{
|
||||
v3s16 data_size(MAP_BLOCKSIZE, MAP_BLOCKSIZE, MAP_BLOCKSIZE);
|
||||
VoxelArea data_area(v3s16(0,0,0), data_size - v3s16(1,1,1));
|
||||
|
||||
// Copy from VoxelManipulator to data
|
||||
dst.copyTo(data, data_area, v3s16(0,0,0),
|
||||
src.copyTo(data, data_area, v3s16(0,0,0),
|
||||
getPosRelative(), data_size);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue