1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 16:24:35 +01:00

Move gPeepWarningThrottle to GameState_t

This commit is contained in:
Harry Hopkinson
2024-03-14 17:39:11 +00:00
committed by GitHub
parent 15650ad184
commit b69db13de3
6 changed files with 7 additions and 9 deletions

View File

@@ -102,6 +102,7 @@ namespace OpenRCT2
std::vector<ScenerySelection> RestrictedScenery;
std::vector<PeepSpawn> PeepSpawns;
uint8_t PeepWarningThrottle[16];
News::ItemQueues NewsItems;

View File

@@ -66,8 +66,6 @@
using namespace OpenRCT2;
using namespace OpenRCT2::Audio;
uint8_t gPeepWarningThrottle[16];
static uint8_t _unk_F1AEF0;
static TileElement* _peepRideEntranceExitElement;
@@ -1037,10 +1035,12 @@ void Peep::Update()
*/
void PeepProblemWarningsUpdate()
{
auto& gameState = GetGameState();
Ride* ride;
uint32_t hungerCounter = 0, lostCounter = 0, noexitCounter = 0, thirstCounter = 0, litterCounter = 0, disgustCounter = 0,
toiletCounter = 0, vandalismCounter = 0;
uint8_t* warningThrottle = gPeepWarningThrottle;
uint8_t* warningThrottle = gameState.PeepWarningThrottle;
int32_t inQueueCounter = 0;
int32_t tooLongQueueCounter = 0;
@@ -1116,7 +1116,6 @@ void PeepProblemWarningsUpdate()
break;
}
}
auto& gameState = GetGameState();
// could maybe be packed into a loop, would lose a lot of clarity though
if (warningThrottle[0])

View File

@@ -459,8 +459,6 @@ enum
extern const PeepAnimationEntry g_peep_animation_entries[EnumValue(PeepSpriteType::Count)];
extern const bool gSpriteTypeToSlowWalkMap[48];
extern uint8_t gPeepWarningThrottle[16];
int32_t PeepGetStaffCount();
void PeepUpdateAll();
void PeepProblemWarningsUpdate();

View File

@@ -112,7 +112,7 @@ void News::InitQueue()
assert(gameState.NewsItems.IsEmpty());
// Throttles for warning types (PEEP_*_WARNING)
for (auto& warningThrottle : gPeepWarningThrottle)
for (auto& warningThrottle : gameState.PeepWarningThrottle)
{
warningThrottle = 0;
}

View File

@@ -912,7 +912,7 @@ namespace OpenRCT2
cs.ReadWrite(gameState.GuestGenerationProbability);
cs.ReadWrite(gameState.SuggestedGuestMaximum);
cs.ReadWriteArray(gPeepWarningThrottle, [&cs](uint8_t& value) {
cs.ReadWriteArray(gameState.PeepWarningThrottle, [&cs](uint8_t& value) {
cs.ReadWrite(value);
return true;
});

View File

@@ -375,7 +375,7 @@ namespace RCT2
gameState.TotalAdmissions = _s6.TotalAdmissions;
gameState.TotalIncomeFromAdmissions = ToMoney64(_s6.IncomeFromAdmissions);
gameState.CompanyValue = ToMoney64(_s6.CompanyValue);
std::memcpy(gPeepWarningThrottle, _s6.PeepWarningThrottle, sizeof(_s6.PeepWarningThrottle));
std::memcpy(gameState.PeepWarningThrottle, _s6.PeepWarningThrottle, sizeof(_s6.PeepWarningThrottle));
// Awards
auto& awards = GetAwards();