mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
Merge branch 'main' into heightmaps
This commit is contained in:
commit
ea9ad08bfd
64 changed files with 3473 additions and 733 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include "data/StructLayout.hpp"
|
||||
#include "coders/byte_utils.hpp"
|
||||
#include "coders/json.hpp"
|
||||
#include "content/Content.hpp"
|
||||
|
|
@ -363,6 +364,7 @@ void Chunks::set(
|
|||
}
|
||||
int lx = x - cx * CHUNK_W;
|
||||
int lz = z - cz * CHUNK_D;
|
||||
size_t index = vox_index(lx, y, lz);
|
||||
|
||||
// block finalization
|
||||
voxel& vox = chunk->voxels[(y * CHUNK_D + lz) * CHUNK_W + lx];
|
||||
|
|
@ -373,6 +375,13 @@ void Chunks::set(
|
|||
if (prevdef.rt.extended && !vox.state.segment) {
|
||||
eraseSegments(prevdef, vox.state, x, y, z);
|
||||
}
|
||||
if (prevdef.dataStruct) {
|
||||
if (auto found = chunk->blocksMetadata.find(index)) {
|
||||
chunk->blocksMetadata.free(found);
|
||||
chunk->flags.unsaved = true;
|
||||
chunk->flags.blocksData = true;
|
||||
}
|
||||
}
|
||||
|
||||
// block initialization
|
||||
const auto& newdef = indices->blocks.require(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue