From 73c592b13715cd2bd6e5fd6e9c61873f70d66053 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 7 May 2024 22:57:56 +0200 Subject: [PATCH 1/2] Guest window: use constants for balloon/umbrella/hat sprites --- src/openrct2-ui/windows/Guest.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index de6f83a9e6..7a840512ef 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -561,19 +562,21 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); if (guest != nullptr) { // If holding a balloon - if (animationFrame >= 0x2A1D && animationFrame < 0x2A3D) + if (animationFrame >= kPeepSpriteBalloonStateWatchRideId + && animationFrame < kPeepSpriteBalloonStateSittingIdleId + 4) { GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->BalloonColour), screenCoords); } // If holding umbrella - if (animationFrame >= 0x2BBD && animationFrame < 0x2BDD) + if (animationFrame >= kPeepSpriteUmbrellaStateNoneId + && animationFrame < kPeepSpriteUmbrellaStateSittingIdleId + 4) { GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->UmbrellaColour), screenCoords); } // If wearing hat - if (animationFrame >= 0x29DD && animationFrame < 0x29FD) + if (animationFrame >= kPeepSpriteHatStateWatchRideId && animationFrame < kPeepSpriteHatStateSittingIdleId + 4) { GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->HatColour), screenCoords); } From 779e65d8b22cfd613f9c937d742054d648c5a49e Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Tue, 7 May 2024 23:00:46 +0200 Subject: [PATCH 2/2] GameBottomToolbar: use constants for balloon/umbrella/hat sprites --- src/openrct2-ui/windows/GameBottomToolbar.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 6b76cc1708..cc5980e985 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -296,15 +297,18 @@ static Widget window_game_bottom_toolbar_widgets[] = auto* guest = peep->As(); if (guest != nullptr) { - if (image_id_base >= 0x2A1D && image_id_base < 0x2A3D) + if (image_id_base >= kPeepSpriteBalloonStateWatchRideId + && image_id_base < kPeepSpriteBalloonStateSittingIdleId + 4) { GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->BalloonColour), clipCoords); } - else if (image_id_base >= 0x2BBD && image_id_base < 0x2BDD) + if (image_id_base >= kPeepSpriteUmbrellaStateNoneId + && image_id_base < kPeepSpriteUmbrellaStateSittingIdleId + 4) { GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->UmbrellaColour), clipCoords); } - else if (image_id_base >= 0x29DD && image_id_base < 0x29FD) + if (image_id_base >= kPeepSpriteHatStateWatchRideId + && image_id_base < kPeepSpriteHatStateSittingIdleId + 4) { GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->HatColour), clipCoords); }