From 4bdbd787a91ba208adddeaa05f8aebb9b355080b Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Fri, 16 Aug 2024 22:37:21 +0200 Subject: [PATCH] Fix lighting effects not toggling correctly (#22582) * Fix lighting effects not toggling correctly * Simplify boolean expressions around lighting effects options * Invalidate entire screen after toggling lighting effects * Add changelog entry --- distribution/changelog.txt | 1 + src/openrct2/drawing/LightFX.cpp | 4 ++-- src/openrct2/drawing/X8DrawingEngine.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 2c88f35308..0a093ed6ec 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -15,6 +15,7 @@ - Fix: [#22316] Potential crash when switching the drawing engine while the game is running. - Fix: [#22395, #22396] Misaligned tick marks in financial and guest count graphs (original bug). - Fix: [#22457] Potential crash opening the scenario select window. +- Fix: [#22582] Lighting effects are not enabled/disabled correctly, making the game appear frozen. 0.4.13 (2024-08-04) ------------------------------------------------------------------------ diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index c45433976e..b55c7d3255 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -131,12 +131,12 @@ void LightFXSetAvailable(bool available) bool LightFXIsAvailable() { - return _lightfxAvailable && Config::Get().general.EnableLightFx != 0; + return _lightfxAvailable && Config::Get().general.EnableLightFx; } bool LightFXForVehiclesIsAvailable() { - return LightFXIsAvailable() && Config::Get().general.EnableLightFxForVehicles != 0; + return LightFXIsAvailable() && Config::Get().general.EnableLightFxForVehicles; } void LightFXInit() diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index 5ad214c5f7..0d2836e1fb 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -121,7 +121,7 @@ X8DrawingEngine::X8DrawingEngine([[maybe_unused]] const std::shared_ptr