summaryrefslogtreecommitdiff
path: root/src/chunk.cpp
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2022-09-28 10:51:15 -0400
committerTyler Murphy <tylermurphy534@gmail.com>2022-09-28 10:51:15 -0400
commit50bd5c1a7e1bacf93b6a4e900d2ec282223378a1 (patch)
tree34d302a61c4229304f19bed19f5b8f73aec000b0 /src/chunk.cpp
parentbetter model and texture cleanup (diff)
downloadminecraftvulkan-50bd5c1a7e1bacf93b6a4e900d2ec282223378a1.tar.gz
minecraftvulkan-50bd5c1a7e1bacf93b6a4e900d2ec282223378a1.tar.bz2
minecraftvulkan-50bd5c1a7e1bacf93b6a4e900d2ec282223378a1.zip
dont destroy buffers until not used
Diffstat (limited to 'src/chunk.cpp')
-rw-r--r--src/chunk.cpp4
1 files changed, 3 insertions, 1 deletions
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);