From 7c65a372aadea38c16b2396a80a378d8830c35d0 Mon Sep 17 00:00:00 2001 From: reversebottle Date: Tue, 26 Mar 2024 08:24:25 -0400 Subject: [PATCH] Add kParkRatingHistorySize constant --- src/openrct2-ui/windows/Park.cpp | 2 +- src/openrct2/GameState.h | 3 ++- src/openrct2/rct1/RCT1.h | 3 ++- src/openrct2/rct2/RCT2.h | 3 ++- src/openrct2/world/Park.h | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 99e23e55e0..02310b3c7a 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -731,7 +731,7 @@ static constexpr WindowParkAward _parkAwards[] = { // Graph screenPos = windowPos + ScreenCoordsXY{ widget->left + 47, widget->top + 26 }; - Graph::Draw(dpi, GetGameState().ParkRatingHistory, 32, screenPos); + Graph::Draw(dpi, GetGameState().ParkRatingHistory, kParkRatingHistorySize, screenPos); } #pragma endregion diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 7bf8f1ddea..3a6538e627 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -24,6 +24,7 @@ #include "world/Banner.h" #include "world/Climate.h" #include "world/Location.hpp" +#include "world/Park.h" #include #include @@ -52,7 +53,7 @@ namespace OpenRCT2 money64 ConstructionRightsPrice; money64 CurrentExpenditure; money64 CurrentProfit; - uint8_t ParkRatingHistory[32]; + uint8_t ParkRatingHistory[kParkRatingHistorySize]; uint32_t GuestsInParkHistory[32]; ClimateType Climate; ClimateState ClimateCurrent; diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 88a43c6fdd..7ba5978708 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -11,6 +11,7 @@ #include "../rct12/RCT12.h" #include "../ride/RideRatings.h" +#include "../world/Park.h" #include "Limits.h" namespace RCT1 @@ -772,7 +773,7 @@ namespace RCT1 uint16_t AvailableBanners; uint8_t Unk1990AA[94]; uint16_t ParkRating; - uint8_t ParkRatingHistory[32]; + uint8_t ParkRatingHistory[kParkRatingHistorySize]; uint8_t GuestsInParkHistory[32]; uint8_t ResearchPriority; uint8_t ResearchProgressStage; diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 61ea286cd9..16ddbbe13d 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -13,6 +13,7 @@ #include "../core/FileSystem.hpp" #include "../rct12/RCT12.h" #include "../ride/RideRatings.h" +#include "../world/Park.h" #include "Limits.h" #include @@ -889,7 +890,7 @@ namespace RCT2 uint16_t ParkRating; // Ignored in scenario - uint8_t ParkRatingHistory[32]; + uint8_t ParkRatingHistory[kParkRatingHistorySize]; uint8_t GuestsInParkHistory[32]; // SC6[10] diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index ce5a53d8be..b11488dfa7 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -16,6 +16,7 @@ constexpr auto MAX_ENTRANCE_FEE = 999.00_GBP; constexpr uint8_t ParkRatingHistoryUndefined = std::numeric_limits::max(); constexpr uint32_t GuestsInParkHistoryUndefined = std::numeric_limits::max(); +constexpr uint8_t kParkRatingHistorySize = 32; constexpr uint8_t ParkNameMaxLength = 128; constexpr uint8_t ScenarioNameMaxLength = 128; constexpr uint16_t ScenarioDetailsNameMaxLength = 256;