From 50bd5c1a7e1bacf93b6a4e900d2ec282223378a1 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Wed, 28 Sep 2022 10:51:15 -0400 Subject: dont destroy buffers until not used --- src/chunk.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/chunk.cpp') diff --git a/src/chunk.cpp b/src/chunk.cpp index c52eeb3..395aee7 100644 --- a/src/chunk.cpp +++ b/src/chunk.cpp @@ -19,6 +19,8 @@ Chunk::~Chunk() { if(worker.joinable()) worker.join(); xe::Model::deleteModel(chunkMesh); + vertexData.data.clear(); + cubes.clear(); } // @@ -216,7 +218,7 @@ void Chunk::generate() { for(int x = 0; x < 16; x++) { for(int z = 0; z < 16; z++) { - int height = perlin.octave2D_01((( x + gridX * 16) * 0.01), ((z + gridZ * 16) * 0.01), 4) * 10; + int height = perlin.octave2D_01((( x + gridX * 16) * 0.01), ((z + gridZ * 16) * 0.01), 4) * 20; for(int y = 0; y < 256; y++) { if(y == height){ setBlock(x, y, z, GRASS); -- cgit v1.2.3-freya