From 06302f7f0637bc98e94bdcac27b2b047b34d083f Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Sat, 31 Aug 2024 17:48:35 -0300 Subject: [PATCH 1/3] Revert 9e1b24d --- distribution/changelog.txt | 1 + src/openrct2/config/Config.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9658d0464b..eb869f1309 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -27,6 +27,7 @@ - Fix: [#22593] Memory leak on Android builds when reading zip files. - Fix: [#22606] Virtual floor is sometimes drawn above the path when placing paths. - Fix: [#22625] Fix compilation with orignal ride ratings. +- Fix: [#22671] Game default to hide supports on startup. 0.4.13 (2024-08-04) ------------------------------------------------------------------------ diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 62d44ef40b..26baa662dd 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -248,7 +248,7 @@ namespace OpenRCT2::Config model->InvisibleTrees = reader->GetBoolean("invisible_trees", false); model->InvisibleScenery = reader->GetBoolean("invisible_scenery", false); model->InvisiblePaths = reader->GetBoolean("invisible_paths", false); - model->InvisibleSupports = reader->GetBoolean("invisible_supports", true); + model->InvisibleSupports = reader->GetBoolean("invisible_supports", false); model->LastVersionCheckTime = reader->GetInt64("last_version_check_time", 0); } From be1153b28a7bd42bf412faf6769068583204f282 Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Sat, 31 Aug 2024 17:51:38 -0300 Subject: [PATCH 2/3] Improve consistency of toggling transparency options --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Transparency.cpp | 28 +++++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index eb869f1309..381fcab159 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -28,6 +28,7 @@ - Fix: [#22606] Virtual floor is sometimes drawn above the path when placing paths. - Fix: [#22625] Fix compilation with orignal ride ratings. - Fix: [#22671] Game default to hide supports on startup. +- Fix: [#22671] Unchecking invisible option does not uncheck see-through option on transparency options and vice versa. 0.4.13 (2024-08-04) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 78761eda4a..5baafd4eea 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -158,6 +158,18 @@ static Widget _transparancyWidgets[] = } private: + uint32_t ToggleSeeThrough(uint32_t wflags, uint32_t seeThroughFlag, uint32_t transparencyFlag) + { + wflags ^= seeThroughFlag; + // If see-through is disabled, we also want to disable invisible + if (!(wflags & seeThroughFlag)) + { + wflags &= ~transparencyFlag; + } + SaveInConfig(wflags); + return wflags; + } + uint32_t ToggleTransparency(uint32_t wflags, uint32_t transparencyFlag, uint32_t seeThroughFlag) { wflags ^= transparencyFlag; @@ -165,6 +177,10 @@ static Widget _transparancyWidgets[] = { wflags |= seeThroughFlag; } + else + { + wflags &= ~seeThroughFlag; + } SaveInConfig(wflags); return wflags; } @@ -182,22 +198,22 @@ static Widget _transparancyWidgets[] = switch (widgetIndex) { case WIDX_HIDE_RIDES: - wflags ^= VIEWPORT_FLAG_HIDE_RIDES; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_RIDES, VIEWPORT_FLAG_INVISIBLE_RIDES); break; case WIDX_HIDE_VEHICLES: - wflags ^= VIEWPORT_FLAG_HIDE_VEHICLES; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_VEHICLES, VIEWPORT_FLAG_INVISIBLE_VEHICLES); break; case WIDX_HIDE_SCENERY: - wflags ^= VIEWPORT_FLAG_HIDE_SCENERY; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_SCENERY, VIEWPORT_FLAG_INVISIBLE_SCENERY); break; case WIDX_HIDE_VEGETATION: - wflags ^= VIEWPORT_FLAG_HIDE_VEGETATION; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_VEGETATION, VIEWPORT_FLAG_INVISIBLE_VEGETATION); break; case WIDX_HIDE_PATHS: - wflags ^= VIEWPORT_FLAG_HIDE_PATHS; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_PATHS, VIEWPORT_FLAG_INVISIBLE_PATHS); break; case WIDX_HIDE_SUPPORTS: - wflags ^= VIEWPORT_FLAG_HIDE_SUPPORTS; + wflags = ToggleSeeThrough(wflags, VIEWPORT_FLAG_HIDE_SUPPORTS, VIEWPORT_FLAG_INVISIBLE_SUPPORTS); break; case WIDX_INVISIBLE_RIDES: wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_RIDES, VIEWPORT_FLAG_HIDE_RIDES); From 4d2efa0edcffa89c21247219c0fd37d3c59c0c3e Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Sun, 1 Sep 2024 06:57:56 -0300 Subject: [PATCH 3/3] Fix #22672: Loud sound effects on title screen --- src/openrct2-ui/windows/Main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index a94227003b..bc1b991ec2 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -36,9 +36,9 @@ static Widget _mainWidgets[] = { widgets = _mainWidgets; ViewportCreate(this, windowPos, width, height, Focus(CoordsXYZ(0x0FFF, 0x0FFF, 0))); - if (viewport != nullptr && !(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) + if (viewport != nullptr) { - SetViewportFlags(); + SetViewportFlags(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO); viewport->rotation = 0; } gShowGridLinesRefCount = 0; @@ -53,9 +53,14 @@ static Widget _mainWidgets[] = { } private: - void SetViewportFlags() + void SetViewportFlags(bool isTitleWindow) { viewport->flags |= VIEWPORT_FLAG_SOUND_ON; + if (isTitleWindow) + { + return; + } + if (Config::Get().general.InvisibleRides) { viewport->flags |= VIEWPORT_FLAG_INVISIBLE_RIDES;