1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Merge pull request #25350 from Gymnasiast/fix/scrolling-intro

Fix: scrolling intro background switches colour halfway through
This commit is contained in:
Michael Steenbeek
2025-10-18 19:15:59 +02:00
committed by GitHub
4 changed files with 27 additions and 27 deletions

View File

@@ -11,6 +11,9 @@
- Fix: [#25299] The Mine Train Coaster left large helix draws incorrect sprites at certain angles (original bug). - Fix: [#25299] The Mine Train Coaster left large helix draws incorrect sprites at certain angles (original bug).
- Fix: [#25328] Spiral Slide in Blackpool Pleasure Beach has its entrance and exit the wrong way round (bug in the original scenario). - Fix: [#25328] Spiral Slide in Blackpool Pleasure Beach has its entrance and exit the wrong way round (bug in the original scenario).
- Fix: [#25342] The Go-Karts medium right gentle sloped turn does not have a tunnel at the end. - Fix: [#25342] The Go-Karts medium right gentle sloped turn does not have a tunnel at the end.
- Fix: [#25350] The scrolling intro background switches colour halfway through (original bug).
- Fix: [#25350] When skipping the scrolling intro, the screen does not get cleared properly.
- Fix: [#25350] Scrolling intro cannot be skipped using a mouse click.
- Fix: [#25358] The Stand Up Roller Coaster left corkscrew does not block supports correctly. - Fix: [#25358] The Stand Up Roller Coaster left corkscrew does not block supports correctly.
- Fix: [#25363] The Mine Train Coaster flat-to-steep track pieces do not block all metal supports. - Fix: [#25363] The Mine Train Coaster flat-to-steep track pieces do not block all metal supports.
- Fix: [#25369] The Go-Karts medium turns and small flat and sloped turns do not block metal supports correctly. - Fix: [#25369] The Go-Karts medium turns and small flat and sloped turns do not block metal supports correctly.

View File

@@ -703,9 +703,11 @@ void GfxTransposePalette(int32_t pal, uint8_t product)
for (; width > 0; width--) for (; width > 0; width--)
{ {
auto& dest_pointer = gGamePalette[x]; auto& dest_pointer = gGamePalette[x];
dest_pointer.Blue = (source_pointer[0] * product) >> 8; // Make sure the image never gets darker than the void colour (not-quite-block), to the background colour jumping
dest_pointer.Green = (source_pointer[1] * product) >> 8; // between void and 100% black.
dest_pointer.Red = (source_pointer[2] * product) >> 8; dest_pointer.Blue = std::max<uint8_t>(35, ((source_pointer[0] * product) >> 8));
dest_pointer.Green = std::max<uint8_t>(35, ((source_pointer[1] * product) >> 8));
dest_pointer.Red = std::max<uint8_t>(23, ((source_pointer[2] * product) >> 8));
source_pointer += 3; source_pointer += 3;
x++; x++;

View File

@@ -11,6 +11,7 @@
#include "../../Context.h" #include "../../Context.h"
#include "../../Input.h" #include "../../Input.h"
#include "../../OpenRCT2.h"
#include "../../SpriteIds.h" #include "../../SpriteIds.h"
#include "../../audio/Audio.h" #include "../../audio/Audio.h"
#include "../../audio/AudioChannel.h" #include "../../audio/AudioChannel.h"
@@ -27,8 +28,8 @@ namespace OpenRCT2
static constexpr PaletteIndex kBackgroundColourLogo = PaletteIndex::pi245; static constexpr PaletteIndex kBackgroundColourLogo = PaletteIndex::pi245;
static constexpr PaletteIndex kBorderColourPublisher = PaletteIndex::pi129; static constexpr PaletteIndex kBorderColourPublisher = PaletteIndex::pi129;
constexpr int32_t PALETTE_G1_IDX_DEVELOPER = 23217; static constexpr ImageIndex kPaletteChrisSawyerLogo = 23217;
constexpr int32_t PALETTE_G1_IDX_LOGO = 23224; static constexpr ImageIndex kPaletteRCT2Logo = 23224;
static IntroState _introState; static IntroState _introState;
@@ -67,11 +68,6 @@ namespace OpenRCT2
switch (_introState) switch (_introState)
{ {
case IntroState::Disclaimer1:
case IntroState::Disclaimer2:
// Originally used for the disclaimer text
_introState = IntroState::PublisherBegin;
[[fallthrough]];
case IntroState::PublisherBegin: case IntroState::PublisherBegin:
LoadPalette(); LoadPalette();
@@ -174,9 +170,12 @@ namespace OpenRCT2
_soundChannel = nullptr; _soundChannel = nullptr;
} }
// Move to next part if (gOpenRCT2Headless)
_introState = IntroState::Finish; {
_introStateCounter = 0; // Move to next part
_introState = IntroState::Finish;
_introStateCounter = 0;
}
break; break;
case IntroState::Finish: case IntroState::Finish:
{ {
@@ -195,9 +194,6 @@ namespace OpenRCT2
switch (_introState) switch (_introState)
{ {
case IntroState::Disclaimer1:
case IntroState::Disclaimer2:
break;
case IntroState::PublisherBegin: case IntroState::PublisherBegin:
GfxClear(rt, kBackgroundColourDark); GfxClear(rt, kBackgroundColourDark);
break; break;
@@ -220,7 +216,7 @@ namespace OpenRCT2
break; break;
case IntroState::DeveloperBegin: case IntroState::DeveloperBegin:
GfxClear(rt, kBackgroundColourDark); GfxClear(rt, kBackgroundColourDark);
GfxTransposePalette(PALETTE_G1_IDX_DEVELOPER, 255); GfxTransposePalette(kPaletteChrisSawyerLogo, 255);
break; break;
case IntroState::DeveloperScroll: case IntroState::DeveloperScroll:
GfxClear(rt, kBackgroundColourDark); GfxClear(rt, kBackgroundColourDark);
@@ -232,11 +228,11 @@ namespace OpenRCT2
case IntroState::LogoFadeIn: case IntroState::LogoFadeIn:
if (_introStateCounter <= 0xFF00) if (_introStateCounter <= 0xFF00)
{ {
GfxTransposePalette(PALETTE_G1_IDX_LOGO, (_introStateCounter >> 8) & 0xFF); GfxTransposePalette(kPaletteRCT2Logo, (_introStateCounter >> 8) & 0xFF);
} }
else else
{ {
GfxTransposePalette(PALETTE_G1_IDX_LOGO, 255); GfxTransposePalette(kPaletteRCT2Logo, 255);
} }
ScreenIntroDrawLogo(rt); ScreenIntroDrawLogo(rt);
break; break;
@@ -246,16 +242,20 @@ namespace OpenRCT2
case IntroState::LogoFadeOut: case IntroState::LogoFadeOut:
if (_introStateCounter >= 0) if (_introStateCounter >= 0)
{ {
GfxTransposePalette(PALETTE_G1_IDX_LOGO, (_introStateCounter >> 8) & 0xFF); GfxTransposePalette(kPaletteRCT2Logo, (_introStateCounter >> 8) & 0xFF);
} }
else else
{ {
GfxTransposePalette(PALETTE_G1_IDX_LOGO, 0); GfxTransposePalette(kPaletteRCT2Logo, 0);
} }
ScreenIntroDrawLogo(rt); ScreenIntroDrawLogo(rt);
break; break;
case IntroState::Clear: case IntroState::Clear:
GfxClear(rt, kBackgroundColourDark); GfxClear(rt, kBackgroundColourDark);
// Move to next part. Has to be done here to ensure the screen is cleared.
_introState = IntroState::Finish;
_introStateCounter = 0;
break; break;
default: default:
break; break;
@@ -264,7 +264,7 @@ namespace OpenRCT2
static void ScreenIntroProcessMouseInput() static void ScreenIntroProcessMouseInput()
{ {
if (ContextGetCursorState()->any == CURSOR_PRESSED) if (ContextGetCursorState()->any & CURSOR_DOWN)
{ {
ScreenIntroSkipPart(); ScreenIntroSkipPart();
} }
@@ -293,9 +293,6 @@ namespace OpenRCT2
{ {
case IntroState::None: case IntroState::None:
break; break;
case IntroState::Disclaimer2:
_introState = IntroState::PublisherBegin;
break;
default: default:
_introState = IntroState::Clear; _introState = IntroState::Clear;
break; break;

View File

@@ -27,8 +27,6 @@ namespace OpenRCT2
LogoFadeIn, LogoFadeIn,
LogoWait, LogoWait,
LogoFadeOut, LogoFadeOut,
Disclaimer1,
Disclaimer2,
Clear = 254, Clear = 254,
Finish = 255, Finish = 255,
}; };