]> git.localhorst.tv Git - blank.git/blobdiff - src/world/chunk.cpp
special treatment for players
[blank.git] / src / world / chunk.cpp
index 83c94e3403a14ddd97283739dfe34e0e50fa9696..11c9d36bdaedee1682725db27c31d3341b89b305 100644 (file)
@@ -25,7 +25,6 @@ Chunk::Chunk(const BlockTypeRegistry &types) noexcept
 , neighbor{0}
 , blocks{}
 , light{0}
-, model()
 , position(0, 0, 0)
 , dirty_model(false)
 , dirty_save(false) {
@@ -34,7 +33,6 @@ Chunk::Chunk(const BlockTypeRegistry &types) noexcept
 
 Chunk::Chunk(Chunk &&other) noexcept
 : types(other.types)
-, model(std::move(other.model))
 , position(other.position)
 , dirty_model(other.dirty_model)
 , dirty_save(other.dirty_save) {
@@ -48,7 +46,6 @@ Chunk &Chunk::operator =(Chunk &&other) noexcept {
        std::copy(other.neighbor, other.neighbor + sizeof(neighbor), neighbor);
        std::copy(other.blocks, other.blocks + sizeof(blocks), blocks);
        std::copy(other.light, other.light + sizeof(light), light);
-       model = std::move(other.model);
        position = other.position;
        dirty_model = other.dirty_save;
        dirty_save = other.dirty_save;
@@ -429,14 +426,6 @@ bool Chunk::IsSurface(const Pos &pos) const noexcept {
 }
 
 
-void Chunk::Draw() noexcept {
-       if (ShouldUpdateModel()) {
-               Update();
-       }
-       model.Draw();
-}
-
-
 bool Chunk::Intersection(
        const Ray &ray,
        const glm::mat4 &M,
@@ -511,13 +500,7 @@ BlockModel::Buffer buf;
 
 }
 
-void Chunk::CheckUpdate() noexcept {
-       if (ShouldUpdateModel()) {
-               Update();
-       }
-}
-
-void Chunk::Update() noexcept {
+void Chunk::Update(BlockModel &model) noexcept {
        int vtx_count = 0, idx_count = 0;
        for (const auto &block : blocks) {
                const Shape *shape = Type(block).shape;