]> git.localhorst.tv Git - blank.git/blobdiff - src/world/chunk.cpp
new turn style
[blank.git] / src / world / chunk.cpp
index 800012e601cfa1cdc966b70f09ebd5876982e002..ef9f578fa3e90dd9c90a1336925e086c1d0b3611 100644 (file)
@@ -636,9 +636,13 @@ bool ChunkLoader::LoadOne() {
                        for (iter.x = begin.x; iter.x < end.x; ++iter.x) {
                                if (index->IsBorder(iter)) continue;
                                Chunk *light_chunk = index->Get(iter);
-                               if (!light_chunk || light_chunk->Lighted()) continue;
+                               if (!light_chunk) continue;
                                if (index->HasAllSurrounding(iter)) {
-                                       light_chunk->ScanLights();
+                                       if (!light_chunk->Lighted()) {
+                                               light_chunk->ScanLights();
+                                       } else {
+                                               light_chunk->InvalidateMesh();
+                                       }
                                }
                        }
                }
@@ -671,7 +675,7 @@ int ChunkRenderer::MissingChunks() const noexcept {
        return index.MissingChunks();
 }
 
-void ChunkRenderer::LoadTextures(const AssetLoader &loader, const TextureIndex &tex_index) {
+void ChunkRenderer::LoadTextures(const AssetLoader &loader, const ResourceIndex &tex_index) {
        block_tex.Bind();
        loader.LoadTextures(tex_index, block_tex);
        block_tex.FilterNearest();