From 9ae83f95e2d702ec10f13d5bff44a5d03c129e9b Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 8 Oct 2015 08:50:12 +0200 Subject: [PATCH] last resort lighting on render --- src/world/chunk.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.39.2