diff --git a/engine/xe_model.cpp b/engine/xe_model.cpp index a891d5f..53d0158 100644 --- a/engine/xe_model.cpp +++ b/engine/xe_model.cpp @@ -52,8 +52,8 @@ void Model::deleteModel(Model* model) { } void Model::submitDeleteQueue(bool purge) { + vkDeviceWaitIdle(Engine::getInstance()->xeDevice.device()); for(Model* model: DELETION_QUEUE) { - vkDeviceWaitIdle(model->xeDevice.device()); try { delete model; } catch(int err) {}; } DELETION_QUEUE.clear(); diff --git a/src/first_app.cpp b/src/first_app.cpp index 43047f7..6b6a80e 100755 --- a/src/first_app.cpp +++ b/src/first_app.cpp @@ -79,8 +79,10 @@ void FirstApp::reloadLoadedChunks(xe::GameObject& viewer) { if(chunk == nullptr) { chunk = Chunk::newChunk(newGridX, newGridZ, 12345); Chunk::createMeshAsync(chunk); + Chunk::createMeshAsync(Chunk::getChunk(newGridX+1, newGridZ)); Chunk::createMeshAsync(Chunk::getChunk(newGridX-1, newGridZ)); Chunk::createMeshAsync(Chunk::getChunk(newGridX, newGridZ+1)); + Chunk::createMeshAsync(Chunk::getChunk(newGridX, newGridZ-1)); } gameObject.model = chunk->getMesh(); gameObject.transform.translation = glm::vec3(newGridX * 16.f, 0, newGridZ * 16.f);