mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Small chunks render fix
This commit is contained in:
parent
f569378b88
commit
37dd882fdb
1 changed files with 2 additions and 2 deletions
|
|
@ -149,6 +149,8 @@ bool ChunksController::_buildMeshes(VoxelRenderer* renderer, int tick) {
|
|||
if (chunk->renderData.vertices > (void*)1){
|
||||
const int chunk_attrs[] = {3,2,4, 0};
|
||||
Mesh* mesh = new Mesh(chunk->renderData.vertices, chunk->renderData.size / CHUNK_VERTEX_SIZE, chunk_attrs);
|
||||
if (chunks->meshes[index])
|
||||
delete chunks->meshes[index];
|
||||
chunks->meshes[index] = mesh;
|
||||
delete[] chunk->renderData.vertices;
|
||||
chunk->renderData.vertices = nullptr;
|
||||
|
|
@ -209,8 +211,6 @@ bool ChunksController::_buildMeshes(VoxelRenderer* renderer, int tick) {
|
|||
Mesh* mesh = chunks->meshes[index];
|
||||
if (mesh == nullptr || chunk->modified){
|
||||
Chunk* closes[27];
|
||||
if (mesh != nullptr)
|
||||
delete mesh;
|
||||
if (chunk->isEmpty()){
|
||||
chunks->meshes[index] = nullptr;
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue