From 80b5a666355c2473e186a9302e858629e2216bca Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 12 Jun 2020 15:07:13 +0200 Subject: [PATCH] - fixed bad range check in shadowmap code. Since the last refactoring this only counts lights, not occupied entries in the array, but the check wasn't adjusted for that. --- src/p_setup.cpp | 1 + src/rendering/hwrenderer/hw_entrypoint.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 03e2a7a5e..0c902bd2f 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -366,6 +366,7 @@ void FLevelLocals::ClearLevelData() localEventManager->Shutdown(); if (aabbTree) delete aabbTree; aabbTree = nullptr; + screen->SetAABBTree(nullptr); } diff --git a/src/rendering/hwrenderer/hw_entrypoint.cpp b/src/rendering/hwrenderer/hw_entrypoint.cpp index 83093ff82..4803d2083 100644 --- a/src/rendering/hwrenderer/hw_entrypoint.cpp +++ b/src/rendering/hwrenderer/hw_entrypoint.cpp @@ -73,7 +73,7 @@ void CollectLights(FLevelLocals* Level) for (auto light = Level->lights; light; light = light->next) { IShadowMap::LightsProcessed++; - if (light->shadowmapped && light->IsActive() && lightindex < 1024 * 4) + if (light->shadowmapped && light->IsActive() && lightindex < 1024) { IShadowMap::LightsShadowmapped++;