From 26720eb345bb9d2c5621ec35567168bf924be93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20P=C4=99kalski?= Date: Thu, 15 Oct 2020 17:05:39 +0200 Subject: [PATCH] Fix #5178: Lighting effects cannot be disabled in software mode (#13206) Lighting effect are now automatically turned off when software renderer is selected. --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Options.cpp | 2 ++ src/openrct2/config/Config.cpp | 6 +++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 2ea3fc21a2..4d6e9aba2c 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -9,6 +9,7 @@ - Fix: [#1324] Last track piece map selection still visible when placing ride entrance or exit (original bug). - Fix: [#3200] Close Construction window upon selecting vehicle page. - Fix: [#4041] Garbled park option on scenario editor with custom theme. +- Fix: [#5178] Lighting effects cannot be disabled in software mode - Fix: [#5904] Empty errors on tile inspector base height change. - Fix: [#6086] Cannot install existing track design with another name. - Fix: [#7748] Tooltips would not timeout for normal UI elements. diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index a3b5ccd029..c4f6ccc9f4 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -1041,6 +1041,7 @@ static void window_options_rendering_invalidate(rct_window* w) else { w->disabled_widgets |= (1 << WIDX_ENABLE_LIGHT_FX_CHECKBOX); + gConfigGeneral.enable_light_fx = false; } widget_set_checkbox_value(w, WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX, gConfigGeneral.enable_light_fx_for_vehicles); @@ -1052,6 +1053,7 @@ static void window_options_rendering_invalidate(rct_window* w) else { w->disabled_widgets |= (1 << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); + gConfigGeneral.enable_light_fx_for_vehicles = false; } widget_set_checkbox_value( diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index a1a24be05d..40c7f76841 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -187,9 +187,9 @@ namespace Config // Default config setting is false until the games canvas can be separated from the effect model->day_night_cycle = reader->GetBoolean("day_night_cycle", false); - - model->enable_light_fx = reader->GetBoolean("enable_light_fx", false); - model->enable_light_fx_for_vehicles = reader->GetBoolean("enable_light_fx_for_vehicles", false); + const bool isHardware = model->drawing_engine != DrawingEngine::Software; + model->enable_light_fx = isHardware && reader->GetBoolean("enable_light_fx", false); + model->enable_light_fx_for_vehicles = isHardware && reader->GetBoolean("enable_light_fx_for_vehicles", false); model->upper_case_banners = reader->GetBoolean("upper_case_banners", false); model->disable_lightning_effect = reader->GetBoolean("disable_lightning_effect", false); model->allow_loading_with_incorrect_checksum = reader->GetBoolean("allow_loading_with_incorrect_checksum", true);