From abbbb251eeafe49454a43fa2fc7a25c821ab2039 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 2 Aug 2026 19:52:36 +0200 Subject: [PATCH] Rename members of CarEntryAnimation --- src/openrct2/object/RideObject.cpp | 42 ++++++++++++------------- src/openrct2/ride/CarEntry.h | 18 +++++------ src/openrct2/ride/RideData.cpp | 2 +- src/openrct2/ride/Vehicle.Animation.cpp | 4 +-- src/openrct2/ride/Vehicle.cpp | 4 +-- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 79ee5adfd8..426f1ec075 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -60,14 +60,14 @@ namespace OpenRCT2 constexpr uint8_t DefaultSteamSpawnPosition[] = { 11, 22 }; static const EnumMap AnimationNameLookup{ - { "none", CarEntryAnimation::None }, - { "simpleVehicle", CarEntryAnimation::SimpleVehicle }, - { "steamLocomotive", CarEntryAnimation::SteamLocomotive }, - { "swanBoat", CarEntryAnimation::SwanBoat }, - { "monorailCycle", CarEntryAnimation::MonorailCycle }, - { "MultiDimension", CarEntryAnimation::MultiDimension }, - { "observationTower", CarEntryAnimation::ObservationTower }, - { "animalFlying", CarEntryAnimation::AnimalFlying }, + { "none", CarEntryAnimation::none }, + { "simpleVehicle", CarEntryAnimation::simpleVehicle }, + { "steamLocomotive", CarEntryAnimation::steamLocomotive }, + { "swanBoat", CarEntryAnimation::swanBoat }, + { "monorailCycle", CarEntryAnimation::monorailCycle }, + { "MultiDimension", CarEntryAnimation::multiDimension }, + { "observationTower", CarEntryAnimation::observationTower }, + { "animalFlying", CarEntryAnimation::animalFlying }, }; constexpr auto NumLegacyAnimationTypes = 11; @@ -80,24 +80,24 @@ namespace OpenRCT2 }; constexpr LegacyAnimationParameters VehicleEntryDefaultAnimation[] = { - { 0, 1, CarEntryAnimation::None }, // None - { 1 << 12, 4, CarEntryAnimation::SteamLocomotive }, // Miniature Railway Locomotive - { 1 << 10, 2, CarEntryAnimation::SwanBoat }, // Swan Boat - { 1 << 11, 6, CarEntryAnimation::SimpleVehicle }, // Canoe - { 1 << 11, 7, CarEntryAnimation::SimpleVehicle }, // Rowboat - { 1 << 10, 2, CarEntryAnimation::SimpleVehicle }, // Water Tricycle - { 0x3333, 8, CarEntryAnimation::ObservationTower }, // Observation Tower - { 1 << 10, 4, CarEntryAnimation::SimpleVehicle }, // Mini Helicopter - { 1 << 11, 4, CarEntryAnimation::MonorailCycle }, // Monorail Cycle - { 0x3333, 8, CarEntryAnimation::MultiDimension }, // Multi Dimension Coaster - { 24, 4, CarEntryAnimation::AnimalFlying }, // Animal Flying + { 0, 1, CarEntryAnimation::none }, // None + { 1 << 12, 4, CarEntryAnimation::steamLocomotive }, // Miniature Railway Locomotive + { 1 << 10, 2, CarEntryAnimation::swanBoat }, // Swan Boat + { 1 << 11, 6, CarEntryAnimation::simpleVehicle }, // Canoe + { 1 << 11, 7, CarEntryAnimation::simpleVehicle }, // Rowboat + { 1 << 10, 2, CarEntryAnimation::simpleVehicle }, // Water Tricycle + { 0x3333, 8, CarEntryAnimation::observationTower }, // Observation Tower + { 1 << 10, 4, CarEntryAnimation::simpleVehicle }, // Mini Helicopter + { 1 << 11, 4, CarEntryAnimation::monorailCycle }, // Monorail Cycle + { 0x3333, 8, CarEntryAnimation::multiDimension }, // Multi Dimension Coaster + { 24, 4, CarEntryAnimation::animalFlying }, // Animal Flying }; static_assert(std::size(VehicleEntryDefaultAnimation) == NumLegacyAnimationTypes); static CarEntryAnimation GetAnimationTypeFromString(const std::string& s) { auto result = AnimationNameLookup.find(s); - return (result != AnimationNameLookup.end()) ? result->second : CarEntryAnimation::None; + return (result != AnimationNameLookup.end()) ? result->second : CarEntryAnimation::none; } static LegacyAnimationParameters GetDefaultAnimationParameters(uint8_t legacyAnimationType) @@ -486,7 +486,7 @@ namespace OpenRCT2 if (!carEntry.flags.has(CarEntryFlag::hasSpinningCombinedWithNonSpinning)) { if (carEntry.flags.has(CarEntryFlag::hasVehicleAnimation) - && carEntry.animation != CarEntryAnimation::ObservationTower) + && carEntry.animation != CarEntryAnimation::observationTower) { if (!carEntry.flags.has(CarEntryFlag::hasDodgemInUseLights)) { diff --git a/src/openrct2/ride/CarEntry.h b/src/openrct2/ride/CarEntry.h index 69e2950d83..ae150b3ee0 100644 --- a/src/openrct2/ride/CarEntry.h +++ b/src/openrct2/ride/CarEntry.h @@ -28,15 +28,15 @@ enum class SoundRange : uint8_t; enum class CarEntryAnimation : uint8_t { - None = 0, - SimpleVehicle, - SteamLocomotive, - SwanBoat, - MonorailCycle, - MultiDimension, - ObservationTower, - AnimalFlying, - Count, + none = 0, + simpleVehicle, + steamLocomotive, + swanBoat, + monorailCycle, + multiDimension, + observationTower, + animalFlying, + count, }; enum class CarEntryFlag : uint8_t diff --git a/src/openrct2/ride/RideData.cpp b/src/openrct2/ride/RideData.cpp index c6f3c4ff51..559acf52a4 100644 --- a/src/openrct2/ride/RideData.cpp +++ b/src/openrct2/ride/RideData.cpp @@ -136,7 +136,7 @@ const CarEntry kCableLiftVehicle = { .spriteWidth = 0, .spriteHeightNegative = 0, .spriteHeightPositive = 0, - .animation = CarEntryAnimation::None, + .animation = CarEntryAnimation::none, .flags = {}, .base_num_frames = 1, .base_image_id = 29110, diff --git a/src/openrct2/ride/Vehicle.Animation.cpp b/src/openrct2/ride/Vehicle.Animation.cpp index 22d4b3b896..b0575d9152 100644 --- a/src/openrct2/ride/Vehicle.Animation.cpp +++ b/src/openrct2/ride/Vehicle.Animation.cpp @@ -1085,7 +1085,7 @@ constexpr static const AnimateFunction AnimationFunctions[]{ AnimateNone, AnimateSimpleVehicle, AnimateSteamLocomotive, AnimateSwanBoat, AnimateMonorailCycle, AnimateMultiDimension, AnimateObservationTower, AnimateAnimalFlying, }; -static_assert(std::size(AnimationFunctions) == EnumValue(CarEntryAnimation::Count)); +static_assert(std::size(AnimationFunctions) == EnumValue(CarEntryAnimation::count)); /** * @@ -1098,7 +1098,7 @@ void Vehicle::UpdateAdditionalAnimation() { return; } - if (carEntry->AnimationFrames == 0 || carEntry->animation >= CarEntryAnimation::Count) + if (carEntry->AnimationFrames == 0 || carEntry->animation >= CarEntryAnimation::count) return; AnimationFunctions[EnumValue(carEntry->animation)](*this, *carEntry); } diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index de6a3726a1..a4eaecffe3 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -366,7 +366,7 @@ bool Vehicle::OpenRestraints() continue; } } - if (carEntry.animation == CarEntryAnimation::ObservationTower && vehicle->animation_frame != 0) + if (carEntry.animation == CarEntryAnimation::observationTower && vehicle->animation_frame != 0) { if (vehicle->animationState <= 0xCCCC) { @@ -382,7 +382,7 @@ bool Vehicle::OpenRestraints() restraintsOpen = false; continue; } - if (carEntry.animation == CarEntryAnimation::AnimalFlying + if (carEntry.animation == CarEntryAnimation::animalFlying && (vehicle->animation_frame != 0 || vehicle->animationState > 0)) { vehicle->UpdateAnimationAnimalFlying();