From ee7bb61bb0a87d55d83dde6beae8e9e2325caf3b Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 22 Sep 2024 16:10:04 +0200 Subject: [PATCH] Rename WalkingFrameNum to WalkingAnimationFrameNum --- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/actions/StaffHireNewAction.cpp | 2 +- src/openrct2/entity/Guest.cpp | 4 ++-- src/openrct2/entity/Peep.cpp | 10 +++++----- src/openrct2/entity/Peep.h | 2 +- src/openrct2/entity/Staff.cpp | 2 +- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/scripting/bindings/entity/ScGuest.cpp | 6 +++--- src/openrct2/scripting/bindings/entity/ScStaff.cpp | 6 +++--- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index cff6e0a1fc..43395e98ce 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -302,7 +302,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, PathfindHistory[i].z); COMPARE_FIELD(Peep, PathfindHistory[i].direction); } - COMPARE_FIELD(Peep, WalkingFrameNum); + COMPARE_FIELD(Peep, WalkingAnimationFrameNum); COMPARE_FIELD(Peep, PeepFlags); } diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index 8892840f4d..c53e021486 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -133,7 +133,7 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const newPeep->Action = PeepActionType::Walking; newPeep->SpecialSprite = 0; newPeep->ActionSpriteImageOffset = 0; - newPeep->WalkingFrameNum = 0; + newPeep->WalkingAnimationFrameNum = 0; newPeep->AnimationType = PeepAnimationType::None; newPeep->PathCheckOptimisation = 0; newPeep->PeepFlags = 0; diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 8cd4a2bbf0..cd87e6935c 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -6739,7 +6739,7 @@ void Guest::SetSpriteType(PeepSpriteType new_sprite_type) SpriteType = new_sprite_type; ActionSpriteImageOffset = 0; - WalkingFrameNum = 0; + WalkingAnimationFrameNum = 0; if (IsActionInterruptable()) Action = PeepActionType::Walking; @@ -7125,7 +7125,7 @@ Guest* Guest::Generate(const CoordsXYZ& coords) peep->Action = PeepActionType::Walking; peep->SpecialSprite = 0; peep->ActionSpriteImageOffset = 0; - peep->WalkingFrameNum = 0; + peep->WalkingAnimationFrameNum = 0; peep->AnimationType = PeepAnimationType::None; peep->PeepFlags = 0; peep->FavouriteRide = RideId::GetNull(); diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 6c7cef1437..7b85e48d87 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -509,13 +509,13 @@ std::optional Peep::UpdateWalkingAction(const CoordsXY& differenceLoc, void Peep::UpdateWalkingAnimation() { - WalkingFrameNum++; + WalkingAnimationFrameNum++; const PeepAnimation& peepAnimation = GetPeepAnimation(SpriteType, AnimationType); - if (WalkingFrameNum >= peepAnimation.frame_offsets.size()) + if (WalkingAnimationFrameNum >= peepAnimation.frame_offsets.size()) { - WalkingFrameNum = 0; + WalkingAnimationFrameNum = 0; } - ActionSpriteImageOffset = peepAnimation.frame_offsets[WalkingFrameNum]; + ActionSpriteImageOffset = peepAnimation.frame_offsets[WalkingAnimationFrameNum]; } void Peep::ThrowUp() @@ -2819,7 +2819,7 @@ void Peep::Serialise(DataSerialiser& stream) stream << PathCheckOptimisation; stream << PathfindGoal; stream << PathfindHistory; - stream << WalkingFrameNum; + stream << WalkingAnimationFrameNum; stream << PeepFlags; } diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index c891624da3..9c437f14ae 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -370,7 +370,7 @@ struct Peep : EntityBase uint8_t PathCheckOptimisation; // see peep.checkForPath TileCoordsXYZD PathfindGoal; std::array PathfindHistory; - uint8_t WalkingFrameNum; + uint8_t WalkingAnimationFrameNum; uint32_t PeepFlags; public: // Peep diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index f62372805d..438440551a 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -1700,7 +1700,7 @@ void Staff::Tick128UpdateStaff() SpriteType = newSpriteType; ActionSpriteImageOffset = 0; - WalkingFrameNum = 0; + WalkingAnimationFrameNum = 0; if (Action < PeepActionType::Idle) Action = PeepActionType::Walking; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 66fb34bfd0..0cbeff32df 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -1919,7 +1919,7 @@ namespace OpenRCT2 cs.ReadWrite(entity.PathfindHistory[i].z); cs.ReadWrite(entity.PathfindHistory[i].direction); } - cs.ReadWrite(entity.WalkingFrameNum); + cs.ReadWrite(entity.WalkingAnimationFrameNum); if (version <= 1) { diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 3326cb91bf..498f286949 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1303,7 +1303,7 @@ namespace OpenRCT2::RCT1 dst->SpecialSprite = src->SpecialSprite; dst->NextAnimationType = static_cast(src->NextAnimationType); dst->ActionSpriteImageOffset = src->ActionSpriteImageOffset; - dst->WalkingFrameNum = src->NoActionFrameNum; + dst->WalkingAnimationFrameNum = src->NoActionFrameNum; dst->AnimationType = static_cast(src->AnimationType); dst->ActionFrame = src->ActionFrame; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index ca32d8cf91..f12a98f708 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1663,7 +1663,7 @@ namespace OpenRCT2::RCT2 src->PathfindHistory[i].direction }; } } - dst->WalkingFrameNum = src->NoActionFrameNum; + dst->WalkingAnimationFrameNum = src->NoActionFrameNum; } constexpr EntityType GetEntityTypeFromRCT2Sprite(const RCT12EntityBase* src) diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp index 8322368da5..df80d4c859 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.cpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.cpp @@ -942,7 +942,7 @@ namespace OpenRCT2::Scripting auto offset = 0; if (peep->IsActionWalking()) - peep->WalkingFrameNum = offset; + peep->WalkingAnimationFrameNum = offset; else peep->ActionFrame = offset; @@ -960,7 +960,7 @@ namespace OpenRCT2::Scripting } if (peep->IsActionWalking()) - return peep->WalkingFrameNum; + return peep->WalkingAnimationFrameNum; else return peep->ActionFrame; } @@ -976,7 +976,7 @@ namespace OpenRCT2::Scripting offset %= length; if (peep->IsActionWalking()) - peep->WalkingFrameNum = offset; + peep->WalkingAnimationFrameNum = offset; else peep->ActionFrame = offset; diff --git a/src/openrct2/scripting/bindings/entity/ScStaff.cpp b/src/openrct2/scripting/bindings/entity/ScStaff.cpp index 9103edf56f..d18b1c923f 100644 --- a/src/openrct2/scripting/bindings/entity/ScStaff.cpp +++ b/src/openrct2/scripting/bindings/entity/ScStaff.cpp @@ -384,7 +384,7 @@ namespace OpenRCT2::Scripting auto offset = 0; if (peep->IsActionWalking()) - peep->WalkingFrameNum = offset; + peep->WalkingAnimationFrameNum = offset; else peep->ActionFrame = offset; @@ -402,7 +402,7 @@ namespace OpenRCT2::Scripting } if (peep->IsActionWalking()) - return peep->WalkingFrameNum; + return peep->WalkingAnimationFrameNum; else return peep->ActionFrame; } @@ -418,7 +418,7 @@ namespace OpenRCT2::Scripting offset %= length; if (peep->IsActionWalking()) - peep->WalkingFrameNum = offset; + peep->WalkingAnimationFrameNum = offset; else peep->ActionFrame = offset;