X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2Fchunk.cpp;h=ef9f578fa3e90dd9c90a1336925e086c1d0b3611;hb=0d580658b896dfec07466c31ae4847455724ee95;hp=800012e601cfa1cdc966b70f09ebd5876982e002;hpb=ba55bf4293f3abc742eef710545a4b207ba2c820;p=blank.git diff --git a/src/world/chunk.cpp b/src/world/chunk.cpp index 800012e..ef9f578 100644 --- a/src/world/chunk.cpp +++ b/src/world/chunk.cpp @@ -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();