From: Daniel Karbach Date: Thu, 8 Oct 2015 06:50:12 +0000 (+0200) Subject: last resort lighting on render X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;ds=inline;h=9ae83f95e2d702ec10f13d5bff44a5d03c129e9b;p=blank.git last resort lighting on render --- diff --git a/src/world/chunk.cpp b/src/world/chunk.cpp index 452e7aa..baad446 100644 --- a/src/world/chunk.cpp +++ b/src/world/chunk.cpp @@ -668,7 +668,11 @@ void ChunkRenderer::LoadTextures(const AssetLoader &loader, const TextureIndex & void ChunkRenderer::Update(int dt) { for (int i = 0, updates = 0; updates < dt && i < index.TotalChunks(); ++i) { - if (index[i] && index[i]->ShouldUpdateModel()) { + if (!index[i]) continue; + if (!index[i]->Lighted() && index.HasAllSurrounding(index[i]->Position())) { + index[i]->ScanLights(); + } + if (index[i]->ShouldUpdateModel()) { index[i]->Update(models[i]); ++updates; }