From d841b2dcecb5b6ea18b92ec0a364ed9dd4b4dc08 Mon Sep 17 00:00:00 2001 From: mgiannopoulos24 <79588074+mgiannopoulos24@users.noreply.github.com> Date: Thu, 21 May 2026 22:21:42 +0300 Subject: [PATCH] Rename Litter entity members (#26597) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Rename Litter entity members * Rename `Serialise` → `serialise` in all entity types called from GameStateSnapshots.cpp. --- src/openrct2/GameStateSnapshots.cpp | 18 +++++++++--------- src/openrct2/entity/Balloon.cpp | 2 +- src/openrct2/entity/Balloon.h | 2 +- src/openrct2/entity/Duck.cpp | 2 +- src/openrct2/entity/Duck.h | 2 +- src/openrct2/entity/EntityRegistry.h | 2 +- src/openrct2/entity/Guest.cpp | 4 ++-- src/openrct2/entity/Guest.h | 2 +- src/openrct2/entity/JumpingFountain.cpp | 2 +- src/openrct2/entity/JumpingFountain.h | 2 +- src/openrct2/entity/Litter.cpp | 14 +++++++------- src/openrct2/entity/Litter.h | 8 ++++---- src/openrct2/entity/MoneyEffect.cpp | 2 +- src/openrct2/entity/MoneyEffect.h | 2 +- src/openrct2/entity/Particle.cpp | 2 +- src/openrct2/entity/Particle.h | 2 +- src/openrct2/entity/Peep.cpp | 4 ++-- src/openrct2/entity/Peep.h | 2 +- src/openrct2/entity/Staff.cpp | 4 ++-- src/openrct2/entity/Staff.h | 2 +- src/openrct2/paint/entity/Paint.Litter.cpp | 4 ++-- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/ride/Vehicle.h | 2 +- .../scripting/bindings/entity/ScLitter.cpp | 4 ++-- src/openrct2/world/Park.cpp | 2 +- 28 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 3ee0a60f1d..a39a79b19b 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -130,31 +130,31 @@ struct GameStateSnapshot_t switch (sprite.base.type) { case EntityType::vehicle: - reinterpret_cast(sprite).Serialise(ds); + reinterpret_cast(sprite).serialise(ds); break; case EntityType::guest: - reinterpret_cast(sprite).Serialise(ds); + reinterpret_cast(sprite).serialise(ds); break; case EntityType::staff: - reinterpret_cast(sprite).Serialise(ds); + reinterpret_cast(sprite).serialise(ds); break; case EntityType::litter: - reinterpret_cast(sprite).Serialise(ds); + reinterpret_cast(sprite).serialise(ds); break; case EntityType::moneyEffect: - reinterpret_cast(sprite).Serialise(ds); + reinterpret_cast(sprite).serialise(ds); break; case EntityType::balloon: - reinterpret_cast(sprite).Serialise(ds); + reinterpret_cast(sprite).serialise(ds); break; case EntityType::duck: - reinterpret_cast(sprite).Serialise(ds); + reinterpret_cast(sprite).serialise(ds); break; case EntityType::jumpingFountain: - reinterpret_cast(sprite).Serialise(ds); + reinterpret_cast(sprite).serialise(ds); break; case EntityType::steamParticle: - reinterpret_cast(sprite).Serialise(ds); + reinterpret_cast(sprite).serialise(ds); break; case EntityType::null: break; diff --git a/src/openrct2/entity/Balloon.cpp b/src/openrct2/entity/Balloon.cpp index e3540d3f27..42be0f0efb 100644 --- a/src/openrct2/entity/Balloon.cpp +++ b/src/openrct2/entity/Balloon.cpp @@ -115,7 +115,7 @@ namespace OpenRCT2 balloon->popped = (isPopped ? 1 : 0); } - void Balloon::Serialise(DataSerialiser& stream) + void Balloon::serialise(DataSerialiser& stream) { EntityBase::serialise(stream); stream << frame; diff --git a/src/openrct2/entity/Balloon.h b/src/openrct2/entity/Balloon.h index dc9eaace7a..935d32b6b3 100644 --- a/src/openrct2/entity/Balloon.h +++ b/src/openrct2/entity/Balloon.h @@ -33,7 +33,7 @@ namespace OpenRCT2 void Update(); void Pop(bool playSound); void Press(); - void Serialise(DataSerialiser& stream); + void serialise(DataSerialiser& stream); bool Collides() const; }; } // namespace OpenRCT2 diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index 029971a05d..c7868f3e39 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -364,7 +364,7 @@ static constexpr uint8_t kDuckAnimationFlyAway[] = } } - void Duck::Serialise(DataSerialiser& stream) + void Duck::serialise(DataSerialiser& stream) { EntityBase::serialise(stream); stream << frame; diff --git a/src/openrct2/entity/Duck.h b/src/openrct2/entity/Duck.h index 26f5d89277..b4cffbf552 100644 --- a/src/openrct2/entity/Duck.h +++ b/src/openrct2/entity/Duck.h @@ -41,7 +41,7 @@ namespace OpenRCT2 uint32_t GetFrameImage(int32_t direction) const; bool IsFlying(); void Remove(); - void Serialise(DataSerialiser& stream); + void serialise(DataSerialiser& stream); private: void UpdateFlyToWater(); diff --git a/src/openrct2/entity/EntityRegistry.h b/src/openrct2/entity/EntityRegistry.h index 35929f3ff8..f474f77f62 100644 --- a/src/openrct2/entity/EntityRegistry.h +++ b/src/openrct2/entity/EntityRegistry.h @@ -138,7 +138,7 @@ namespace OpenRCT2 { for (auto* ent : EntityList()) { - ent->Serialise(ds); + ent->serialise(ds); } } diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 5ad9cf2d39..45ee2a1c9f 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -7807,9 +7807,9 @@ namespace OpenRCT2 Audio::Play3D(soundId, curLoc); } - void Guest::Serialise(DataSerialiser& stream) + void Guest::serialise(DataSerialiser& stream) { - Peep::Serialise(stream); + Peep::serialise(stream); stream << GuestNumRides; stream << GuestNextInQueue; stream << ParkEntryTime; diff --git a/src/openrct2/entity/Guest.h b/src/openrct2/entity/Guest.h index a984104355..87dda429ad 100644 --- a/src/openrct2/entity/Guest.h +++ b/src/openrct2/entity/Guest.h @@ -362,7 +362,7 @@ namespace OpenRCT2 void RemoveItem(ShopItem item); void GiveItem(ShopItem item); bool HasItem(ShopItem peepItem) const; - void Serialise(DataSerialiser& stream); + void serialise(DataSerialiser& stream); // Removes the ride from the guests memory, this includes // the history, thoughts, etc. diff --git a/src/openrct2/entity/JumpingFountain.cpp b/src/openrct2/entity/JumpingFountain.cpp index 7cc87371c5..4786968d2a 100644 --- a/src/openrct2/entity/JumpingFountain.cpp +++ b/src/openrct2/entity/JumpingFountain.cpp @@ -391,7 +391,7 @@ namespace OpenRCT2 Create(newType, newLoc, direction >> 1, newFlags, Iteration); } - void JumpingFountain::Serialise(DataSerialiser& stream) + void JumpingFountain::serialise(DataSerialiser& stream) { EntityBase::serialise(stream); stream << frame; diff --git a/src/openrct2/entity/JumpingFountain.h b/src/openrct2/entity/JumpingFountain.h index fe85dc1e1d..c5eb6d1c6a 100644 --- a/src/openrct2/entity/JumpingFountain.h +++ b/src/openrct2/entity/JumpingFountain.h @@ -49,7 +49,7 @@ namespace OpenRCT2 uint16_t Iteration; void Update(); static void StartAnimation(JumpingFountainType newType, const CoordsXY& newLoc, const TileElement* tileElement); - void Serialise(DataSerialiser& stream); + void serialise(DataSerialiser& stream); private: JumpingFountainType GetType() const; diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 8ca2878a19..8179a1e9b4 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -90,7 +90,7 @@ namespace OpenRCT2 litter->spriteData.width = 6; litter->spriteData.heightMin = 6; litter->spriteData.heightMax = 3; - litter->SubType = type; + litter->subType = type; litter->moveTo(offsetLitterPos); litter->creationTick = gameState.currentTicks; } @@ -136,23 +136,23 @@ namespace OpenRCT2 STR_SHOP_ITEM_SINGULAR_EMPTY_BOWL_BLUE, }; - StringId Litter::GetName() const + StringId Litter::getName() const { - if (EnumValue(SubType) >= std::size(litterNames)) + if (EnumValue(subType) >= std::size(litterNames)) return kStringIdNone; - return litterNames[EnumValue(SubType)]; + return litterNames[EnumValue(subType)]; } - uint32_t Litter::GetAge() const + uint32_t Litter::getAge() const { return getGameState().currentTicks - creationTick; } - void Litter::Serialise(DataSerialiser& stream) + void Litter::serialise(DataSerialiser& stream) { EntityBase::serialise(stream); - stream << SubType; + stream << subType; stream << creationTick; } } // namespace OpenRCT2 diff --git a/src/openrct2/entity/Litter.h b/src/openrct2/entity/Litter.h index 9864c4e33e..5a27704c77 100644 --- a/src/openrct2/entity/Litter.h +++ b/src/openrct2/entity/Litter.h @@ -39,12 +39,12 @@ namespace OpenRCT2 }; static constexpr auto cEntityType = EntityType::litter; - Type SubType; + Type subType; uint32_t creationTick; static void Create(const CoordsXYZD& litterPos, Type type); static void RemoveAt(const CoordsXYZ& litterPos); - void Serialise(DataSerialiser& stream); - StringId GetName() const; - uint32_t GetAge() const; + void serialise(DataSerialiser& stream); + StringId getName() const; + uint32_t getAge() const; }; } // namespace OpenRCT2 diff --git a/src/openrct2/entity/MoneyEffect.cpp b/src/openrct2/entity/MoneyEffect.cpp index b4960a441f..2184fbaec0 100644 --- a/src/openrct2/entity/MoneyEffect.cpp +++ b/src/openrct2/entity/MoneyEffect.cpp @@ -168,7 +168,7 @@ namespace OpenRCT2 return std::make_pair(stringId, outValue); } - void MoneyEffect::Serialise(DataSerialiser& stream) + void MoneyEffect::serialise(DataSerialiser& stream) { EntityBase::serialise(stream); stream << frame; diff --git a/src/openrct2/entity/MoneyEffect.h b/src/openrct2/entity/MoneyEffect.h index 314877547c..d3c05f595c 100644 --- a/src/openrct2/entity/MoneyEffect.h +++ b/src/openrct2/entity/MoneyEffect.h @@ -39,7 +39,7 @@ namespace OpenRCT2 void SetValue(money64 value); void Update(); std::pair GetStringId() const; - void Serialise(DataSerialiser& stream); + void serialise(DataSerialiser& stream); void Paint(PaintSession& session, int32_t imageDirection) const; }; } // namespace OpenRCT2 diff --git a/src/openrct2/entity/Particle.cpp b/src/openrct2/entity/Particle.cpp index c868183e61..796f011571 100644 --- a/src/openrct2/entity/Particle.cpp +++ b/src/openrct2/entity/Particle.cpp @@ -244,7 +244,7 @@ namespace OpenRCT2 } } - void SteamParticle::Serialise(DataSerialiser& stream) + void SteamParticle::serialise(DataSerialiser& stream) { EntityBase::serialise(stream); stream << frame; diff --git a/src/openrct2/entity/Particle.h b/src/openrct2/entity/Particle.h index e0d5f6c633..d7a417e531 100644 --- a/src/openrct2/entity/Particle.h +++ b/src/openrct2/entity/Particle.h @@ -88,7 +88,7 @@ namespace OpenRCT2 static void Create(const CoordsXYZ& coords); void Update(); - void Serialise(DataSerialiser& stream); + void serialise(DataSerialiser& stream); void Paint(PaintSession& session, int32_t imageDirection) const; }; } // namespace OpenRCT2 diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index f208f3919c..c398ccc86a 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -2017,7 +2017,7 @@ namespace OpenRCT2 if (const auto* litter = otherEnt->as(); litter != nullptr) { - if (litter->SubType != Litter::Type::vomit && litter->SubType != Litter::Type::vomitAlt) + if (litter->subType != Litter::Type::vomit && litter->subType != Litter::Type::vomitAlt) { litterCount++; } @@ -2699,7 +2699,7 @@ namespace OpenRCT2 return CoordsXY{ DestinationX, DestinationY }; } - void Peep::Serialise(DataSerialiser& stream) + void Peep::serialise(DataSerialiser& stream) { EntityBase::serialise(stream); if (stream.IsLoading()) diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index 2fc73ee568..e6e1a5a52c 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -418,7 +418,7 @@ namespace OpenRCT2 void SetDestination(const CoordsXY& coords, int32_t tolerance); [[nodiscard]] CoordsXY GetDestination() const; - void Serialise(class DataSerialiser& stream); + void serialise(class DataSerialiser& stream); // TODO: Make these private again when done refactoring public: // Peep diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 7b35d3c382..500420e7f9 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -2628,9 +2628,9 @@ namespace OpenRCT2 } } - void Staff::Serialise(DataSerialiser& stream) + void Staff::serialise(DataSerialiser& stream) { - Peep::Serialise(stream); + Peep::serialise(stream); stream << AssignedStaffType; stream << MechanicTimeSinceCall; stream << HireDate; diff --git a/src/openrct2/entity/Staff.h b/src/openrct2/entity/Staff.h index a9f1f14fc5..8e635a34f1 100644 --- a/src/openrct2/entity/Staff.h +++ b/src/openrct2/entity/Staff.h @@ -89,7 +89,7 @@ namespace OpenRCT2 bool CanIgnoreWideFlag(const CoordsXYZ& staffPos, TileElement* path) const; static void ResetStats(); - void Serialise(DataSerialiser& stream); + void serialise(DataSerialiser& stream); void ClearPatrolArea(); void SetPatrolArea(const CoordsXY& coords, bool value); diff --git a/src/openrct2/paint/entity/Paint.Litter.cpp b/src/openrct2/paint/entity/Paint.Litter.cpp index 3a0b23954f..a9341158e0 100644 --- a/src/openrct2/paint/entity/Paint.Litter.cpp +++ b/src/openrct2/paint/entity/Paint.Litter.cpp @@ -50,9 +50,9 @@ namespace OpenRCT2 imageDirection >>= 3; // Some litter types have only 1 direction so remove // anything that isn't required. - imageDirection &= kLitterSprites[EnumValue(litter.SubType)].direction_mask; + imageDirection &= kLitterSprites[EnumValue(litter.subType)].direction_mask; - uint32_t image_id = imageDirection + kLitterSprites[EnumValue(litter.SubType)].base_id; + uint32_t image_id = imageDirection + kLitterSprites[EnumValue(litter.subType)].base_id; // In the following call to PaintAddImageAsParent, we add 4 (instead of 2) to the // bound_box_offset_z to make sure litter is drawn on top of railways diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index d1c5c91c90..8ac0f651e4 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -2631,7 +2631,7 @@ namespace OpenRCT2 void ParkFile::ReadWriteEntity(OrcaStream& os, OrcaStream::ChunkStream& cs, Litter& entity) { ReadWriteEntityCommon(cs, entity); - cs.readWrite(entity.SubType); + cs.readWrite(entity.subType); cs.readWrite(entity.creationTick); } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index ab4ed34b3b..c334d38d04 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -3040,7 +3040,7 @@ namespace OpenRCT2::RCT1 auto* src = static_cast(&srcBase); ImportEntityCommonProperties(dst, src); - dst->SubType = Litter::Type(src->Type); + dst->subType = Litter::Type(src->Type); dst->creationTick = src->CreationTick; } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 204ac4ea2e..6f0f05fe06 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -2320,7 +2320,7 @@ namespace OpenRCT2::RCT2 auto dst = getGameState().entities.CreateEntityAt<::Litter>(EntityId::FromUnderlying(baseSrc.EntityIndex)); auto src = static_cast(&baseSrc); ImportEntityCommonProperties(dst, src); - dst->SubType = ::Litter::Type(src->Type); + dst->subType = ::Litter::Type(src->Type); dst->creationTick = AdjustScenarioToCurrentTicks(_s6, src->CreationTick); } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 553aaadad2..cc06b29b3f 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1508,7 +1508,7 @@ void Vehicle::EnableCollisionsForTrain() } } -void Vehicle::Serialise(DataSerialiser& stream) +void Vehicle::serialise(DataSerialiser& stream) { EntityBase::serialise(stream); stream << SubType; diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 0787978abb..9fd6c0cb08 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -322,7 +322,7 @@ struct Vehicle : OpenRCT2::EntityBase TrackTypeAndDirection |= trackDirection & kVehicleTrackDirectionMask; } void ApplyMass(int16_t appliedMass); - void Serialise(OpenRCT2::DataSerialiser& stream); + void serialise(OpenRCT2::DataSerialiser& stream); bool IsCableLift() const; friend void UpdateRotatingDefault(Vehicle& vehicle); diff --git a/src/openrct2/scripting/bindings/entity/ScLitter.cpp b/src/openrct2/scripting/bindings/entity/ScLitter.cpp index 6f66ab6791..860906a65d 100644 --- a/src/openrct2/scripting/bindings/entity/ScLitter.cpp +++ b/src/openrct2/scripting/bindings/entity/ScLitter.cpp @@ -59,7 +59,7 @@ namespace OpenRCT2::Scripting auto* litter = GetLitter(thisVal); if (litter != nullptr) { - auto it = LitterTypeMap.find(litter->SubType); + auto it = LitterTypeMap.find(litter->subType); if (it != LitterTypeMap.end()) { return JSFromStdString(ctx, it->first); @@ -77,7 +77,7 @@ namespace OpenRCT2::Scripting if (it != LitterTypeMap.end()) { auto* litter = GetLitter(thisVal); - litter->SubType = it->second; + litter->subType = it->second; litter->invalidate(); } return JS_UNDEFINED; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 73fafe16c0..3cfe43fbfc 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -478,7 +478,7 @@ namespace OpenRCT2::Park // Counts the amount of litter whose age is min. 7680 ticks (5~ min) old. const auto litterList = EntityList(); const auto litterCount = std::count_if( - litterList.begin(), litterList.end(), [](auto* litter) { return litter->GetAge() >= 7680; }); + litterList.begin(), litterList.end(), [](auto* litter) { return litter->getAge() >= 7680; }); result -= 600 - (4 * (150 - std::min(150, litterCount))); }