mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix chunk meshes refresh in some cases
This commit is contained in:
parent
6cccb3876b
commit
9e6ff82e88
2 changed files with 3 additions and 2 deletions
|
|
@ -126,12 +126,12 @@ const ChunkMesh* ChunksRenderer::render(
|
|||
const std::shared_ptr<Chunk>& chunk, bool important, bool lowPriority
|
||||
) {
|
||||
glm::ivec2 key(chunk->x, chunk->z);
|
||||
chunk->flags.modified = false;
|
||||
if (important) {
|
||||
ChunkMesh mesh {};
|
||||
auto voxelsBuffer = prepareVoxelsVolume(*chunk);
|
||||
mesh = renderer->render(chunk.get(), *voxelsBuffer);
|
||||
meshes[key] = std::move(mesh);
|
||||
chunk->flags.modified = false;
|
||||
return &meshes[key];
|
||||
}
|
||||
if (inwork.find(key) != inwork.end() ||
|
||||
|
|
@ -140,6 +140,7 @@ const ChunkMesh* ChunksRenderer::render(
|
|||
lowPriority)) {
|
||||
return nullptr;
|
||||
}
|
||||
chunk->flags.modified = false;
|
||||
enqueuedInFrame++;
|
||||
auto voxelsBuffer = prepareVoxelsVolume(*chunk);
|
||||
threadPool.enqueueJob({chunk, std::move(voxelsBuffer)});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue