]> git.localhorst.tv Git - blank.git/commitdiff
last resort lighting on render
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 8 Oct 2015 06:50:12 +0000 (08:50 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 8 Oct 2015 18:48:41 +0000 (20:48 +0200)
src/world/chunk.cpp

index 452e7aa3b3cf23345c7cb1e7f085e3c5d16572c5..baad4466cde01790851b5f8877e2350d4e8a53b5 100644 (file)
@@ -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;
                }