diff options
| author | Mel <einebeere@gmail.com> | 2023-06-30 15:15:00 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-06-30 15:15:00 +0200 |
| commit | 424d00eaf7335e1c6427f40260d55782c3fd902c (patch) | |
| tree | 62550b085078d84c8a48cbb01f4f7738bfeeb3da /src/main.cpp | |
| parent | 6d61b17c4289185d59d37caae8070a40e91fba40 (diff) | |
| download | meowcraft-424d00eaf7335e1c6427f40260d55782c3fd902c.tar.zst meowcraft-424d00eaf7335e1c6427f40260d55782c3fd902c.zip | |
Avoid per-frame chunk copies and don't render block faces between chunks
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index b0939c1..a264f3e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -102,10 +102,10 @@ void run() { glClearColor(sky_color.x(), sky_color.y(), sky_color.z(), 1.0f); // #DBDBDB glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - for (auto& chunk : world.get_visible_chunks(camera.position())) { - auto model = Math::MVP::model(chunk.chunk.value().position(), {}); + for (auto chunk : world.get_visible_chunks(camera.position())) { + auto model = Math::MVP::model(chunk->chunk.value().position(), {}); model_uniform.set(model); - render(chunk.mesh.value(), texture); + render(chunk->mesh.value(), texture); } time++; |
