Rename members of CarEntryAnimation

This commit is contained in:
Gymnasiast committed 2026-08-02 19:52:36 +02:00
1 parent e80faf5606
commit abbbb251ee
5 files changed
+35 -35

No files matched your search

+21 -21
View File
@@ -60,14 +60,14 @@ namespace OpenRCT2
constexpr uint8_t DefaultSteamSpawnPosition[] = { 11, 22 };
static const EnumMap<CarEntryAnimation> 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))
{
+9 -9
View File
@@ -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
+1 -1
View File
@@ -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,
+2 -2
View File
@@ -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);
}
+2 -2
View File
@@ -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();