From 8f82aa95b34edff8e9f4312e3da4c739dabb8b53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Fri, 7 Apr 2023 22:46:25 +0300 Subject: [PATCH] Move Direction out and rename it to Orientation to avoid name conflict --- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/drawing/LightFX.cpp | 36 ++++++------- src/openrct2/entity/Duck.cpp | 10 ++-- src/openrct2/entity/EntityBase.cpp | 2 +- src/openrct2/entity/EntityBase.h | 3 +- src/openrct2/entity/Fountain.cpp | 12 ++--- src/openrct2/entity/Guest.cpp | 26 ++++----- src/openrct2/entity/Litter.cpp | 2 +- src/openrct2/entity/Peep.cpp | 8 +-- src/openrct2/entity/Peep.h | 2 +- src/openrct2/entity/Staff.cpp | 20 +++---- src/openrct2/paint/Paint.Entity.cpp | 2 +- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 6 +-- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/CableLift.cpp | 8 +-- src/openrct2/ride/Ride.cpp | 6 +-- src/openrct2/ride/RideConstruction.cpp | 4 +- src/openrct2/ride/Vehicle.cpp | 66 +++++++++++------------ src/openrct2/ride/VehiclePaint.cpp | 18 +++---- src/openrct2/ride/gentle/MerryGoRound.cpp | 2 +- src/openrct2/ride/thrill/Enterprise.cpp | 2 +- src/openrct2/ride/thrill/Twist.cpp | 2 +- src/openrct2/ride/water/SplashBoats.cpp | 2 +- src/openrct2/world/Park.cpp | 2 +- 25 files changed, 124 insertions(+), 123 deletions(-) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 8395560846..6f0bbcad1f 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -253,7 +253,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(SpriteBase, sprite_right); COMPARE_FIELD(SpriteBase, sprite_bottom); */ - COMPARE_FIELD(EntityBase, SpriteData.Direction); + COMPARE_FIELD(EntityBase, Orientation); } void CompareSpriteDataPeep(const Peep& spriteBase, const Peep& spriteCmp, GameStateSpriteChange& changeData) const diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 0f58025fe5..d15a6714c8 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -710,8 +710,8 @@ void LightFxAddLightsMagicVehicle_MineTrainCoaster(const Vehicle* vehicle) { if (vehicle == vehicle->TrainHead()) { - int16_t place_x = vehicle->x - offsetLookup[(vehicle->SpriteData.Direction + 0) % 32] * 2; - int16_t place_y = vehicle->y - offsetLookup[(vehicle->SpriteData.Direction + 8) % 32] * 2; + int16_t place_x = vehicle->x - offsetLookup[(vehicle->Orientation + 0) % 32] * 2; + int16_t place_y = vehicle->y - offsetLookup[(vehicle->Orientation + 8) % 32] * 2; LightFXAdd3DLight(*vehicle, 0, { place_x, place_y, vehicle->z }, LightType::Spot3); } } @@ -730,11 +730,11 @@ void LightFxAddLightsMagicVehicle_BoatHire(const Vehicle* vehicle) } int16_t place_x = vehicle_draw->x; int16_t place_y = vehicle_draw->y; - place_x -= offsetLookup[(vehicle_draw->SpriteData.Direction + 0) % 32]; - place_y -= offsetLookup[(vehicle_draw->SpriteData.Direction + 8) % 32]; + place_x -= offsetLookup[(vehicle_draw->Orientation + 0) % 32]; + place_y -= offsetLookup[(vehicle_draw->Orientation + 8) % 32]; LightFXAdd3DLight(*vehicle, 0, { place_x, place_y, vehicle_draw->z }, LightType::Spot2); - place_x -= offsetLookup[(vehicle_draw->SpriteData.Direction + 0) % 32]; - place_y -= offsetLookup[(vehicle_draw->SpriteData.Direction + 8) % 32]; + place_x -= offsetLookup[(vehicle_draw->Orientation + 0) % 32]; + place_y -= offsetLookup[(vehicle_draw->Orientation + 8) % 32]; LightFXAdd3DLight(*vehicle, 1, { place_x, place_y, vehicle_draw->z }, LightType::Spot2); } void LightFxAddLightsMagicVehicle_Monorail(const Vehicle* vehicle) @@ -744,20 +744,20 @@ void LightFxAddLightsMagicVehicle_Monorail(const Vehicle* vehicle) int16_t place_y = vehicle->y; if (vehicle == vehicle->TrainHead()) { - place_x -= offsetLookup[(vehicle->SpriteData.Direction + 0) % 32] * 2; - place_y -= offsetLookup[(vehicle->SpriteData.Direction + 8) % 32] * 2; + place_x -= offsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y -= offsetLookup[(vehicle->Orientation + 8) % 32] * 2; LightFXAdd3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3); - place_x -= offsetLookup[(vehicle->SpriteData.Direction + 0) % 32] * 3; - place_y -= offsetLookup[(vehicle->SpriteData.Direction + 8) % 32] * 3; + place_x -= offsetLookup[(vehicle->Orientation + 0) % 32] * 3; + place_y -= offsetLookup[(vehicle->Orientation + 8) % 32] * 3; LightFXAdd3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3); } if (vehicle == vehicle->TrainTail()) { - place_x += offsetLookup[(vehicle->SpriteData.Direction + 0) % 32] * 2; - place_y += offsetLookup[(vehicle->SpriteData.Direction + 8) % 32] * 2; + place_x += offsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y += offsetLookup[(vehicle->Orientation + 8) % 32] * 2; LightFXAdd3DLight(*vehicle, 3, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3); - place_x += offsetLookup[(vehicle->SpriteData.Direction + 0) % 32] * 2; - place_y += offsetLookup[(vehicle->SpriteData.Direction + 8) % 32] * 2; + place_x += offsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y += offsetLookup[(vehicle->Orientation + 8) % 32] * 2; LightFXAdd3DLight(*vehicle, 4, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3); } } @@ -765,11 +765,11 @@ void LightFxAddLightsMagicVehicle_MiniatureRailway(const Vehicle* vehicle) { if (vehicle == vehicle->TrainHead()) { - int16_t place_x = vehicle->x - offsetLookup[(vehicle->SpriteData.Direction + 0) % 32] * 2; - int16_t place_y = vehicle->y - offsetLookup[(vehicle->SpriteData.Direction + 8) % 32] * 2; + int16_t place_x = vehicle->x - offsetLookup[(vehicle->Orientation + 0) % 32] * 2; + int16_t place_y = vehicle->y - offsetLookup[(vehicle->Orientation + 8) % 32] * 2; LightFXAdd3DLight(*vehicle, 1, { place_x, place_y, vehicle->z + 10 }, LightType::Lantern3); - place_x -= offsetLookup[(vehicle->SpriteData.Direction + 0) % 32] * 2; - place_y -= offsetLookup[(vehicle->SpriteData.Direction + 8) % 32] * 2; + place_x -= offsetLookup[(vehicle->Orientation + 0) % 32] * 2; + place_y -= offsetLookup[(vehicle->Orientation + 8) % 32] * 2; LightFXAdd3DLight(*vehicle, 2, { place_x, place_y, vehicle->z + 2 }, LightType::Lantern3); } else diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index 8c9455e60f..25537895ea 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -99,7 +99,7 @@ void Duck::UpdateFlyToWater() Invalidate(); int32_t manhattanDistance = abs(target_x - x) + abs(target_y - y); - int32_t direction = SpriteData.Direction >> 3; + int32_t direction = Orientation >> 3; auto destination = CoordsXYZ{ CoordsXY{ x, y } + DuckMoveOffset[direction], 0 }; int32_t manhattanDistanceN = abs(target_x - destination.x) + abs(target_y - destination.y); @@ -195,10 +195,10 @@ void Duck::UpdateSwim() if ((randomNumber & 0xFFFF) <= 0xAAA) { randomNumber >>= 16; - SpriteData.Direction = randomNumber & 0x18; + Orientation = randomNumber & 0x18; } - int32_t direction = SpriteData.Direction >> 3; + int32_t direction = Orientation >> 3; auto destination = CoordsXYZ{ CoordsXY{ x, y } + DuckMoveOffset[direction], 0 }; landZ = TileElementHeight(destination); waterZ = TileElementWaterHeight(destination); @@ -256,7 +256,7 @@ void Duck::UpdateFlyAway() Invalidate(); - int32_t direction = SpriteData.Direction >> 3; + int32_t direction = Orientation >> 3; auto destination = CoordsXYZ{ x + (DuckMoveOffset[direction].x * 2), y + (DuckMoveOffset[direction].y * 2), std::min(z + 2, 496) }; if (MapIsLocationValid(destination)) @@ -315,7 +315,7 @@ void Duck::Create(const CoordsXY& pos) targetPos.y = GetMapSizeMaxXY().y - (ScenarioRand() & 0x3F); break; } - duck->SpriteData.Direction = direction << 3; + duck->Orientation = direction << 3; duck->MoveTo({ targetPos.x, targetPos.y, 496 }); duck->state = Duck::DuckState::FlyToWater; duck->frame = 0; diff --git a/src/openrct2/entity/EntityBase.cpp b/src/openrct2/entity/EntityBase.cpp index 6788b5a926..fe534cc061 100644 --- a/src/openrct2/entity/EntityBase.cpp +++ b/src/openrct2/entity/EntityBase.cpp @@ -74,7 +74,7 @@ void EntityBase::Serialise(DataSerialiser& stream) stream << x; stream << y; stream << z; - stream << SpriteData.Direction; + stream << Orientation; } // Exists only for signature diff --git a/src/openrct2/entity/EntityBase.h b/src/openrct2/entity/EntityBase.h index 810f425fdc..89ba30b514 100644 --- a/src/openrct2/entity/EntityBase.h +++ b/src/openrct2/entity/EntityBase.h @@ -43,7 +43,8 @@ struct EntityBase int32_t y; int32_t z; EntitySpriteData SpriteData; - uint8_t Direction; + // Used as direction or rotation depending on the entity. + uint8_t Orientation; /** * Moves a sprite to a new location, invalidates the current position if valid diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index c0dad27ee3..813f627d17 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -142,7 +142,7 @@ void JumpingFountain::Create( { jumpingFountain->Iteration = iteration; jumpingFountain->FountainFlags = newFlags; - jumpingFountain->SpriteData.Direction = direction << 3; + jumpingFountain->Orientation = direction << 3; jumpingFountain->SpriteData.Width = 33; jumpingFountain->SpriteData.HeightMin = 36; jumpingFountain->SpriteData.HeightMax = 12; @@ -204,7 +204,7 @@ JumpingFountainType JumpingFountain::GetType() const void JumpingFountain::AdvanceAnimation() { const JumpingFountainType newType = GetType(); - const int32_t direction = (SpriteData.Direction >> 3) & 7; + const int32_t direction = (Orientation >> 3) & 7; const CoordsXY newLoc = CoordsXY{ x, y } + CoordsDirectionDelta[direction]; int32_t availableDirections = 0; @@ -278,7 +278,7 @@ bool JumpingFountain::IsJumpingFountain(const JumpingFountainType newType, const void JumpingFountain::GoToEdge(const CoordsXYZ& newLoc, const int32_t availableDirections) const { - int32_t direction = (SpriteData.Direction >> 3) << 1; + int32_t direction = (Orientation >> 3) << 1; if (availableDirections & (1 << direction)) { CreateNext(newLoc, direction); @@ -318,7 +318,7 @@ void JumpingFountain::Bounce(const CoordsXYZ& newLoc, const int32_t availableDir Iteration++; if (Iteration < 8) { - int32_t direction = ((SpriteData.Direction >> 3) ^ 2) << 1; + int32_t direction = ((Orientation >> 3) ^ 2) << 1; if (availableDirections & (1 << direction)) { CreateNext(newLoc, direction); @@ -339,7 +339,7 @@ void JumpingFountain::Split(const CoordsXYZ& newLoc, int32_t availableDirections if (Iteration < 3) { const auto newType = GetType(); - int32_t direction = ((SpriteData.Direction >> 3) ^ 2) << 1; + int32_t direction = ((Orientation >> 3) ^ 2) << 1; availableDirections &= ~(1 << direction); availableDirections &= ~(1 << (direction + 1)); @@ -417,7 +417,7 @@ void JumpingFountain::Paint(PaintSession& session, int32_t imageDirection) const // Fountain is firing anti clockwise bool reversed = (FountainFlags & FOUNTAIN_FLAG::DIRECTION); // Fountain rotation - bool rotated = (SpriteData.Direction / 16) & 1; + bool rotated = (Orientation / 16) & 1; bool isAntiClockwise = (imageDirection / 2) & 1; // Clockwise or Anti-clockwise // These cancel each other out diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 835273b4c9..60ff3c109f 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -500,8 +500,8 @@ void Guest::GivePassingPeepsPizza(Guest* passingPeep) passingPeep->GiveItem(ShopItem::Pizza); - int32_t peepDirection = (SpriteData.Direction >> 3) ^ 2; - int32_t otherPeepOppositeDirection = passingPeep->SpriteData.Direction >> 3; + int32_t peepDirection = (Orientation >> 3) ^ 2; + int32_t otherPeepOppositeDirection = passingPeep->Orientation >> 3; if (peepDirection == otherPeepOppositeDirection) { if (passingPeep->IsActionInterruptable()) @@ -1258,7 +1258,7 @@ void Guest::UpdateSitting() MoveTo(loc); - SpriteData.Direction = ((Var37 + 2) & 3) * 8; + Orientation = ((Var37 + 2) & 3) * 8; Action = PeepActionType::Idle; NextActionSpriteType = PeepActionSpriteType::SittingIdle; SwitchNextActionSpriteType(); @@ -3345,7 +3345,7 @@ void Guest::UpdateBuying() } WindowInvalidateByNumber(WindowClass::Peep, Id); } - SpriteData.Direction ^= 0x10; + Orientation ^= 0x10; auto destination = CoordsXY{ 16, 16 } + NextLoc; SetDestination(destination); @@ -3456,7 +3456,7 @@ void Guest::UpdateRideAtEntrance() else { DestinationTolerance = 0; - SpriteData.Direction ^= (1 << 4); + Orientation ^= (1 << 4); Invalidate(); } } @@ -3748,7 +3748,7 @@ void Guest::UpdateRideAdvanceThroughEntrance() } auto destination = GetDestination(); - switch (vehicle->SpriteData.Direction / 8) + switch (vehicle->Orientation / 8) { case 0: destination.x = vehicle->x - load_position; @@ -3818,7 +3818,7 @@ static void PeepGoToRideExit(Peep* peep, const Ride& ride, int16_t x, int16_t y, peep->SetDestination({ x, y }, 2); - peep->SpriteData.Direction = exit_direction * 8; + peep->Orientation = exit_direction * 8; peep->RideSubState = PeepRideSubState::ApproachExit; } @@ -4200,7 +4200,7 @@ void Guest::UpdateRideLeaveVehicle() if (carEntry->flags & (CAR_ENTRY_FLAG_CHAIRLIFT | CAR_ENTRY_FLAG_GO_KART)) { - specialDirection = ((vehicle->SpriteData.Direction + 3) / 8) + 1; + specialDirection = ((vehicle->Orientation + 3) / 8) + 1; specialDirection &= 3; if (vehicle->TrackSubposition == VehicleTrackSubposition::GoKartsRightLane) @@ -4235,7 +4235,7 @@ void Guest::UpdateRideLeaveVehicle() { int8_t loadPosition = carEntry->peep_loading_positions[CurrentSeat]; - switch (vehicle->SpriteData.Direction / 8) + switch (vehicle->Orientation / 8) { case 0: platformLocation.x -= loadPosition; @@ -4758,7 +4758,7 @@ void Guest::UpdateRideOnSpiralSlide() MoveTo({ newLocation, z }); - SpriteData.Direction = (Var37 & 0xC) * 2; + Orientation = (Var37 & 0xC) * 2; Var37++; return; @@ -5665,7 +5665,7 @@ void Guest::UpdateQueuing() if (Happiness <= 65 && (0xFFFF & ScenarioRand()) < 2184) { // Give up queueing for the ride - SpriteData.Direction ^= (1 << 4); + Orientation ^= (1 << 4); Invalidate(); RemoveFromQueue(); SetState(PeepState::One); @@ -5757,7 +5757,7 @@ void Guest::UpdateWatching() SetDestination(GetLocation()); - SpriteData.Direction = (Var37 & 3) * 8; + Orientation = (Var37 & 3) * 8; Action = PeepActionType::Idle; NextActionSpriteType = PeepActionSpriteType::WatchRide; @@ -7079,7 +7079,7 @@ Guest* Guest::Generate(const CoordsXYZ& coords) peep->SpriteData.Width = spriteBounds->sprite_width; peep->SpriteData.HeightMin = spriteBounds->sprite_height_negative; peep->SpriteData.HeightMax = spriteBounds->sprite_height_positive; - peep->SpriteData.Direction = 0; + peep->Orientation = 0; peep->MoveTo(coords); peep->Mass = (ScenarioRand() & 0x1F) + 45; diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 2a2519a6c4..995bfa6af7 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -80,7 +80,7 @@ void Litter::Create(const CoordsXYZD& litterPos, Type type) if (litter == nullptr) return; - litter->SpriteData.Direction = offsetLitterPos.direction; + litter->Orientation = offsetLitterPos.direction; litter->SpriteData.Width = 6; litter->SpriteData.HeightMin = 6; litter->SpriteData.HeightMax = 3; diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 3d1b8bb830..63e6910bfa 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -478,7 +478,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) nextDirection = 0; } } - SpriteData.Direction = nextDirection; + Orientation = nextDirection; CoordsXY loc = { x, y }; loc += word_981D7C[nextDirection / 8]; WalkingFrameNum++; @@ -524,7 +524,7 @@ std::optional Peep::UpdateAction(int16_t& xy_distance) WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_2; const auto curLoc = GetLocation(); - Litter::Create({ curLoc, SpriteData.Direction }, (Id.ToUnderlying() & 1) ? Litter::Type::VomitAlt : Litter::Type::Vomit); + Litter::Create({ curLoc, Orientation }, (Id.ToUnderlying() & 1) ? Litter::Type::VomitAlt : Litter::Type::Vomit); static constexpr OpenRCT2::Audio::SoundId coughs[4] = { OpenRCT2::Audio::SoundId::Cough1, @@ -872,7 +872,7 @@ void Peep::Update1() } SetDestination(GetLocation(), 10); - PeepDirection = SpriteData.Direction >> 3; + PeepDirection = Orientation >> 3; } void Peep::SetState(PeepState new_state) @@ -2779,7 +2779,7 @@ void Peep::Paint(PaintSession& session, int32_t imageDirection) const if (Is()) { auto loc = GetLocation(); - switch (SpriteData.Direction) + switch (Orientation) { case 0: loc.x -= 10; diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index 928fb60359..610b817986 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -362,7 +362,7 @@ struct Peep : EntityBase union { uint8_t MazeLastEdge; - Direction PeepDirection; // Direction ? + ::Direction PeepDirection; // Direction ? }; RideId InteractionRideIndex; uint32_t PeepId; diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 3e0c3685fc..a281f4c528 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -1132,7 +1132,7 @@ void Staff::UpdateWatering() if (!(pathingResult & PATHING_DESTINATION_REACHED)) return; - SpriteData.Direction = (Var37 & 3) << 3; + Orientation = (Var37 & 3) << 3; Action = PeepActionType::StaffWatering; ActionFrame = 0; ActionSpriteImageOffset = 0; @@ -1196,7 +1196,7 @@ void Staff::UpdateEmptyingBin() if (!(pathingResult & PATHING_DESTINATION_REACHED)) return; - SpriteData.Direction = (Var37 & 3) << 3; + Orientation = (Var37 & 3) << 3; Action = PeepActionType::StaffEmptyBin; ActionFrame = 0; ActionSpriteImageOffset = 0; @@ -1375,7 +1375,7 @@ void Staff::UpdateHeadingToInspect() auto newDestination = CoordsXY{ 16, 16 } + NextLoc + (DirectionOffsets[PeepDirection] * 53); SetDestination(newDestination, 2); - SpriteData.Direction = PeepDirection << 3; + Orientation = PeepDirection << 3; z = rideEntranceExitElement->BaseHeight * 4; SubState = 4; @@ -1485,7 +1485,7 @@ void Staff::UpdateAnswering() int32_t destY = NextLoc.y + 16 + DirectionOffsets[PeepDirection].y * 53; SetDestination({ destX, destY }, 2); - SpriteData.Direction = PeepDirection << 3; + Orientation = PeepDirection << 3; z = rideEntranceExitElement->BaseHeight * 4; SubState = 4; @@ -2110,7 +2110,7 @@ bool Staff::UpdateFixingFixVehicle(bool firstRun, const Ride& ride) { if (!firstRun) { - SpriteData.Direction = PeepDirection << 3; + Orientation = PeepDirection << 3; Action = (ScenarioRand() & 1) ? PeepActionType::StaffFix2 : PeepActionType::StaffFix; ActionSpriteImageOffset = 0; @@ -2152,7 +2152,7 @@ bool Staff::UpdateFixingFixVehicleMalfunction(bool firstRun, const Ride& ride) { if (!firstRun) { - SpriteData.Direction = PeepDirection << 3; + Orientation = PeepDirection << 3; Action = PeepActionType::StaffFix3; ActionSpriteImageOffset = 0; ActionFrame = 0; @@ -2257,7 +2257,7 @@ bool Staff::UpdateFixingFixStationEnd(bool firstRun) { if (!firstRun) { - SpriteData.Direction = PeepDirection << 3; + Orientation = PeepDirection << 3; Action = PeepActionType::StaffCheckboard; ActionFrame = 0; ActionSpriteImageOffset = 0; @@ -2369,7 +2369,7 @@ bool Staff::UpdateFixingFixStationStart(bool firstRun, const Ride& ride) return true; } - SpriteData.Direction = PeepDirection << 3; + Orientation = PeepDirection << 3; Action = PeepActionType::StaffFix; ActionFrame = 0; @@ -2397,7 +2397,7 @@ bool Staff::UpdateFixingFixStationBrakes(bool firstRun, Ride& ride) { if (!firstRun) { - SpriteData.Direction = PeepDirection << 3; + Orientation = PeepDirection << 3; Action = PeepActionType::StaffFixGround; ActionFrame = 0; @@ -2488,7 +2488,7 @@ bool Staff::UpdateFixingFinishFixOrInspect(bool firstRun, int32_t steps, Ride& r StaffRidesFixed++; WindowInvalidateFlags |= RIDE_INVALIDATE_RIDE_INCOME | RIDE_INVALIDATE_RIDE_LIST; - SpriteData.Direction = PeepDirection << 3; + Orientation = PeepDirection << 3; Action = PeepActionType::StaffAnswerCall2; ActionFrame = 0; ActionSpriteImageOffset = 0; diff --git a/src/openrct2/paint/Paint.Entity.cpp b/src/openrct2/paint/Paint.Entity.cpp index 596e9f2cdc..d4b831cea0 100644 --- a/src/openrct2/paint/Paint.Entity.cpp +++ b/src/openrct2/paint/Paint.Entity.cpp @@ -105,7 +105,7 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos) int32_t image_direction = session.CurrentRotation; image_direction <<= 3; - image_direction += spr->SpriteData.Direction; + image_direction += spr->Orientation; image_direction &= 0x1F; session.CurrentlyDrawnEntity = spr; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 95f50a53e9..f2f904d566 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -1587,7 +1587,7 @@ namespace OpenRCT2 cs.ReadWrite(entity.z); cs.ReadWrite(entity.SpriteData.Width); cs.ReadWrite(entity.SpriteData.HeightMax); - cs.ReadWrite(entity.SpriteData.Direction); + cs.ReadWrite(entity.Orientation); } static std::vector LegacyGetRideTypesBeenOn(const std::array& srcArray) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 880b70a372..b55902d8cc 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1280,7 +1280,7 @@ namespace RCT1 dst->MoveTo({ src->x, src->y, src->z }); - dst->SpriteData.Direction = src->EntityDirection; + dst->Orientation = src->EntityDirection; // Peep name if (IsUserStringID(src->NameStringID)) @@ -1366,7 +1366,7 @@ namespace RCT1 void ImportEntityCommonProperties(EntityBase* dst, const RCT12EntityBase* src) { - dst->SpriteData.Direction = src->EntityDirection; + dst->Orientation = src->EntityDirection; dst->SpriteData.Width = src->SpriteWidth; dst->SpriteData.HeightMin = src->SpriteHeightNegative; dst->SpriteData.HeightMax = src->SpriteHeightPositive; @@ -2726,7 +2726,7 @@ namespace RCT1 dst->SpriteData.Width = src->SpriteWidth; dst->SpriteData.HeightMin = src->SpriteHeightNegative; dst->SpriteData.HeightMax = src->SpriteHeightPositive; - dst->SpriteData.Direction = src->EntityDirection; + dst->Orientation = src->EntityDirection; dst->SpriteData.SpriteRect = ScreenRect(src->SpriteLeft, src->SpriteTop, src->SpriteRight, src->SpriteBottom); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index d28c79e067..41be5b51ab 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1850,7 +1850,7 @@ namespace RCT2 dst->SpriteData.Width = src->SpriteWidth; dst->SpriteData.HeightMax = src->SpriteHeightPositive; dst->SpriteData.SpriteRect = ScreenRect(src->SpriteLeft, src->SpriteTop, src->SpriteRight, src->SpriteBottom); - dst->SpriteData.Direction = src->EntityDirection; + dst->Orientation = src->EntityDirection; } void ImportEntity(const RCT12EntityBase& src); diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 11c5b847f9..58b4c94850 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -63,7 +63,7 @@ Vehicle* CableLiftSegmentCreate( peep = EntityId::GetNull(); } current->TrackSubposition = VehicleTrackSubposition::Default; - current->SpriteData.Direction = direction << 3; + current->Orientation = direction << 3; z = z * COORDS_Z_STEP; current->TrackLocation = { x, y, z }; @@ -71,7 +71,7 @@ Vehicle* CableLiftSegmentCreate( current->MoveTo({ 16, 16, z }); current->SetTrackType(TrackElemType::CableLiftHill); - current->SetTrackDirection(current->SpriteData.Direction >> 3); + current->SetTrackDirection(current->Orientation >> 3); current->track_progress = 164; current->Flags = VehicleFlags::CollisionDisabled; current->SetState(Vehicle::Status::MovingToEndOfStation, 0); @@ -285,7 +285,7 @@ bool Vehicle::CableLiftUpdateTrackMotionForwards() _vehicleCurPosition.y = nextVehiclePosition.y; _vehicleCurPosition.z = nextVehiclePosition.z; - SpriteData.Direction = moveInfo->direction; + Orientation = moveInfo->direction; bank_rotation = moveInfo->bank_rotation; Pitch = moveInfo->Pitch; @@ -351,7 +351,7 @@ bool Vehicle::CableLiftUpdateTrackMotionBackwards() _vehicleCurPosition.y = unk.y; _vehicleCurPosition.z = unk.z; - SpriteData.Direction = moveInfo->direction; + Orientation = moveInfo->direction; bank_rotation = moveInfo->bank_rotation; Pitch = moveInfo->Pitch; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index c4ba32bb84..43dd98109d 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -3216,7 +3216,7 @@ static Vehicle* VehicleCreateCar( if (numAttempts > 10000) return nullptr; - vehicle->SpriteData.Direction = ScenarioRand() & 0x1E; + vehicle->Orientation = ScenarioRand() & 0x1E; chosenLoc.y = dodgemPos.y + (ScenarioRand() & 0xFF); chosenLoc.x = dodgemPos.x + (ScenarioRand() & 0xFF); } while (vehicle->DodgemsCarWouldCollideAt(chosenLoc).has_value()); @@ -3264,7 +3264,7 @@ static Vehicle* VehicleCreateCar( vehicle->TrackLocation = chosenLoc; int32_t direction = trackElement->GetDirection(); - vehicle->SpriteData.Direction = direction << 3; + vehicle->Orientation = direction << 3; if (ride.type == RIDE_TYPE_SPACE_RINGS) { @@ -3297,7 +3297,7 @@ static Vehicle* VehicleCreateCar( vehicle->MoveTo(chosenLoc); vehicle->SetTrackType(trackElement->GetTrackType()); - vehicle->SetTrackDirection(vehicle->SpriteData.Direction >> 3); + vehicle->SetTrackDirection(vehicle->Orientation >> 3); vehicle->track_progress = 31; if (carEntry.flags & CAR_ENTRY_FLAG_MINI_GOLF) { diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 07200131bb..5395cdbcc5 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -296,7 +296,7 @@ void Ride::RemovePeeps() else { peep->MoveTo(exitPosition); - peep->SpriteData.Direction = exitPosition.direction; + peep->Orientation = exitPosition.direction; } peep->State = PeepState::Falling; @@ -326,7 +326,7 @@ void Ride::RemovePeeps() else { peep->MoveTo(exitPosition); - peep->SpriteData.Direction = exitPosition.direction; + peep->Orientation = exitPosition.direction; } peep->State = PeepState::Falling; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 3ba0c5d8e0..a49a66628e 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -2995,12 +2995,12 @@ bool Vehicle::CurrentTowerElementIsTop() */ void Vehicle::UpdateTravellingBoatHireSetup() { - var_34 = SpriteData.Direction; + var_34 = Orientation; TrackLocation.x = x; TrackLocation.y = y; TrackLocation = TrackLocation.ToTileStart(); - CoordsXY location = CoordsXY(TrackLocation) + CoordsDirectionDelta[SpriteData.Direction >> 3]; + CoordsXY location = CoordsXY(TrackLocation) + CoordsDirectionDelta[Orientation >> 3]; BoatLocation = location; var_35 = 0; @@ -3505,8 +3505,8 @@ void Vehicle::UpdateCrashSetup() lastVehicle = trainVehicle; trainVehicle->sub_state = 0; - int32_t trainX = stru_9A3AC4[trainVehicle->SpriteData.Direction / 2].x; - int32_t trainY = stru_9A3AC4[trainVehicle->SpriteData.Direction / 2].y; + int32_t trainX = stru_9A3AC4[trainVehicle->Orientation / 2].x; + int32_t trainY = stru_9A3AC4[trainVehicle->Orientation / 2].y; auto trainZ = Unk9A38D4[trainVehicle->Pitch] >> 23; int32_t ecx = Unk9A37E4[trainVehicle->Pitch] >> 15; @@ -4303,7 +4303,7 @@ void Vehicle::UpdateMotionBoatHire() if (!(var_35 & (1 << 0))) { - uint8_t spriteDirection = SpriteData.Direction; + uint8_t spriteDirection = Orientation; if (spriteDirection != var_34) { uint8_t dl = (var_34 + 16 - spriteDirection) & 0x1E; @@ -4324,20 +4324,20 @@ void Vehicle::UpdateMotionBoatHire() } } - SpriteData.Direction = spriteDirection & 0x1E; + Orientation = spriteDirection & 0x1E; } } - int32_t edi = (SpriteData.Direction | (var_35 & 1)) & 0x1F; + int32_t edi = (Orientation | (var_35 & 1)) & 0x1F; loc2 = { x + Unk9A36C4[edi].x, y + Unk9A36C4[edi].y }; if (UpdateMotionCollisionDetection({ loc2, z }, nullptr)) { remaining_distance = 0; - if (SpriteData.Direction == var_34) + if (Orientation == var_34) { - SpriteData.Direction ^= (1 << 4); + Orientation ^= (1 << 4); UpdateBoatLocation(); - SpriteData.Direction ^= (1 << 4); + Orientation ^= (1 << 4); } break; } @@ -4370,7 +4370,7 @@ void Vehicle::UpdateMotionBoatHire() if (do_Loc6DAA97) { remaining_distance = 0; - if (SpriteData.Direction == var_34) + if (Orientation == var_34) { UpdateBoatLocation(); } @@ -4496,7 +4496,7 @@ void Vehicle::UpdateBoatLocation() } sub_state = 0; - uint8_t curDirection = ((SpriteData.Direction + 19) >> 3) & 3; + uint8_t curDirection = ((Orientation + 19) >> 3) & 3; uint8_t randDirection = ScenarioRand() & 3; if (lost_time_out > 1920) @@ -5494,7 +5494,7 @@ void Vehicle::UpdateSound() sound2_volume = soundIdVolume.volume; // Calculate Sound Vector (used for sound frequency calcs) - int32_t soundDirection = SpriteDirectionToSoundDirection[SpriteData.Direction]; + int32_t soundDirection = SpriteDirectionToSoundDirection[Orientation]; int32_t soundVector = ((velocity >> 14) * soundDirection) >> 14; soundVector = std::clamp(soundVector, -127, 127); @@ -5719,23 +5719,23 @@ int32_t Vehicle::UpdateMotionDodgems() if (var_34 > 0) { var_34--; - SpriteData.Direction += 2; + Orientation += 2; } else { var_34++; - SpriteData.Direction -= 2; + Orientation -= 2; } - SpriteData.Direction &= 0x1E; + Orientation &= 0x1E; Invalidate(); } else if ((ScenarioRand() & 0xFFFF) <= 2849) { if (var_35 & (1 << 6)) - SpriteData.Direction -= 2; + Orientation -= 2; else - SpriteData.Direction += 2; - SpriteData.Direction &= 0x1E; + Orientation += 2; + Orientation &= 0x1E; Invalidate(); } } @@ -5771,7 +5771,7 @@ int32_t Vehicle::UpdateMotionDodgems() while (true) { var_35++; - uint8_t direction = SpriteData.Direction; + uint8_t direction = Orientation; direction |= var_35 & 1; CoordsXY location = _vehicleCurPosition; @@ -5798,7 +5798,7 @@ int32_t Vehicle::UpdateMotionDodgems() int32_t oldVelocity = velocity; remaining_distance = 0; velocity = 0; - uint8_t direction = SpriteData.Direction | 1; + uint8_t direction = Orientation | 1; Vehicle* collideVehicle = GetEntity(collideSprite.value()); if (collideVehicle != nullptr) @@ -6661,7 +6661,7 @@ static void AnimateSteamLocomotive(Vehicle& vehicle, const CarEntry& carEntry) { CoordsXYZ steamOffset = ComputeSteamOffset( carEntry.SteamEffect.Vertical, carEntry.SteamEffect.Longitudinal, vehicle.Pitch, - vehicle.SpriteData.Direction); + vehicle.Orientation); SteamParticle::Create(CoordsXYZ(vehicle.x, vehicle.y, vehicle.z) + steamOffset); } } @@ -7116,7 +7116,7 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth if (x_diff + y_diff + z_diff >= ecx) return false; - uint8_t direction = (SpriteData.Direction - collideVehicle->SpriteData.Direction + 7) & 0x1F; + uint8_t direction = (Orientation - collideVehicle->Orientation + 7) & 0x1F; return direction < 0xF; } @@ -7177,12 +7177,12 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth break; } - uint8_t direction = (SpriteData.Direction - vehicle2->SpriteData.Direction - 6) & 0x1F; + uint8_t direction = (Orientation - vehicle2->Orientation - 6) & 0x1F; if (direction < 0x14) continue; - uint32_t offsetSpriteDirection = (SpriteData.Direction + 4) & 31; + uint32_t offsetSpriteDirection = (Orientation + 4) & 31; uint32_t offsetDirection = offsetSpriteDirection >> 3; uint32_t next_x_diff = abs(loc.x + AvoidCollisionMoveOffset[offsetDirection].x - vehicle2->x); uint32_t next_y_diff = abs(loc.y + AvoidCollisionMoveOffset[offsetDirection].y - vehicle2->y); @@ -7219,28 +7219,28 @@ bool Vehicle::UpdateMotionCollisionDetection(const CoordsXYZ& loc, EntityId* oth if (status == Vehicle::Status::MovingToEndOfStation) { - if (SpriteData.Direction == 0) + if (Orientation == 0) { if (x <= collideVehicle->x) { return false; } } - else if (SpriteData.Direction == 8) + else if (Orientation == 8) { if (y >= collideVehicle->y) { return false; } } - else if (SpriteData.Direction == 16) + else if (Orientation == 16) { if (x >= collideVehicle->x) { return false; } } - else if (SpriteData.Direction == 24) + else if (Orientation == 24) { if (y <= collideVehicle->y) { @@ -7721,7 +7721,7 @@ Loc6DAEB9: // Loc6DB8A5 remaining_distance -= SubpositionTranslationDistances[remainingDistanceFlags]; _vehicleCurPosition = nextVehiclePosition; - SpriteData.Direction = moveInfo->direction; + Orientation = moveInfo->direction; bank_rotation = moveInfo->bank_rotation; Pitch = moveInfo->Pitch; @@ -8033,7 +8033,7 @@ bool Vehicle::UpdateTrackMotionBackwards(const CarEntry* carEntry, const Ride& c remaining_distance += SubpositionTranslationDistances[remainingDistanceFlags]; _vehicleCurPosition = nextVehiclePosition; - SpriteData.Direction = moveInfo->direction; + Orientation = moveInfo->direction; bank_rotation = moveInfo->bank_rotation; Pitch = moveInfo->Pitch; moveInfoVehicleSpriteType = moveInfo->Pitch; @@ -8391,7 +8391,7 @@ Loc6DC743: } _vehicleCurPosition = trackPos; - SpriteData.Direction = moveInfo->direction; + Orientation = moveInfo->direction; bank_rotation = moveInfo->bank_rotation; Pitch = moveInfo->Pitch; @@ -8506,7 +8506,7 @@ Loc6DCC2C: } _vehicleCurPosition = trackPos; - SpriteData.Direction = moveInfo->direction; + Orientation = moveInfo->direction; bank_rotation = moveInfo->bank_rotation; Pitch = moveInfo->Pitch; diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index 033dc9ad7e..020dc44111 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -3763,7 +3763,7 @@ static void vehicle_visual_splash1_effect(PaintSession& session, int32_t z, cons { return; } - int32_t image_id = SPR_SPLASH_EFFECT_1_NE_0 + ((((vehicle->SpriteData.Direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_1_NE_0 + ((((vehicle->Orientation / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 0, 0, 0 } }); } @@ -3774,7 +3774,7 @@ static void vehicle_visual_splash1_effect(PaintSession& session, int32_t z, cons */ static void vehicle_visual_splash2_effect(PaintSession& session, int32_t z, const Vehicle* vehicle) { - if (vehicle->SpriteData.Direction & 7) + if (vehicle->Orientation & 7) { return; } @@ -3786,7 +3786,7 @@ static void vehicle_visual_splash2_effect(PaintSession& session, int32_t z, cons { return; } - int32_t image_id = SPR_SPLASH_EFFECT_3_NE_0 + ((((vehicle->SpriteData.Direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_3_NE_0 + ((((vehicle->Orientation / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 0, 0, 0 } }); } @@ -3797,7 +3797,7 @@ static void vehicle_visual_splash2_effect(PaintSession& session, int32_t z, cons */ static void vehicle_visual_splash3_effect(PaintSession& session, int32_t z, const Vehicle* vehicle) { - if (vehicle->SpriteData.Direction & 7) + if (vehicle->Orientation & 7) { return; } @@ -3809,7 +3809,7 @@ static void vehicle_visual_splash3_effect(PaintSession& session, int32_t z, cons { return; } - int32_t image_id = SPR_SPLASH_EFFECT_1_NE_0 + ((((vehicle->SpriteData.Direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_1_NE_0 + ((((vehicle->Orientation / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 0, 0, 0 } }); } @@ -3829,7 +3829,7 @@ static void vehicle_visual_splash4_effect(PaintSession& session, int32_t z, cons { return; } - if (vehicle->SpriteData.Direction & 7) + if (vehicle->Orientation & 7) { return; } @@ -3837,7 +3837,7 @@ static void vehicle_visual_splash4_effect(PaintSession& session, int32_t z, cons { return; } - int32_t image_id = SPR_SPLASH_EFFECT_5_NE_0 + ((((vehicle->SpriteData.Direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_5_NE_0 + ((((vehicle->Orientation / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 1, 1, 0 } }); } @@ -3857,7 +3857,7 @@ static void vehicle_visual_splash5_effect(PaintSession& session, int32_t z, cons { return; } - if (vehicle->SpriteData.Direction & 7) + if (vehicle->Orientation & 7) { return; } @@ -3869,7 +3869,7 @@ static void vehicle_visual_splash5_effect(PaintSession& session, int32_t z, cons { return; } - int32_t image_id = SPR_SPLASH_EFFECT_5_NE_0 + ((((vehicle->SpriteData.Direction / 8) + session.CurrentRotation) & 3) * 8) + int32_t image_id = SPR_SPLASH_EFFECT_5_NE_0 + ((((vehicle->Orientation / 8) + session.CurrentRotation) & 3) * 8) + ((gCurrentTicks / 2) & 7); PaintAddImageAsChild(session, ImageId(image_id), { 0, 0, z }, { { 0, 0, z }, { 1, 1, 0 } }); } diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index be2c1f01cd..3ac04bf425 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -75,7 +75,7 @@ static void PaintCarousel( auto rotationOffset = 0; if (vehicle != nullptr) { - auto rotation = ((vehicle->SpriteData.Direction >> 3) + session.CurrentRotation) << 5; + auto rotation = ((vehicle->Orientation >> 3) + session.CurrentRotation) << 5; rotationOffset = (vehicle->Pitch + rotation) % 128; } diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index f1137677f1..ae24a39bc0 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -66,7 +66,7 @@ static void PaintEnterpriseStructure( uint32_t imageOffset = trackElement.GetDirectionWithOffset(session.CurrentRotation); if (vehicle != nullptr) { - imageOffset = (vehicle->Pitch << 2) + (((vehicle->SpriteData.Direction >> 3) + session.CurrentRotation) % 4); + imageOffset = (vehicle->Pitch << 2) + (((vehicle->Orientation >> 3) + session.CurrentRotation) % 4); } auto imageTemplate = ImageId(0, ride.vehicle_colours[0].Body, ride.vehicle_colours[0].Trim); diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index da708a823c..5f60c48455 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -44,7 +44,7 @@ static void PaintTwistStructure( uint32_t frameNum = (direction * 88) % 216; if (vehicle != nullptr) { - frameNum += (vehicle->SpriteData.Direction >> 3) << 4; + frameNum += (vehicle->Orientation >> 3) << 4; frameNum += vehicle->Pitch; frameNum = frameNum % 216; } diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index 8b6755415e..ec3cec1f0e 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -1259,7 +1259,7 @@ void VehicleVisualSplashBoatsOrWaterCoaster( session.CurrentlyDrawnEntity = vehicleToPaint; imageDirection = OpenRCT2::Entity::Yaw::Add( - OpenRCT2::Entity::Yaw::YawFrom4(session.CurrentRotation), vehicleToPaint->SpriteData.Direction); + OpenRCT2::Entity::Yaw::YawFrom4(session.CurrentRotation), vehicleToPaint->Orientation); session.SpritePosition.x = vehicleToPaint->x; session.SpritePosition.y = vehicleToPaint->y; vehicleToPaint->Paint(session, imageDirection); diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 94c4439e7f..76f9b55139 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -710,7 +710,7 @@ Guest* Park::GenerateGuest() peep = Guest::Generate({ spawn->x, spawn->y, spawn->z }); if (peep != nullptr) { - peep->SpriteData.Direction = direction << 3; + peep->Orientation = direction << 3; auto destination = peep->GetLocation().ToTileCentre(); peep->SetDestination(destination, 5);