1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-02 11:45:13 +01:00

Load temporary map animations from S6 files

This commit is contained in:
mix
2025-05-21 14:11:49 +01:00
parent 57148e137a
commit b6537a4799
2 changed files with 40 additions and 0 deletions

View File

@@ -1167,6 +1167,7 @@ static_assert(sizeof(RCT12MapAnimation) == 6);
static constexpr uint8_t kRCT12MapAnimationTypeOnRidePhoto = 6;
static constexpr uint8_t kRCT12MapAnimationTypeLandEdgeDoor = 9;
static constexpr uint8_t kRCT12MapAnimationTypeWallDoor = 12;
struct RCT12ResearchItem
{

View File

@@ -569,6 +569,8 @@ namespace OpenRCT2::RCT2
gameState.savedViewZoom = ZoomLevel{ static_cast<int8_t>(_s6.SavedViewZoom) };
gameState.savedViewRotation = _s6.SavedViewRotation;
ImportMapAnimations();
ImportRideRatingsCalcData();
ImportRideMeasurements();
gameState.nextGuestNumber = _s6.NextGuestIndex;
@@ -1020,6 +1022,43 @@ namespace OpenRCT2::RCT2
// Pad208[0x58];
}
void ImportMapAnimations()
{
for (const auto& mapAnimation : std::span(_s6.MapAnimations, _s6.NumMapAnimations))
{
switch (mapAnimation.Type)
{
case kRCT12MapAnimationTypeOnRidePhoto:
MapAnimation::CreateTemporary(
{ mapAnimation.x, mapAnimation.y, mapAnimation.BaseZ * kCoordsZStep },
MapAnimation::TemporaryType::onRidePhoto);
break;
case kRCT12MapAnimationTypeWallDoor:
{
const CoordsXYZ coords{ mapAnimation.x, mapAnimation.y, mapAnimation.BaseZ * kCoordsZStep };
const TileCoordsXYZ tileCoords{ coords };
TileElement* tileElement = MapGetFirstElementAt(tileCoords);
if (tileElement == nullptr)
{
continue;
}
do
{
if (tileElement->GetType() != TileElementType::Wall || tileElement->BaseHeight != tileCoords.z)
{
continue;
}
tileElement->AsWall()->SetIsAnimating(true);
MapAnimation::Create(coords);
} while (!(tileElement++)->IsLastForTile());
break;
}
}
}
}
void ImportRideRatingsCalcData()
{
const auto& src = _s6.RideRatingsCalcData;