diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/chunk.cpp | 9 | ||||
-rwxr-xr-x | src/first_app.cpp | 4 | ||||
-rwxr-xr-x | src/first_app.hpp | 2 | ||||
-rw-r--r-- | src/keyboard_movement_controller.hpp | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/src/chunk.cpp b/src/chunk.cpp index e830c57..cda92e8 100644 --- a/src/chunk.cpp +++ b/src/chunk.cpp @@ -18,8 +18,7 @@ Chunk::Chunk(int32_t gridX, int32_t gridZ, uint32_t world_seed) Chunk::~Chunk() { if(worker.joinable()) worker.join(); - if(chunkMesh != nullptr) - delete chunkMesh; + xe::Model::deleteModel(chunkMesh); } // @@ -155,8 +154,10 @@ void Chunk::addVerticies(Chunk* c, uint8_t side, int32_t x, int32_t y, int32_t z xe::Model* Chunk::getMesh() { if(reloadRequired) { - if(chunkMesh != nullptr) - delete chunkMesh; + if(chunkMesh != nullptr) { + xe::Model::deleteModel(chunkMesh); + chunkMesh = nullptr; + } if(worker.joinable()) worker.join(); xe::Model::Builder builder{}; diff --git a/src/first_app.cpp b/src/first_app.cpp index 43047f7..63a960d 100755 --- a/src/first_app.cpp +++ b/src/first_app.cpp @@ -73,8 +73,8 @@ void FirstApp::reloadLoadedChunks(xe::GameObject& viewer) { int gridZ = static_cast<int>(floor(gameObject.transform.translation.z / 16.f)); int newGridX = minX + x; int newGridZ = minZ + z; - if(gridX < minX || gridZ < minZ || gridX > maxX || gridZ > maxZ) - Chunk::deleteChunk(gridX, gridZ); + // if(gridX < minX || gridZ < minZ || gridX > maxX || gridZ > maxZ) + // Chunk::deleteChunk(gridX, gridZ); Chunk* chunk = Chunk::getChunk(newGridX, newGridZ); if(chunk == nullptr) { chunk = Chunk::newChunk(newGridX, newGridZ, 12345); diff --git a/src/first_app.hpp b/src/first_app.hpp index d361296..f969724 100755 --- a/src/first_app.hpp +++ b/src/first_app.hpp @@ -32,7 +32,7 @@ class FirstApp { static constexpr int WIDTH = 800; static constexpr int HEIGHT = 600; - static constexpr int RENDER_DISTANCE = 10; + static constexpr int RENDER_DISTANCE = 32; void createGameObjects(xe::GameObject& viewer); void reloadLoadedChunks(xe::GameObject& viewer); diff --git a/src/keyboard_movement_controller.hpp b/src/keyboard_movement_controller.hpp index 1cc0456..5577bbf 100644 --- a/src/keyboard_movement_controller.hpp +++ b/src/keyboard_movement_controller.hpp @@ -36,7 +36,7 @@ namespace app { xe::GameObject &viewerObject; KeyMappings keys{}; - float moveSpeed{10.f}; + float moveSpeed{30.f}; float lookSpeed{1.5f}; }; |