From bca75ef3467233987933dec0d846b07bb5fe9cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Thu, 19 Dec 2024 04:25:55 -0300 Subject: [PATCH] check if color changes for lightmap update --- src/playsim/a_dynlight.cpp | 9 ++++++--- src/playsim/a_dynlight.h | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/playsim/a_dynlight.cpp b/src/playsim/a_dynlight.cpp index c1e06f1b0..a55f70e9a 100644 --- a/src/playsim/a_dynlight.cpp +++ b/src/playsim/a_dynlight.cpp @@ -423,12 +423,15 @@ void FDynamicLight::Tick() bool updated = UpdateLocation(); - if(!updated && markTiles && m_active != wasactive) + if(!updated && markTiles && (m_active != wasactive || oldred != GetRed() || oldblue != GetBlue() || oldgreen != GetGreen())) { MarkTilesForUpdate(Level, touching_sides, touching_sector); - } - wasactive = m_active; + wasactive = m_active; + oldred = GetRed(); + oldblue = GetBlue(); + oldgreen = GetGreen(); + } } diff --git a/src/playsim/a_dynlight.h b/src/playsim/a_dynlight.h index 98f45eb7e..5b274c2bb 100644 --- a/src/playsim/a_dynlight.h +++ b/src/playsim/a_dynlight.h @@ -300,6 +300,8 @@ public: bool swapped; bool explicitpitch; + int oldred, oldgreen, oldblue; + float lightStrength; // Locations in the level mesh light list. Ends with index = 0 or all entries used