]> git.localhorst.tv Git - blank.git/blobdiff - src/app.cpp
limit chunks allocated/freed per frame
[blank.git] / src / app.cpp
index 202f98c5b4fe46af2ae85a8824d69908fc354a31..10a72b8e89e698f2abf52164df4bc91a6b164c96 100644 (file)
@@ -119,7 +119,7 @@ void Application::Update(int dt) {
                outline_visible = true;
                outline.Clear();
                chunk->BlockAt(blkid).type->FillOutlineModel(outline);
-               outline_transform = glm::translate(chunk->Transform(), pos);
+               outline_transform = glm::translate(chunk->Transform(world.Player().ChunkCoords()), pos);
                outline_transform = glm::scale(outline_transform, glm::vec3(1.0001f));
        } else {
                outline_visible = false;
@@ -145,7 +145,7 @@ void Application::Update(int dt) {
                        glm::vec3 next_pos = Chunk::ToCoords(blkid) + normal;
                        if (!Chunk::InBounds(next_pos)) {
                                mod_chunk = &world.Next(*chunk, normal);
-                               next_pos -= normal * Chunk::Extent();
+                               next_pos -= normal * glm::vec3(Chunk::Extent());
                        }
                        mod_chunk->BlockAt(next_pos).type = world.BlockTypes()[place_id];
                        mod_chunk->Invalidate();