forked from rosebudai/OpenRCT2-Web
Desnake the rct2/rct12 fields (#19254)
This commit is contained in:
1 parent
07890df9e9
commit
d8417fee30
11 files changed
+1498
-1498
No files matched your search
@@ -102,15 +102,15 @@ static bool TryClassifyAsS6(OpenRCT2::IStream* stream, ClassifiedFileInfo* resul
|
||||
{
|
||||
auto chunkReader = SawyerChunkReader(stream);
|
||||
auto s6Header = chunkReader.ReadChunkAs<RCT2::S6Header>();
|
||||
if (s6Header.type == S6_TYPE_SAVEDGAME)
|
||||
if (s6Header.Type == S6_TYPE_SAVEDGAME)
|
||||
{
|
||||
result->Type = FILE_TYPE::SAVED_GAME;
|
||||
}
|
||||
else if (s6Header.type == S6_TYPE_SCENARIO)
|
||||
else if (s6Header.Type == S6_TYPE_SCENARIO)
|
||||
{
|
||||
result->Type = FILE_TYPE::SCENARIO;
|
||||
}
|
||||
result->Version = s6Header.version;
|
||||
result->Version = s6Header.Version;
|
||||
success = true;
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
|
||||
+10
-10
@@ -471,14 +471,14 @@ namespace RCT1
|
||||
uint8_t Mass; // 0x41
|
||||
uint8_t TimeToConsume;
|
||||
uint8_t Intensity; // 0x43 The max intensity is stored in the first 4 bits, and the min intensity in the second 4 bits
|
||||
uint8_t NauseaTolerance; // 0x44
|
||||
uint8_t WindowInvalidateFlags; // 0x45
|
||||
money16 PaidOnDrink; // 0x46
|
||||
uint8_t ride_types_been_on[16]; // 0x48
|
||||
uint8_t Pad5F[0x10]; // 0x58
|
||||
RCT12RideId CurrentRide; // 0x68
|
||||
uint8_t CurrentRideStation; // 0x69
|
||||
uint8_t CurrentTrain; // 0x6A
|
||||
uint8_t NauseaTolerance; // 0x44
|
||||
uint8_t WindowInvalidateFlags; // 0x45
|
||||
money16 PaidOnDrink; // 0x46
|
||||
uint8_t RideTypesBeenOn[16]; // 0x48
|
||||
uint8_t Pad5F[0x10]; // 0x58
|
||||
RCT12RideId CurrentRide; // 0x68
|
||||
uint8_t CurrentRideStation; // 0x69
|
||||
uint8_t CurrentTrain; // 0x6A
|
||||
union
|
||||
{
|
||||
struct
|
||||
@@ -516,8 +516,8 @@ namespace RCT1
|
||||
uint8_t Direction; // Direction ?
|
||||
};
|
||||
RCT12RideId InteractionRideIndex;
|
||||
uint16_t TimeInQueue; // 0x7A
|
||||
uint8_t rides_been_on[32]; // 0x7C
|
||||
uint16_t TimeInQueue; // 0x7A
|
||||
uint8_t RidesBeenOn[32]; // 0x7C
|
||||
// 255 bit bitmap of every ride the peep has been on see
|
||||
// WindowPeepRidesUpdate for how to use.
|
||||
uint32_t ID; // 0x9C
|
||||
|
||||
@@ -1169,9 +1169,9 @@ namespace RCT1
|
||||
{
|
||||
for (const auto& src : _s4.RideMeasurements)
|
||||
{
|
||||
if (src.ride_index != RCT12_RIDE_ID_NULL)
|
||||
if (src.RideIndex != RCT12_RIDE_ID_NULL)
|
||||
{
|
||||
auto ride = GetRide(RCT12RideIdToOpenRCT2RideId(src.ride_index));
|
||||
auto ride = GetRide(RCT12RideIdToOpenRCT2RideId(src.RideIndex));
|
||||
if (ride != nullptr)
|
||||
{
|
||||
ride->measurement = std::make_unique<RideMeasurement>();
|
||||
@@ -1183,18 +1183,18 @@ namespace RCT1
|
||||
|
||||
void ImportRideMeasurement(RideMeasurement& dst, const RCT12RideMeasurement& src)
|
||||
{
|
||||
dst.flags = src.flags;
|
||||
dst.last_use_tick = src.last_use_tick;
|
||||
dst.num_items = src.num_items;
|
||||
dst.current_item = src.current_item;
|
||||
dst.vehicle_index = src.vehicle_index;
|
||||
dst.current_station = StationIndex::FromUnderlying(src.current_station);
|
||||
for (size_t i = 0; i < std::size(src.velocity); i++)
|
||||
dst.flags = src.Flags;
|
||||
dst.last_use_tick = src.LastUseTick;
|
||||
dst.num_items = src.NumItems;
|
||||
dst.current_item = src.CurrentItem;
|
||||
dst.vehicle_index = src.VehicleIndex;
|
||||
dst.current_station = StationIndex::FromUnderlying(src.CurrentStation);
|
||||
for (size_t i = 0; i < std::size(src.Velocity); i++)
|
||||
{
|
||||
dst.velocity[i] = src.velocity[i] / 2;
|
||||
dst.altitude[i] = src.altitude[i] / 2;
|
||||
dst.vertical[i] = src.vertical[i] / 2;
|
||||
dst.lateral[i] = src.lateral[i] / 2;
|
||||
dst.velocity[i] = src.Velocity[i] / 2;
|
||||
dst.altitude[i] = src.Altitude[i] / 2;
|
||||
dst.vertical[i] = src.Vertical[i] / 2;
|
||||
dst.lateral[i] = src.Lateral[i] / 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1219,11 +1219,11 @@ namespace RCT1
|
||||
// RCT1 had no third colour
|
||||
if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1)
|
||||
{
|
||||
dst->colours.Body = RCT1::GetColour(src->Colours.body_colour);
|
||||
dst->colours.Body = RCT1::GetColour(src->Colours.BodyColour);
|
||||
}
|
||||
else if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_2)
|
||||
{
|
||||
dst->colours.Body = RCT1::GetColour(src->Colours.trim_colour);
|
||||
dst->colours.Body = RCT1::GetColour(src->Colours.TrimColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1232,11 +1232,11 @@ namespace RCT1
|
||||
|
||||
if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_1)
|
||||
{
|
||||
dst->colours.Trim = RCT1::GetColour(src->Colours.body_colour);
|
||||
dst->colours.Trim = RCT1::GetColour(src->Colours.BodyColour);
|
||||
}
|
||||
else if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_2)
|
||||
{
|
||||
dst->colours.Trim = RCT1::GetColour(src->Colours.trim_colour);
|
||||
dst->colours.Trim = RCT1::GetColour(src->Colours.TrimColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1245,11 +1245,11 @@ namespace RCT1
|
||||
|
||||
if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_1)
|
||||
{
|
||||
dst->colours.Tertiary = RCT1::GetColour(src->Colours.body_colour);
|
||||
dst->colours.Tertiary = RCT1::GetColour(src->Colours.BodyColour);
|
||||
}
|
||||
else if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_2)
|
||||
{
|
||||
dst->colours.Tertiary = RCT1::GetColour(src->Colours.trim_colour);
|
||||
dst->colours.Tertiary = RCT1::GetColour(src->Colours.TrimColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2144,9 +2144,9 @@ namespace RCT1
|
||||
auto& awards = GetAwards();
|
||||
for (auto& src : _s4.Awards)
|
||||
{
|
||||
if (src.time != 0)
|
||||
if (src.Time != 0)
|
||||
{
|
||||
awards.push_back(Award{ src.time, static_cast<AwardType>(src.type) });
|
||||
awards.push_back(Award{ src.Time, static_cast<AwardType>(src.Type) });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2389,21 +2389,21 @@ namespace RCT1
|
||||
|
||||
*dst = {};
|
||||
dst->id = id;
|
||||
dst->type = RCTEntryIndexToOpenRCT2EntryIndex(src->type);
|
||||
dst->type = RCTEntryIndexToOpenRCT2EntryIndex(src->Type);
|
||||
|
||||
dst->flags = 0;
|
||||
if (src->flags & BANNER_FLAG_NO_ENTRY)
|
||||
if (src->Flags & BANNER_FLAG_NO_ENTRY)
|
||||
{
|
||||
dst->flags |= BANNER_FLAG_NO_ENTRY;
|
||||
}
|
||||
|
||||
if (IsUserStringID(src->string_idx))
|
||||
if (IsUserStringID(src->StringID))
|
||||
{
|
||||
dst->text = GetUserString(src->string_idx);
|
||||
dst->text = GetUserString(src->StringID);
|
||||
}
|
||||
|
||||
dst->colour = RCT1::GetColour(src->colour);
|
||||
dst->text_colour = src->text_colour;
|
||||
dst->colour = RCT1::GetColour(src->Colour);
|
||||
dst->text_colour = src->TextColour;
|
||||
dst->position.x = src->x;
|
||||
dst->position.y = src->y;
|
||||
}
|
||||
@@ -2662,7 +2662,7 @@ namespace RCT1
|
||||
}
|
||||
case RCT12EntityIdentifier::Misc:
|
||||
|
||||
switch (RCT12MiscEntityType(src.type))
|
||||
switch (RCT12MiscEntityType(src.Type))
|
||||
{
|
||||
case RCT12MiscEntityType::SteamParticle:
|
||||
output = EntityType::SteamParticle;
|
||||
@@ -2720,7 +2720,7 @@ namespace RCT1
|
||||
dst->ride_subtype = RCTEntryIndexToOpenRCT2EntryIndex(ride->subtype);
|
||||
|
||||
dst->vehicle_type = vehicleEntryIndex;
|
||||
dst->SubType = ::Vehicle::Type(src->type);
|
||||
dst->SubType = ::Vehicle::Type(src->Type);
|
||||
dst->var_44 = src->Var44;
|
||||
dst->remaining_distance = src->RemainingDistance;
|
||||
|
||||
@@ -2815,7 +2815,7 @@ namespace RCT1
|
||||
|
||||
dst->num_peeps = src->NumPeeps;
|
||||
dst->next_free_seat = src->NextFreeSeat;
|
||||
dst->IsCrashedVehicle = src->flags & RCT12_ENTITY_FLAGS_IS_CRASHED_VEHICLE_ENTITY;
|
||||
dst->IsCrashedVehicle = src->Flags & RCT12_ENTITY_FLAGS_IS_CRASHED_VEHICLE_ENTITY;
|
||||
}
|
||||
|
||||
template<> void S4Importer::ImportEntity<Guest>(const RCT12EntityBase& srcBase)
|
||||
@@ -2879,13 +2879,13 @@ namespace RCT1
|
||||
{
|
||||
auto srcThought = &src->Thoughts[i];
|
||||
auto dstThought = &dst->Thoughts[i];
|
||||
dstThought->type = static_cast<PeepThoughtType>(srcThought->type);
|
||||
if (srcThought->item == RCT12PeepThoughtItemNone)
|
||||
dstThought->type = static_cast<PeepThoughtType>(srcThought->Type);
|
||||
if (srcThought->Item == RCT12PeepThoughtItemNone)
|
||||
dstThought->item = PeepThoughtItemNone;
|
||||
else
|
||||
dstThought->item = srcThought->item;
|
||||
dstThought->freshness = srcThought->freshness;
|
||||
dstThought->fresh_timeout = srcThought->fresh_timeout;
|
||||
dstThought->item = srcThought->Item;
|
||||
dstThought->freshness = srcThought->Freshness;
|
||||
dstThought->fresh_timeout = srcThought->FreshTimeout;
|
||||
}
|
||||
|
||||
dst->PreviousRide = RCT12RideIdToOpenRCT2RideId(src->PreviousRide);
|
||||
@@ -2942,7 +2942,7 @@ namespace RCT1
|
||||
auto* src = static_cast<const RCT12EntityLitter*>(&srcBase);
|
||||
ImportEntityCommonProperties(dst, src);
|
||||
|
||||
dst->SubType = Litter::Type(src->type);
|
||||
dst->SubType = Litter::Type(src->Type);
|
||||
}
|
||||
|
||||
template<> void S4Importer::ImportEntity<SteamParticle>(const RCT12EntityBase& srcBase)
|
||||
@@ -2951,7 +2951,7 @@ namespace RCT1
|
||||
auto* src = static_cast<const RCT12EntitySteamParticle*>(&srcBase);
|
||||
|
||||
ImportEntityCommonProperties(dst, src);
|
||||
dst->frame = src->frame;
|
||||
dst->frame = src->Frame;
|
||||
}
|
||||
|
||||
template<> void S4Importer::ImportEntity<MoneyEffect>(const RCT12EntityBase& srcBase)
|
||||
@@ -2960,11 +2960,11 @@ namespace RCT1
|
||||
auto* src = static_cast<const RCT12EntityMoneyEffect*>(&srcBase);
|
||||
|
||||
ImportEntityCommonProperties(dst, src);
|
||||
dst->MoveDelay = src->move_delay;
|
||||
dst->NumMovements = src->num_movements;
|
||||
dst->Value = src->value;
|
||||
dst->OffsetX = src->offset_x;
|
||||
dst->Wiggle = src->wiggle;
|
||||
dst->MoveDelay = src->MoveDelay;
|
||||
dst->NumMovements = src->NumMovements;
|
||||
dst->Value = src->Value;
|
||||
dst->OffsetX = src->OffsetX;
|
||||
dst->Wiggle = src->Wiggle;
|
||||
}
|
||||
|
||||
template<> void S4Importer::ImportEntity<VehicleCrashParticle>(const RCT12EntityBase& srcBase)
|
||||
@@ -3001,10 +3001,10 @@ namespace RCT1
|
||||
auto* src = static_cast<const RCT12EntityJumpingFountain*>(&srcBase);
|
||||
|
||||
ImportEntityCommonProperties(dst, src);
|
||||
dst->FountainFlags = src->fountain_flags;
|
||||
dst->Iteration = src->iteration;
|
||||
dst->NumTicksAlive = src->num_ticks_alive;
|
||||
dst->frame = src->frame;
|
||||
dst->FountainFlags = src->FountainFlags;
|
||||
dst->Iteration = src->Iteration;
|
||||
dst->NumTicksAlive = src->NumTicksAlive;
|
||||
dst->frame = src->Frame;
|
||||
dst->FountainType = JumpingFountainType::Water;
|
||||
}
|
||||
|
||||
@@ -3021,7 +3021,7 @@ namespace RCT1
|
||||
}
|
||||
else
|
||||
{
|
||||
dst->colour = RCT1::GetColour(src->colour);
|
||||
dst->colour = RCT1::GetColour(src->Colour);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3031,8 +3031,8 @@ namespace RCT1
|
||||
auto* src = static_cast<const RCT12EntityDuck*>(&srcBase);
|
||||
|
||||
ImportEntityCommonProperties(dst, src);
|
||||
dst->frame = src->frame;
|
||||
dst->state = static_cast<Duck::DuckState>(src->state);
|
||||
dst->frame = src->Frame;
|
||||
dst->state = static_cast<Duck::DuckState>(src->State);
|
||||
}
|
||||
|
||||
void S4Importer::ImportEntity(const RCT12EntityBase& src)
|
||||
|
||||
@@ -161,11 +161,11 @@ namespace RCT1
|
||||
td4Base.VehicleType);
|
||||
if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1)
|
||||
{
|
||||
td->vehicle_colours[i].Body = RCT1::GetColour(td4Base.VehicleColours[i].body_colour);
|
||||
td->vehicle_colours[i].Body = RCT1::GetColour(td4Base.VehicleColours[i].BodyColour);
|
||||
}
|
||||
else if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_2)
|
||||
{
|
||||
td->vehicle_colours[i].Body = RCT1::GetColour(td4Base.VehicleColours[i].trim_colour);
|
||||
td->vehicle_colours[i].Body = RCT1::GetColour(td4Base.VehicleColours[i].TrimColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -174,11 +174,11 @@ namespace RCT1
|
||||
|
||||
if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_1)
|
||||
{
|
||||
td->vehicle_colours[i].Trim = RCT1::GetColour(td4Base.VehicleColours[i].body_colour);
|
||||
td->vehicle_colours[i].Trim = RCT1::GetColour(td4Base.VehicleColours[i].BodyColour);
|
||||
}
|
||||
else if (colourSchemeCopyDescriptor.colour2 == COPY_COLOUR_2)
|
||||
{
|
||||
td->vehicle_colours[i].Trim = RCT1::GetColour(td4Base.VehicleColours[i].trim_colour);
|
||||
td->vehicle_colours[i].Trim = RCT1::GetColour(td4Base.VehicleColours[i].TrimColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -187,11 +187,11 @@ namespace RCT1
|
||||
|
||||
if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_1)
|
||||
{
|
||||
td->vehicle_colours[i].Tertiary = RCT1::GetColour(td4Base.VehicleColours[i].body_colour);
|
||||
td->vehicle_colours[i].Tertiary = RCT1::GetColour(td4Base.VehicleColours[i].BodyColour);
|
||||
}
|
||||
else if (colourSchemeCopyDescriptor.colour3 == COPY_COLOUR_2)
|
||||
{
|
||||
td->vehicle_colours[i].Tertiary = RCT1::GetColour(td4Base.VehicleColours[i].trim_colour);
|
||||
td->vehicle_colours[i].Tertiary = RCT1::GetColour(td4Base.VehicleColours[i].TrimColour);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -243,17 +243,17 @@ namespace RCT1
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
{
|
||||
TD46MazeElement t4MazeElement{};
|
||||
t4MazeElement.all = !0;
|
||||
while (t4MazeElement.all != 0)
|
||||
t4MazeElement.All = !0;
|
||||
while (t4MazeElement.All != 0)
|
||||
{
|
||||
_stream.Read(&t4MazeElement, sizeof(TD46MazeElement));
|
||||
if (t4MazeElement.all != 0)
|
||||
if (t4MazeElement.All != 0)
|
||||
{
|
||||
TrackDesignMazeElement mazeElement{};
|
||||
mazeElement.x = t4MazeElement.x;
|
||||
mazeElement.y = t4MazeElement.y;
|
||||
mazeElement.direction = t4MazeElement.direction;
|
||||
mazeElement.type = t4MazeElement.type;
|
||||
mazeElement.direction = t4MazeElement.Direction;
|
||||
mazeElement.type = t4MazeElement.Type;
|
||||
td->maze_elements.push_back(mazeElement);
|
||||
}
|
||||
}
|
||||
@@ -266,8 +266,8 @@ namespace RCT1
|
||||
_stream.SetPosition(_stream.GetPosition() - 1);
|
||||
_stream.Read(&t4TrackElement, sizeof(TD46TrackElement));
|
||||
TrackDesignTrackElement trackElement{};
|
||||
trackElement.type = RCT1TrackTypeToOpenRCT2(t4TrackElement.type, td->type);
|
||||
trackElement.flags = t4TrackElement.flags;
|
||||
trackElement.type = RCT1TrackTypeToOpenRCT2(t4TrackElement.Type, td->type);
|
||||
trackElement.flags = t4TrackElement.Flags;
|
||||
td->track_elements.push_back(trackElement);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,42 +73,42 @@ bool RCT12TileElementBase::IsGhost() const
|
||||
|
||||
uint8_t RCT12SurfaceElement::GetSlope() const
|
||||
{
|
||||
return (slope & TILE_ELEMENT_SURFACE_SLOPE_MASK);
|
||||
return (Slope & TILE_ELEMENT_SURFACE_SLOPE_MASK);
|
||||
}
|
||||
|
||||
uint32_t RCT12SurfaceElement::GetSurfaceStyle() const
|
||||
{
|
||||
uint32_t retVal = (terrain >> 5) & 7;
|
||||
uint32_t retVal = (Terrain >> 5) & 7;
|
||||
retVal |= (Type & RCT12_SURFACE_ELEMENT_TYPE_SURFACE_MASK) << 3;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
uint32_t RCT12SurfaceElement::GetEdgeStyle() const
|
||||
{
|
||||
uint32_t terrain_edge = (slope >> 5) & 7;
|
||||
uint32_t terrainEdge = (Slope >> 5) & 7;
|
||||
if (Type & 128)
|
||||
terrain_edge |= (1 << 3);
|
||||
return terrain_edge;
|
||||
terrainEdge |= (1 << 3);
|
||||
return terrainEdge;
|
||||
}
|
||||
|
||||
uint8_t RCT12SurfaceElement::GetGrassLength() const
|
||||
{
|
||||
return grass_length;
|
||||
return GrassLength;
|
||||
}
|
||||
|
||||
uint8_t RCT12SurfaceElement::GetOwnership() const
|
||||
{
|
||||
return (ownership & TILE_ELEMENT_SURFACE_OWNERSHIP_MASK);
|
||||
return (Ownership & TILE_ELEMENT_SURFACE_OWNERSHIP_MASK);
|
||||
}
|
||||
|
||||
uint32_t RCT12SurfaceElement::GetWaterHeight() const
|
||||
{
|
||||
return (terrain & RCT12_TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK) * WATER_HEIGHT_STEP;
|
||||
return (Terrain & RCT12_TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK) * WATER_HEIGHT_STEP;
|
||||
}
|
||||
|
||||
uint8_t RCT12SurfaceElement::GetParkFences() const
|
||||
{
|
||||
return (ownership & TILE_ELEMENT_SURFACE_PARK_FENCE_MASK);
|
||||
return (Ownership & TILE_ELEMENT_SURFACE_PARK_FENCE_MASK);
|
||||
}
|
||||
|
||||
bool RCT12SurfaceElement::HasTrackThatNeedsWater() const
|
||||
@@ -118,7 +118,7 @@ bool RCT12SurfaceElement::HasTrackThatNeedsWater() const
|
||||
|
||||
uint8_t RCT12PathElement::GetEntryIndex() const
|
||||
{
|
||||
return (entryIndex & RCT12_FOOTPATH_PROPERTIES_TYPE_MASK) >> 4;
|
||||
return (EntryIndex & RCT12_FOOTPATH_PROPERTIES_TYPE_MASK) >> 4;
|
||||
}
|
||||
|
||||
uint8_t RCT12PathElement::GetQueueBannerDirection() const
|
||||
@@ -128,22 +128,22 @@ uint8_t RCT12PathElement::GetQueueBannerDirection() const
|
||||
|
||||
bool RCT12PathElement::IsSloped() const
|
||||
{
|
||||
return (entryIndex & RCT12_FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) != 0;
|
||||
return (EntryIndex & RCT12_FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) != 0;
|
||||
}
|
||||
|
||||
uint8_t RCT12PathElement::GetSlopeDirection() const
|
||||
{
|
||||
return entryIndex & RCT12_FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK;
|
||||
return EntryIndex & RCT12_FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK;
|
||||
}
|
||||
|
||||
uint8_t RCT12PathElement::GetRideIndex() const
|
||||
{
|
||||
return rideIndex;
|
||||
return RideIndex;
|
||||
}
|
||||
|
||||
uint8_t RCT12PathElement::GetStationIndex() const
|
||||
{
|
||||
return (additions & RCT12_FOOTPATH_PROPERTIES_ADDITIONS_STATION_INDEX_MASK) >> 4;
|
||||
return (Additions & RCT12_FOOTPATH_PROPERTIES_ADDITIONS_STATION_INDEX_MASK) >> 4;
|
||||
}
|
||||
|
||||
bool RCT12PathElement::IsWide() const
|
||||
@@ -158,37 +158,37 @@ bool RCT12PathElement::IsQueue() const
|
||||
|
||||
bool RCT12PathElement::HasQueueBanner() const
|
||||
{
|
||||
return (entryIndex & RCT12_FOOTPATH_PROPERTIES_FLAG_HAS_QUEUE_BANNER) != 0;
|
||||
return (EntryIndex & RCT12_FOOTPATH_PROPERTIES_FLAG_HAS_QUEUE_BANNER) != 0;
|
||||
}
|
||||
uint8_t RCT12PathElement::GetEdges() const
|
||||
{
|
||||
return edges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
|
||||
return Edges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
|
||||
}
|
||||
|
||||
uint8_t RCT12PathElement::GetCorners() const
|
||||
{
|
||||
return edges >> 4;
|
||||
return Edges >> 4;
|
||||
}
|
||||
|
||||
uint8_t RCT12PathElement::GetAddition() const
|
||||
{
|
||||
return additions & RCT12_FOOTPATH_PROPERTIES_ADDITIONS_TYPE_MASK;
|
||||
return Additions & RCT12_FOOTPATH_PROPERTIES_ADDITIONS_TYPE_MASK;
|
||||
}
|
||||
|
||||
bool RCT12PathElement::AdditionIsGhost() const
|
||||
{
|
||||
return (additions & RCT12_FOOTPATH_PROPERTIES_ADDITIONS_FLAG_GHOST) != 0;
|
||||
return (Additions & RCT12_FOOTPATH_PROPERTIES_ADDITIONS_FLAG_GHOST) != 0;
|
||||
}
|
||||
|
||||
uint8_t RCT12PathElement::GetAdditionStatus() const
|
||||
{
|
||||
return additionStatus;
|
||||
return AdditionStatus;
|
||||
}
|
||||
|
||||
uint8_t RCT12PathElement::GetRCT1PathType() const
|
||||
{
|
||||
uint8_t pathColour = Type & 3;
|
||||
uint8_t pathType2 = (entryIndex & RCT12_FOOTPATH_PROPERTIES_TYPE_MASK) >> 2;
|
||||
uint8_t pathType2 = (EntryIndex & RCT12_FOOTPATH_PROPERTIES_TYPE_MASK) >> 2;
|
||||
|
||||
pathType2 = pathType2 | pathColour;
|
||||
return pathType2;
|
||||
@@ -201,29 +201,29 @@ uint8_t RCT12PathElement::GetRCT1SupportType() const
|
||||
|
||||
uint8_t RCT12TrackElement::GetTrackType() const
|
||||
{
|
||||
return trackType;
|
||||
return TrackType;
|
||||
}
|
||||
|
||||
uint8_t RCT12TrackElement::GetSequenceIndex() const
|
||||
{
|
||||
return sequence & RCT12_TRACK_ELEMENT_SEQUENCE_SEQUENCE_MASK;
|
||||
return Sequence & RCT12_TRACK_ELEMENT_SEQUENCE_SEQUENCE_MASK;
|
||||
}
|
||||
|
||||
uint8_t RCT12TrackElement::GetRideIndex() const
|
||||
{
|
||||
return rideIndex;
|
||||
return RideIndex;
|
||||
}
|
||||
|
||||
uint8_t RCT12TrackElement::GetColourScheme() const
|
||||
{
|
||||
return colour & 0x3;
|
||||
return Colour & 0x3;
|
||||
}
|
||||
|
||||
uint8_t RCT12TrackElement::GetStationIndex() const
|
||||
{
|
||||
if (TrackTypeIsStation(trackType) || trackType == TrackElemType::TowerBase)
|
||||
if (TrackTypeIsStation(TrackType) || TrackType == TrackElemType::TowerBase)
|
||||
{
|
||||
return (sequence & RCT12_TRACK_ELEMENT_SEQUENCE_STATION_INDEX_MASK) >> 4;
|
||||
return (Sequence & RCT12_TRACK_ELEMENT_SEQUENCE_STATION_INDEX_MASK) >> 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -235,59 +235,59 @@ bool RCT12TrackElement::HasChain() const
|
||||
|
||||
bool RCT12TrackElement::HasCableLift() const
|
||||
{
|
||||
return colour & RCT12_TRACK_ELEMENT_COLOUR_FLAG_CABLE_LIFT;
|
||||
return Colour & RCT12_TRACK_ELEMENT_COLOUR_FLAG_CABLE_LIFT;
|
||||
}
|
||||
|
||||
bool RCT12TrackElement::IsInverted() const
|
||||
{
|
||||
return colour & RCT12_TRACK_ELEMENT_COLOUR_FLAG_INVERTED;
|
||||
return Colour & RCT12_TRACK_ELEMENT_COLOUR_FLAG_INVERTED;
|
||||
}
|
||||
|
||||
uint8_t RCT12TrackElement::GetBrakeBoosterSpeed() const
|
||||
{
|
||||
if (TrackTypeHasSpeedSetting(GetTrackType()))
|
||||
{
|
||||
return (sequence >> 4) << 1;
|
||||
return (Sequence >> 4) << 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool RCT12TrackElement::HasGreenLight() const
|
||||
{
|
||||
if (TrackTypeIsStation(trackType))
|
||||
if (TrackTypeIsStation(TrackType))
|
||||
{
|
||||
return (sequence & MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT) != 0;
|
||||
return (Sequence & MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT) != 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8_t RCT12TrackElement::GetSeatRotation() const
|
||||
{
|
||||
return colour >> 4;
|
||||
return Colour >> 4;
|
||||
}
|
||||
|
||||
uint16_t RCT12TrackElement::GetMazeEntry() const
|
||||
{
|
||||
return mazeEntry;
|
||||
return MazeEntry;
|
||||
}
|
||||
|
||||
uint8_t RCT12TrackElement::GetPhotoTimeout() const
|
||||
{
|
||||
if (GetTrackType() == TrackElemType::OnRidePhoto)
|
||||
{
|
||||
return sequence >> 4;
|
||||
return Sequence >> 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t RCT12TrackElement::GetDoorAState() const
|
||||
{
|
||||
return (colour & RCT12_TRACK_ELEMENT_DOOR_A_MASK) >> 2;
|
||||
return (Colour & RCT12_TRACK_ELEMENT_DOOR_A_MASK) >> 2;
|
||||
}
|
||||
|
||||
uint8_t RCT12TrackElement::GetDoorBState() const
|
||||
{
|
||||
return (colour & RCT12_TRACK_ELEMENT_DOOR_B_MASK) >> 5;
|
||||
return (Colour & RCT12_TRACK_ELEMENT_DOOR_B_MASK) >> 5;
|
||||
}
|
||||
|
||||
bool RCT12TrackElement::IsIndestructible() const
|
||||
@@ -297,12 +297,12 @@ bool RCT12TrackElement::IsIndestructible() const
|
||||
|
||||
uint8_t RCT12SmallSceneryElement::GetEntryIndex() const
|
||||
{
|
||||
return this->entryIndex;
|
||||
return this->EntryIndex;
|
||||
}
|
||||
|
||||
uint8_t RCT12SmallSceneryElement::GetAge() const
|
||||
{
|
||||
return this->age;
|
||||
return this->Age;
|
||||
}
|
||||
|
||||
uint8_t RCT12SmallSceneryElement::GetSceneryQuadrant() const
|
||||
@@ -312,46 +312,46 @@ uint8_t RCT12SmallSceneryElement::GetSceneryQuadrant() const
|
||||
|
||||
colour_t RCT12SmallSceneryElement::GetPrimaryColour() const
|
||||
{
|
||||
return colour_1 & TILE_ELEMENT_COLOUR_MASK;
|
||||
return Colour1 & TILE_ELEMENT_COLOUR_MASK;
|
||||
}
|
||||
|
||||
colour_t RCT12SmallSceneryElement::GetSecondaryColour() const
|
||||
{
|
||||
return colour_2 & TILE_ELEMENT_COLOUR_MASK;
|
||||
return Colour2 & TILE_ELEMENT_COLOUR_MASK;
|
||||
}
|
||||
|
||||
bool RCT12SmallSceneryElement::NeedsSupports() const
|
||||
{
|
||||
return colour_1 & MAP_ELEM_SMALL_SCENERY_COLOUR_FLAG_NEEDS_SUPPORTS;
|
||||
return Colour1 & MAP_ELEM_SMALL_SCENERY_COLOUR_FLAG_NEEDS_SUPPORTS;
|
||||
}
|
||||
|
||||
uint32_t RCT12LargeSceneryElement::GetEntryIndex() const
|
||||
{
|
||||
return entryIndex & RCT12_TILE_ELEMENT_LARGE_TYPE_MASK;
|
||||
return EntryIndex & RCT12_TILE_ELEMENT_LARGE_TYPE_MASK;
|
||||
}
|
||||
|
||||
uint16_t RCT12LargeSceneryElement::GetSequenceIndex() const
|
||||
{
|
||||
return (entryIndex >> 10);
|
||||
return (EntryIndex >> 10);
|
||||
}
|
||||
colour_t RCT12LargeSceneryElement::GetPrimaryColour() const
|
||||
{
|
||||
return colour[0] & TILE_ELEMENT_COLOUR_MASK;
|
||||
return Colour[0] & TILE_ELEMENT_COLOUR_MASK;
|
||||
}
|
||||
|
||||
colour_t RCT12LargeSceneryElement::GetSecondaryColour() const
|
||||
{
|
||||
return colour[1] & TILE_ELEMENT_COLOUR_MASK;
|
||||
return Colour[1] & TILE_ELEMENT_COLOUR_MASK;
|
||||
}
|
||||
|
||||
uint8_t RCT12LargeSceneryElement::GetBannerIndex() const
|
||||
{
|
||||
return (Type & 0xC0) | (((colour[0]) & ~TILE_ELEMENT_COLOUR_MASK) >> 2) | (((colour[1]) & ~TILE_ELEMENT_COLOUR_MASK) >> 5);
|
||||
return (Type & 0xC0) | (((Colour[0]) & ~TILE_ELEMENT_COLOUR_MASK) >> 2) | (((Colour[1]) & ~TILE_ELEMENT_COLOUR_MASK) >> 5);
|
||||
}
|
||||
|
||||
uint8_t RCT12WallElement::GetEntryIndex() const
|
||||
{
|
||||
return entryIndex;
|
||||
return EntryIndex;
|
||||
}
|
||||
|
||||
uint8_t RCT12WallElement::GetSlope() const
|
||||
@@ -361,45 +361,45 @@ uint8_t RCT12WallElement::GetSlope() const
|
||||
|
||||
colour_t RCT12WallElement::GetPrimaryColour() const
|
||||
{
|
||||
return colour_1 & TILE_ELEMENT_COLOUR_MASK;
|
||||
return Colour1 & TILE_ELEMENT_COLOUR_MASK;
|
||||
}
|
||||
|
||||
colour_t RCT12WallElement::GetSecondaryColour() const
|
||||
{
|
||||
uint8_t secondaryColour = (colour_1 & ~TILE_ELEMENT_COLOUR_MASK) >> 5;
|
||||
uint8_t secondaryColour = (Colour1 & ~TILE_ELEMENT_COLOUR_MASK) >> 5;
|
||||
secondaryColour |= (Flags & 0x60) >> 2;
|
||||
return secondaryColour;
|
||||
}
|
||||
|
||||
colour_t RCT12WallElement::GetTertiaryColour() const
|
||||
{
|
||||
return colour_3 & TILE_ELEMENT_COLOUR_MASK;
|
||||
return Colour3 & TILE_ELEMENT_COLOUR_MASK;
|
||||
}
|
||||
|
||||
uint8_t RCT12WallElement::GetAnimationFrame() const
|
||||
{
|
||||
return (animation >> 3) & 0xF;
|
||||
return (Animation >> 3) & 0xF;
|
||||
}
|
||||
|
||||
uint8_t RCT12WallElement::GetBannerIndex() const
|
||||
{
|
||||
return banner_index;
|
||||
return BannerIndex;
|
||||
}
|
||||
|
||||
bool RCT12WallElement::IsAcrossTrack() const
|
||||
{
|
||||
return (animation & WALL_ANIMATION_FLAG_ACROSS_TRACK) != 0;
|
||||
return (Animation & WALL_ANIMATION_FLAG_ACROSS_TRACK) != 0;
|
||||
}
|
||||
|
||||
bool RCT12WallElement::AnimationIsBackwards() const
|
||||
{
|
||||
return (animation & WALL_ANIMATION_FLAG_DIRECTION_BACKWARD) != 0;
|
||||
return (Animation & WALL_ANIMATION_FLAG_DIRECTION_BACKWARD) != 0;
|
||||
}
|
||||
|
||||
int32_t RCT12WallElement::GetRCT1WallType(int32_t edge) const
|
||||
{
|
||||
uint8_t var_05 = colour_3;
|
||||
uint16_t var_06 = colour_1 | (animation << 8);
|
||||
uint8_t var_05 = Colour3;
|
||||
uint16_t var_06 = Colour1 | (Animation << 8);
|
||||
|
||||
int32_t typeA = (var_05 >> (edge * 2)) & 3;
|
||||
int32_t typeB = (var_06 >> (edge * 4)) & 0x0F;
|
||||
@@ -414,47 +414,47 @@ int32_t RCT12WallElement::GetRCT1WallType(int32_t edge) const
|
||||
|
||||
colour_t RCT12WallElement::GetRCT1WallColour() const
|
||||
{
|
||||
return ((Type & 0xC0) >> 3) | ((entryIndex & 0xE0) >> 5);
|
||||
return ((Type & 0xC0) >> 3) | ((EntryIndex & 0xE0) >> 5);
|
||||
}
|
||||
|
||||
uint8_t RCT12WallElement::GetRCT1Slope() const
|
||||
{
|
||||
return entryIndex & 0b00011111;
|
||||
return EntryIndex & 0b00011111;
|
||||
}
|
||||
|
||||
uint8_t RCT12EntranceElement::GetEntranceType() const
|
||||
{
|
||||
return entranceType;
|
||||
return EntranceType;
|
||||
}
|
||||
|
||||
uint8_t RCT12EntranceElement::GetRideIndex() const
|
||||
{
|
||||
return rideIndex;
|
||||
return RideIndex;
|
||||
}
|
||||
|
||||
uint8_t RCT12EntranceElement::GetStationIndex() const
|
||||
{
|
||||
return (index & RCT12_TRACK_ELEMENT_SEQUENCE_STATION_INDEX_MASK) >> 4;
|
||||
return (Index & RCT12_TRACK_ELEMENT_SEQUENCE_STATION_INDEX_MASK) >> 4;
|
||||
}
|
||||
|
||||
uint8_t RCT12EntranceElement::GetSequenceIndex() const
|
||||
{
|
||||
return index & 0xF;
|
||||
return Index & 0xF;
|
||||
}
|
||||
|
||||
uint8_t RCT12EntranceElement::GetPathType() const
|
||||
{
|
||||
return pathType;
|
||||
return PathType;
|
||||
}
|
||||
|
||||
uint8_t RCT12BannerElement::GetIndex() const
|
||||
{
|
||||
return index;
|
||||
return Index;
|
||||
}
|
||||
|
||||
uint8_t RCT12BannerElement::GetPosition() const
|
||||
{
|
||||
return position;
|
||||
return Position;
|
||||
}
|
||||
|
||||
uint8_t RCT12BannerElement::GetAllowedEdges() const
|
||||
@@ -484,17 +484,17 @@ bool RCT12TrackElement::BlockBrakeClosed() const
|
||||
|
||||
bool RCT12ResearchItem::IsInventedEndMarker() const
|
||||
{
|
||||
return rawValue == RCT12_RESEARCHED_ITEMS_SEPARATOR;
|
||||
return RawValue == RCT12_RESEARCHED_ITEMS_SEPARATOR;
|
||||
}
|
||||
|
||||
bool RCT12ResearchItem::IsUninventedEndMarker() const
|
||||
{
|
||||
return rawValue == RCT12_RESEARCHED_ITEMS_END;
|
||||
return RawValue == RCT12_RESEARCHED_ITEMS_END;
|
||||
}
|
||||
|
||||
bool RCT12ResearchItem::IsRandomEndMarker() const
|
||||
{
|
||||
return rawValue == RCT12_RESEARCHED_ITEMS_END_2;
|
||||
return RawValue == RCT12_RESEARCHED_ITEMS_END_2;
|
||||
}
|
||||
|
||||
ObjectEntryIndex RCTEntryIndexToOpenRCT2EntryIndex(const RCT12ObjectEntryIndex index)
|
||||
@@ -841,15 +841,15 @@ ResearchItem RCT12ResearchItem::ToResearchItem() const
|
||||
}
|
||||
else
|
||||
{
|
||||
newResearchItem.type = Research::EntryType{ type };
|
||||
newResearchItem.entryIndex = RCTEntryIndexToOpenRCT2EntryIndex(entryIndex);
|
||||
newResearchItem.flags = flags;
|
||||
newResearchItem.category = static_cast<ResearchCategory>(category);
|
||||
newResearchItem.type = Research::EntryType{ Type };
|
||||
newResearchItem.entryIndex = RCTEntryIndexToOpenRCT2EntryIndex(EntryIndex);
|
||||
newResearchItem.flags = Flags;
|
||||
newResearchItem.category = static_cast<ResearchCategory>(Category);
|
||||
if (newResearchItem.type == Research::EntryType::Ride)
|
||||
{
|
||||
auto* rideEntry = GetRideEntryByIndex(newResearchItem.entryIndex);
|
||||
newResearchItem.baseRideType = rideEntry != nullptr ? RCT2::RCT2RideTypeToOpenRCT2RideType(baseRideType, *rideEntry)
|
||||
: baseRideType;
|
||||
newResearchItem.baseRideType = rideEntry != nullptr ? RCT2::RCT2RideTypeToOpenRCT2RideType(BaseRideType, *rideEntry)
|
||||
: BaseRideType;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+134
-134
@@ -123,7 +123,7 @@ enum
|
||||
RCT12_TRACK_ELEMENT_DOOR_B_MASK = 0b11100000,
|
||||
};
|
||||
|
||||
// Masks and flags for values stored in TileElement.properties.path.type
|
||||
// Masks and Flags for values stored in TileElement.properties.path.type
|
||||
enum
|
||||
{
|
||||
RCT12_FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK = (1 << 0) | (1 << 1),
|
||||
@@ -132,7 +132,7 @@ enum
|
||||
RCT12_FOOTPATH_PROPERTIES_TYPE_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7),
|
||||
};
|
||||
|
||||
// Masks and flags for values stored in RCT12TileElement.properties.path.additions
|
||||
// Masks and Flags for values stored in RCT12TileElement.properties.path.additions
|
||||
enum
|
||||
{
|
||||
RCT12_FOOTPATH_PROPERTIES_ADDITIONS_TYPE_MASK = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
|
||||
@@ -194,18 +194,18 @@ struct TD46MazeElement
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32_t all;
|
||||
uint32_t All;
|
||||
struct
|
||||
{
|
||||
int8_t x;
|
||||
int8_t y;
|
||||
union
|
||||
{
|
||||
uint16_t maze_entry;
|
||||
uint16_t MazeEntry;
|
||||
struct
|
||||
{
|
||||
uint8_t direction;
|
||||
uint8_t type;
|
||||
uint8_t Direction;
|
||||
uint8_t Type;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -216,15 +216,15 @@ assert_struct_size(TD46MazeElement, 0x04);
|
||||
/* Track Element entry size: 0x02 */
|
||||
struct TD46TrackElement
|
||||
{
|
||||
uint8_t type; // 0x00
|
||||
uint8_t flags; // 0x01
|
||||
uint8_t Type; // 0x00
|
||||
uint8_t Flags; // 0x01
|
||||
};
|
||||
assert_struct_size(TD46TrackElement, 0x02);
|
||||
|
||||
struct RCT12Award
|
||||
{
|
||||
uint16_t time;
|
||||
uint16_t type;
|
||||
uint16_t Time;
|
||||
uint16_t Type;
|
||||
};
|
||||
assert_struct_size(RCT12Award, 4);
|
||||
|
||||
@@ -311,7 +311,7 @@ struct RCT12EightCarsCorruptElement15;
|
||||
struct RCT12TileElementBase
|
||||
{
|
||||
uint8_t Type; // 0
|
||||
uint8_t Flags; // 1. Upper nibble: flags. Lower nibble: occupied quadrants (one bit per quadrant).
|
||||
uint8_t Flags; // 1. Upper nibble: Flags. Lower nibble: occupied quadrants (one bit per quadrant).
|
||||
uint8_t BaseHeight; // 2
|
||||
uint8_t ClearanceHeight; // 3
|
||||
RCT12TileElementType GetType() const;
|
||||
@@ -407,10 +407,10 @@ assert_struct_size(RCT12TileElement, 8);
|
||||
struct RCT12SurfaceElement : RCT12TileElementBase
|
||||
{
|
||||
private:
|
||||
uint8_t slope; // 4 0xE0 Edge Style, 0x1F Slope
|
||||
uint8_t terrain; // 5 0xE0 Terrain Style, 0x1F Water height
|
||||
uint8_t grass_length; // 6
|
||||
uint8_t ownership; // 7
|
||||
uint8_t Slope; // 4 0xE0 Edge Style, 0x1F Slope
|
||||
uint8_t Terrain; // 5 0xE0 Terrain Style, 0x1F Water height
|
||||
uint8_t GrassLength; // 6
|
||||
uint8_t Ownership; // 7
|
||||
public:
|
||||
uint8_t GetSlope() const;
|
||||
uint32_t GetSurfaceStyle() const;
|
||||
@@ -425,13 +425,13 @@ assert_struct_size(RCT12SurfaceElement, 8);
|
||||
struct RCT12PathElement : RCT12TileElementBase
|
||||
{
|
||||
private:
|
||||
uint8_t entryIndex; // 4, 0xF0 Path type, 0x08 Ride sign, 0x04 Set when path is sloped, 0x03 Rotation
|
||||
uint8_t additions; // 5, 0bGSSSAAAA: G = Ghost, S = station index, A = addition (0 means no addition)
|
||||
uint8_t edges; // 6
|
||||
uint8_t EntryIndex; // 4, 0xF0 Path type, 0x08 Ride sign, 0x04 Set when path is sloped, 0x03 Rotation
|
||||
uint8_t Additions; // 5, 0bGSSSAAAA: G = Ghost, S = station index, A = addition (0 means no addition)
|
||||
uint8_t Edges; // 6
|
||||
union
|
||||
{
|
||||
uint8_t additionStatus; // 7
|
||||
uint8_t rideIndex;
|
||||
uint8_t AdditionStatus; // 7
|
||||
uint8_t RideIndex;
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -460,7 +460,7 @@ assert_struct_size(RCT12PathElement, 8);
|
||||
struct RCT12TrackElement : RCT12TileElementBase
|
||||
{
|
||||
private:
|
||||
uint8_t trackType; // 4
|
||||
uint8_t TrackType; // 4
|
||||
union
|
||||
{
|
||||
struct
|
||||
@@ -476,12 +476,12 @@ private:
|
||||
// - Bits 7 and 8 are never set
|
||||
// - Bits 5 and 6 are set when a vehicle triggers the on-ride photo and act like a countdown from 3.
|
||||
// - If any of the bits 5-8 are set, the game counts it as a photo being taken.
|
||||
uint8_t sequence; // 5.
|
||||
uint8_t colour; // 6
|
||||
uint8_t Sequence; // 5.
|
||||
uint8_t Colour; // 6
|
||||
};
|
||||
uint16_t mazeEntry; // 5
|
||||
uint16_t MazeEntry; // 5
|
||||
};
|
||||
uint8_t rideIndex; // 7
|
||||
uint8_t RideIndex; // 7
|
||||
public:
|
||||
uint8_t GetTrackType() const;
|
||||
uint8_t GetSequenceIndex() const;
|
||||
@@ -507,10 +507,10 @@ assert_struct_size(RCT12TrackElement, 8);
|
||||
struct RCT12SmallSceneryElement : RCT12TileElementBase
|
||||
{
|
||||
private:
|
||||
uint8_t entryIndex; // 4
|
||||
uint8_t age; // 5
|
||||
uint8_t colour_1; // 6
|
||||
uint8_t colour_2; // 7
|
||||
uint8_t EntryIndex; // 4
|
||||
uint8_t Age; // 5
|
||||
uint8_t Colour1; // 6
|
||||
uint8_t Colour2; // 7
|
||||
public:
|
||||
RCT12ObjectEntryIndex GetEntryIndex() const;
|
||||
uint8_t GetAge() const;
|
||||
@@ -523,8 +523,8 @@ assert_struct_size(RCT12SmallSceneryElement, 8);
|
||||
struct RCT12LargeSceneryElement : RCT12TileElementBase
|
||||
{
|
||||
private:
|
||||
uint16_t entryIndex; // 4
|
||||
uint8_t colour[2]; // 6
|
||||
uint16_t EntryIndex; // 4
|
||||
uint8_t Colour[2]; // 6
|
||||
public:
|
||||
uint32_t GetEntryIndex() const;
|
||||
uint16_t GetSequenceIndex() const;
|
||||
@@ -536,14 +536,14 @@ assert_struct_size(RCT12LargeSceneryElement, 8);
|
||||
struct RCT12WallElement : RCT12TileElementBase
|
||||
{
|
||||
private:
|
||||
uint8_t entryIndex; // 4
|
||||
uint8_t EntryIndex; // 4
|
||||
union
|
||||
{
|
||||
uint8_t colour_3; // 5
|
||||
uint8_t banner_index; // 5
|
||||
uint8_t Colour3; // 5
|
||||
uint8_t BannerIndex; // 5
|
||||
};
|
||||
uint8_t colour_1; // 6 0b_2221_1111 2 = colour_2 (uses flags for rest of colour2), 1 = colour_1
|
||||
uint8_t animation; // 7 0b_dfff_ft00 d = direction, f = frame num, t = across track flag (not used)
|
||||
uint8_t Colour1; // 6 0b_2221_1111 2 = colour_2 (uses Flags for rest of colour2), 1 = colour_1
|
||||
uint8_t Animation; // 7 0b_dfff_ft00 d = direction, f = frame num, t = across track flag (not used)
|
||||
public:
|
||||
RCT12ObjectEntryIndex GetEntryIndex() const;
|
||||
uint8_t GetSlope() const;
|
||||
@@ -562,10 +562,10 @@ assert_struct_size(RCT12WallElement, 8);
|
||||
struct RCT12EntranceElement : RCT12TileElementBase
|
||||
{
|
||||
private:
|
||||
uint8_t entranceType; // 4
|
||||
uint8_t index; // 5. 0bUSSS????, S = station index.
|
||||
uint8_t pathType; // 6
|
||||
uint8_t rideIndex; // 7
|
||||
uint8_t EntranceType; // 4
|
||||
uint8_t Index; // 5. 0bUSSS????, S = station index.
|
||||
uint8_t PathType; // 6
|
||||
uint8_t RideIndex; // 7
|
||||
public:
|
||||
uint8_t GetEntranceType() const;
|
||||
uint8_t GetRideIndex() const;
|
||||
@@ -577,12 +577,12 @@ assert_struct_size(RCT12EntranceElement, 8);
|
||||
struct RCT12BannerElement : RCT12TileElementBase
|
||||
{
|
||||
private:
|
||||
uint8_t index; // 4
|
||||
uint8_t position; // 5
|
||||
uint8_t Index; // 4
|
||||
uint8_t Position; // 5
|
||||
uint8_t AllowedEdges; // 6
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunused-private-field"
|
||||
uint8_t unused; // 7
|
||||
uint8_t Unused; // 7
|
||||
#pragma clang diagnostic pop
|
||||
public:
|
||||
uint8_t GetIndex() const;
|
||||
@@ -593,19 +593,19 @@ assert_struct_size(RCT12BannerElement, 8);
|
||||
|
||||
struct RCT12CorruptElement : RCT12TileElementBase
|
||||
{
|
||||
uint8_t pad[4];
|
||||
uint8_t Pad[4];
|
||||
};
|
||||
assert_struct_size(RCT12CorruptElement, 8);
|
||||
|
||||
struct RCT12EightCarsCorruptElement14 : RCT12TileElementBase
|
||||
{
|
||||
uint8_t pad[4];
|
||||
uint8_t Pad[4];
|
||||
};
|
||||
assert_struct_size(RCT12EightCarsCorruptElement14, 8);
|
||||
|
||||
struct RCT12EightCarsCorruptElement15 : RCT12TileElementBase
|
||||
{
|
||||
uint8_t pad[4];
|
||||
uint8_t Pad[4];
|
||||
};
|
||||
assert_struct_size(RCT12EightCarsCorruptElement15, 8);
|
||||
|
||||
@@ -653,170 +653,170 @@ enum class RCT12PeepType : uint8_t
|
||||
|
||||
struct RCT12EntityBase
|
||||
{
|
||||
RCT12EntityIdentifier EntityIdentifier; // 0x00
|
||||
uint8_t type; // 0x01
|
||||
uint16_t next_in_quadrant; // 0x02
|
||||
uint16_t next; // 0x04
|
||||
uint16_t previous; // 0x06
|
||||
RCT12EntityLinkListOffset linked_list_type_offset; // 0x08
|
||||
uint8_t SpriteHeightNegative; // 0x09
|
||||
uint16_t EntityIndex; // 0x0A
|
||||
uint16_t flags; // 0x0C
|
||||
int16_t x; // 0x0E
|
||||
int16_t y; // 0x10
|
||||
int16_t z; // 0x12
|
||||
uint8_t SpriteWidth; // 0x14
|
||||
uint8_t SpriteHeightPositive; // 0x15
|
||||
int16_t SpriteLeft; // 0x16
|
||||
int16_t SpriteTop; // 0x18
|
||||
int16_t SpriteRight; // 0x1A
|
||||
int16_t SpriteBottom; // 0x1C
|
||||
uint8_t EntityDirection; // 0x1E
|
||||
RCT12EntityIdentifier EntityIdentifier; // 0x00
|
||||
uint8_t Type; // 0x01
|
||||
uint16_t NextInQuadrant; // 0x02
|
||||
uint16_t Next; // 0x04
|
||||
uint16_t Previous; // 0x06
|
||||
RCT12EntityLinkListOffset LinkedListTypeOffset; // 0x08
|
||||
uint8_t SpriteHeightNegative; // 0x09
|
||||
uint16_t EntityIndex; // 0x0A
|
||||
uint16_t Flags; // 0x0C
|
||||
int16_t x; // 0x0E
|
||||
int16_t y; // 0x10
|
||||
int16_t z; // 0x12
|
||||
uint8_t SpriteWidth; // 0x14
|
||||
uint8_t SpriteHeightPositive; // 0x15
|
||||
int16_t SpriteLeft; // 0x16
|
||||
int16_t SpriteTop; // 0x18
|
||||
int16_t SpriteRight; // 0x1A
|
||||
int16_t SpriteBottom; // 0x1C
|
||||
uint8_t EntityDirection; // 0x1E
|
||||
};
|
||||
assert_struct_size(RCT12EntityBase, 0x1F);
|
||||
|
||||
struct RCT12EntityBalloon : RCT12EntityBase
|
||||
{
|
||||
uint8_t Pad1F[0x24 - 0x1F];
|
||||
uint16_t popped; // 0x24
|
||||
uint8_t time_to_move; // 0x26
|
||||
uint8_t frame; // 0x27
|
||||
uint16_t Popped; // 0x24
|
||||
uint8_t TimeToMove; // 0x26
|
||||
uint8_t Frame; // 0x27
|
||||
uint8_t Pad28[4];
|
||||
uint8_t colour; // 0x2C
|
||||
uint8_t Colour; // 0x2C
|
||||
};
|
||||
assert_struct_size(RCT12EntityBalloon, 0x2D);
|
||||
|
||||
struct RCT12EntityDuck : RCT12EntityBase
|
||||
{
|
||||
uint8_t Pad1F[0x26 - 0x1F];
|
||||
uint16_t frame; // 0x26
|
||||
uint16_t Frame; // 0x26
|
||||
uint8_t Pad28[0x30 - 0x28];
|
||||
int16_t target_x; // 0x30
|
||||
int16_t target_y; // 0x32
|
||||
int16_t TargetX; // 0x30
|
||||
int16_t TargetY; // 0x32
|
||||
uint8_t Pad34[0x14];
|
||||
uint8_t state; // 0x48
|
||||
uint8_t State; // 0x48
|
||||
};
|
||||
assert_struct_size(RCT12EntityDuck, 0x49);
|
||||
|
||||
struct RCT12EntityLitter : RCT12EntityBase
|
||||
{
|
||||
uint8_t Pad1F[0x24 - 0x1F];
|
||||
uint32_t creationTick; // 0x24
|
||||
uint32_t CreationTick; // 0x24
|
||||
};
|
||||
assert_struct_size(RCT12EntityLitter, 0x28);
|
||||
|
||||
struct RCT12EntityParticle : RCT12EntityBase
|
||||
{
|
||||
uint8_t Pad1F[0x26 - 0x1F];
|
||||
uint16_t frame; // 0x26
|
||||
uint16_t Frame; // 0x26
|
||||
};
|
||||
assert_struct_size(RCT12EntityParticle, 0x28);
|
||||
|
||||
struct RCT12EntityJumpingFountain : RCT12EntityBase
|
||||
{
|
||||
uint8_t Pad1F[0x26 - 0x1F];
|
||||
uint8_t num_ticks_alive; // 0x26
|
||||
uint8_t frame; // 0x27
|
||||
uint8_t NumTicksAlive; // 0x26
|
||||
uint8_t Frame; // 0x27
|
||||
uint8_t Pad28[0x2F - 0x28];
|
||||
uint8_t fountain_flags; // 0x2F
|
||||
int16_t target_x; // 0x30
|
||||
int16_t target_y; // 0x32
|
||||
uint8_t FountainFlags; // 0x2F
|
||||
int16_t TargetX; // 0x30
|
||||
int16_t TargetY; // 0x32
|
||||
uint8_t Pad34[0x46 - 0x34];
|
||||
uint16_t iteration; // 0x46
|
||||
uint16_t Iteration; // 0x46
|
||||
};
|
||||
assert_struct_size(RCT12EntityJumpingFountain, 0x48);
|
||||
|
||||
struct RCT12EntityMoneyEffect : RCT12EntityBase
|
||||
{
|
||||
uint8_t Pad1F[0x24 - 0x1F];
|
||||
uint16_t move_delay; // 0x24
|
||||
uint8_t num_movements; // 0x26
|
||||
uint8_t vertical;
|
||||
money32 value; // 0x28
|
||||
uint16_t MoveDelay; // 0x24
|
||||
uint8_t NumMovements; // 0x26
|
||||
uint8_t Vertical;
|
||||
money32 Value; // 0x28
|
||||
uint8_t Pad2C[0x44 - 0x2C];
|
||||
int16_t offset_x; // 0x44
|
||||
uint16_t wiggle; // 0x46
|
||||
int16_t OffsetX; // 0x44
|
||||
uint16_t Wiggle; // 0x46
|
||||
};
|
||||
assert_struct_size(RCT12EntityMoneyEffect, 0x48);
|
||||
|
||||
struct RCT12EntityCrashedVehicleParticle : RCT12EntityBase
|
||||
{
|
||||
uint8_t Pad1F[0x24 - 0x1F];
|
||||
uint16_t time_to_live; // 0x24
|
||||
uint16_t frame; // 0x26
|
||||
uint16_t TimeToLive; // 0x24
|
||||
uint16_t Frame; // 0x26
|
||||
uint8_t Pad28[0x2C - 0x28];
|
||||
uint8_t colour[2]; // 0x2C
|
||||
uint8_t Colour[2]; // 0x2C
|
||||
uint16_t CrashedEntityBase; // 0x2E
|
||||
int16_t velocity_x; // 0x30
|
||||
int16_t velocity_y; // 0x32
|
||||
int16_t velocity_z; // 0x34
|
||||
int16_t VelocityX; // 0x30
|
||||
int16_t VelocityY; // 0x32
|
||||
int16_t VelocityZ; // 0x34
|
||||
uint8_t Pad36[0x38 - 0x36];
|
||||
int32_t acceleration_x; // 0x38
|
||||
int32_t acceleration_y; // 0x3C
|
||||
int32_t acceleration_z; // 0x40
|
||||
int32_t AccelerationX; // 0x38
|
||||
int32_t AccelerationY; // 0x3C
|
||||
int32_t AccelerationZ; // 0x40
|
||||
};
|
||||
assert_struct_size(RCT12EntityCrashedVehicleParticle, 0x44);
|
||||
|
||||
struct RCT12EntityCrashSplash : RCT12EntityBase
|
||||
{
|
||||
uint8_t Pad1F[0x26 - 0x1F];
|
||||
uint16_t frame; // 0x26
|
||||
uint16_t Frame; // 0x26
|
||||
};
|
||||
assert_struct_size(RCT12EntityCrashSplash, 0x28);
|
||||
|
||||
struct RCT12EntitySteamParticle : RCT12EntityBase
|
||||
{
|
||||
uint8_t Pad1F[0x24 - 0x1F];
|
||||
uint16_t time_to_move; // 0x24
|
||||
uint16_t frame; // 0x26
|
||||
uint16_t TimeToMove; // 0x24
|
||||
uint16_t Frame; // 0x26
|
||||
};
|
||||
assert_struct_size(RCT12EntitySteamParticle, 0x28);
|
||||
|
||||
struct RCT12PeepThought
|
||||
{
|
||||
uint8_t type;
|
||||
uint8_t item;
|
||||
uint8_t freshness;
|
||||
uint8_t fresh_timeout;
|
||||
uint8_t Type;
|
||||
uint8_t Item;
|
||||
uint8_t Freshness;
|
||||
uint8_t FreshTimeout;
|
||||
};
|
||||
assert_struct_size(RCT12PeepThought, 4);
|
||||
|
||||
struct RCT12RideMeasurement
|
||||
{
|
||||
uint8_t ride_index; // 0x0000
|
||||
uint8_t flags; // 0x0001
|
||||
uint32_t last_use_tick; // 0x0002
|
||||
uint16_t num_items; // 0x0006
|
||||
uint16_t current_item; // 0x0008
|
||||
uint8_t vehicle_index; // 0x000A
|
||||
uint8_t current_station; // 0x000B
|
||||
int8_t vertical[RCT12::Limits::RideMeasurementMaxItems]; // 0x000C
|
||||
int8_t lateral[RCT12::Limits::RideMeasurementMaxItems]; // 0x12CC
|
||||
uint8_t velocity[RCT12::Limits::RideMeasurementMaxItems]; // 0x258C
|
||||
uint8_t altitude[RCT12::Limits::RideMeasurementMaxItems]; // 0x384C
|
||||
uint8_t RideIndex; // 0x0000
|
||||
uint8_t Flags; // 0x0001
|
||||
uint32_t LastUseTick; // 0x0002
|
||||
uint16_t NumItems; // 0x0006
|
||||
uint16_t CurrentItem; // 0x0008
|
||||
uint8_t VehicleIndex; // 0x000A
|
||||
uint8_t CurrentStation; // 0x000B
|
||||
int8_t Vertical[RCT12::Limits::RideMeasurementMaxItems]; // 0x000C
|
||||
int8_t Lateral[RCT12::Limits::RideMeasurementMaxItems]; // 0x12CC
|
||||
uint8_t Velocity[RCT12::Limits::RideMeasurementMaxItems]; // 0x258C
|
||||
uint8_t Altitude[RCT12::Limits::RideMeasurementMaxItems]; // 0x384C
|
||||
};
|
||||
assert_struct_size(RCT12RideMeasurement, 0x4B0C);
|
||||
|
||||
struct RCT12Banner
|
||||
{
|
||||
RCT12ObjectEntryIndex type;
|
||||
uint8_t flags; // 0x01
|
||||
StringId string_idx; // 0x02
|
||||
RCT12ObjectEntryIndex Type;
|
||||
uint8_t Flags; // 0x01
|
||||
::StringId StringID; // 0x02
|
||||
union
|
||||
{
|
||||
uint8_t colour; // 0x04
|
||||
uint8_t ride_index; // 0x04
|
||||
uint8_t Colour; // 0x04
|
||||
uint8_t RideIndex; // 0x04
|
||||
};
|
||||
uint8_t text_colour; // 0x05
|
||||
uint8_t x; // 0x06
|
||||
uint8_t y; // 0x07
|
||||
uint8_t TextColour; // 0x05
|
||||
uint8_t x; // 0x06
|
||||
uint8_t y; // 0x07
|
||||
};
|
||||
assert_struct_size(RCT12Banner, 8);
|
||||
|
||||
struct RCT12MapAnimation
|
||||
{
|
||||
uint8_t baseZ;
|
||||
uint8_t type;
|
||||
uint8_t BaseZ;
|
||||
uint8_t Type;
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
};
|
||||
@@ -827,16 +827,16 @@ struct RCT12ResearchItem
|
||||
// Bit 16 (0: scenery entry, 1: ride entry)
|
||||
union
|
||||
{
|
||||
uint32_t rawValue;
|
||||
uint32_t RawValue;
|
||||
struct
|
||||
{
|
||||
RCT12ObjectEntryIndex entryIndex;
|
||||
uint8_t baseRideType;
|
||||
uint8_t type; // 0: scenery entry, 1: ride entry
|
||||
uint8_t flags;
|
||||
RCT12ObjectEntryIndex EntryIndex;
|
||||
uint8_t BaseRideType;
|
||||
uint8_t Type; // 0: scenery entry, 1: ride entry
|
||||
uint8_t Flags;
|
||||
};
|
||||
};
|
||||
uint8_t category;
|
||||
uint8_t Category;
|
||||
|
||||
bool IsInventedEndMarker() const;
|
||||
bool IsRandomEndMarker() const;
|
||||
@@ -848,8 +848,8 @@ assert_struct_size(RCT12ResearchItem, 5);
|
||||
|
||||
struct RCT12VehicleColour
|
||||
{
|
||||
uint8_t body_colour;
|
||||
uint8_t trim_colour;
|
||||
uint8_t BodyColour;
|
||||
uint8_t TrimColour;
|
||||
};
|
||||
assert_struct_size(RCT12VehicleColour, 2);
|
||||
|
||||
@@ -877,7 +877,7 @@ template<typename T> std::vector<uint16_t> RCT12GetRideTypesBeenOn(T* srcPeep)
|
||||
std::vector<uint16_t> ridesTypesBeenOn;
|
||||
for (uint16_t i = 0; i < RCT12::Limits::MaxRideObjects; i++)
|
||||
{
|
||||
if (srcPeep->ride_types_been_on[i / 8] & (1 << (i % 8)))
|
||||
if (srcPeep->RideTypesBeenOn[i / 8] & (1 << (i % 8)))
|
||||
{
|
||||
ridesTypesBeenOn.push_back(i);
|
||||
}
|
||||
@@ -889,7 +889,7 @@ template<typename T> std::vector<RideId> RCT12GetRidesBeenOn(T* srcPeep)
|
||||
std::vector<RideId> ridesBeenOn;
|
||||
for (uint16_t i = 0; i < RCT12::Limits::MaxRidesInPark; i++)
|
||||
{
|
||||
if (srcPeep->rides_been_on[i / 8] & (1 << (i % 8)))
|
||||
if (srcPeep->RidesBeenOn[i / 8] & (1 << (i % 8)))
|
||||
{
|
||||
ridesBeenOn.push_back(RideId::FromUnderlying(i));
|
||||
}
|
||||
|
||||
@@ -118,24 +118,24 @@ namespace RCT2
|
||||
|
||||
uint8_t Ride::GetMinCarsPerTrain() const
|
||||
{
|
||||
return min_max_cars_per_train >> 4;
|
||||
return MinMaxCarsPerTrain >> 4;
|
||||
}
|
||||
|
||||
uint8_t Ride::GetMaxCarsPerTrain() const
|
||||
{
|
||||
return min_max_cars_per_train & 0xF;
|
||||
return MinMaxCarsPerTrain & 0xF;
|
||||
}
|
||||
|
||||
void Ride::SetMinCarsPerTrain(uint8_t newValue)
|
||||
{
|
||||
min_max_cars_per_train &= ~0xF0;
|
||||
min_max_cars_per_train |= (newValue << 4);
|
||||
MinMaxCarsPerTrain &= ~0xF0;
|
||||
MinMaxCarsPerTrain |= (newValue << 4);
|
||||
}
|
||||
|
||||
void Ride::SetMaxCarsPerTrain(uint8_t newValue)
|
||||
{
|
||||
min_max_cars_per_train &= ~0x0F;
|
||||
min_max_cars_per_train |= newValue & 0x0F;
|
||||
MinMaxCarsPerTrain &= ~0x0F;
|
||||
MinMaxCarsPerTrain |= newValue & 0x0F;
|
||||
}
|
||||
|
||||
bool RCT2TrackTypeIsBooster(ride_type_t rideType, uint16_t trackType)
|
||||
|
||||
+568
-568
File diff suppressed because it is too large.
Load diff
+577
-577
File diff suppressed because it is too large.
Load diff
@@ -71,64 +71,64 @@ namespace RCT2
|
||||
// Rework td6 so that it is just the fields
|
||||
_stream.Read(&td6, 0xA3);
|
||||
|
||||
td->type = td6.type; // 0x00
|
||||
td->vehicle_type = td6.vehicle_type;
|
||||
td->type = td6.Type; // 0x00
|
||||
td->vehicle_type = td6.VehicleType;
|
||||
|
||||
td->cost = 0;
|
||||
td->flags = td6.flags;
|
||||
td->ride_mode = static_cast<RideMode>(td6.ride_mode);
|
||||
td->flags = td6.Flags;
|
||||
td->ride_mode = static_cast<RideMode>(td6.RideMode);
|
||||
td->track_flags = 0;
|
||||
td->colour_scheme = td6.version_and_colour_scheme & 0x3;
|
||||
td->colour_scheme = td6.VersionAndColourScheme & 0x3;
|
||||
for (auto i = 0; i < Limits::MaxTrainsPerRide; ++i)
|
||||
{
|
||||
td->vehicle_colours[i].Body = td6.vehicle_colours[i].body_colour;
|
||||
td->vehicle_colours[i].Trim = td6.vehicle_colours[i].trim_colour;
|
||||
td->vehicle_colours[i].Tertiary = td6.vehicle_additional_colour[i];
|
||||
td->vehicle_colours[i].Body = td6.VehicleColours[i].BodyColour;
|
||||
td->vehicle_colours[i].Trim = td6.VehicleColours[i].TrimColour;
|
||||
td->vehicle_colours[i].Tertiary = td6.VehicleAdditionalColour[i];
|
||||
}
|
||||
td->entrance_style = td6.entrance_style;
|
||||
td->total_air_time = td6.total_air_time;
|
||||
td->depart_flags = td6.depart_flags;
|
||||
td->number_of_trains = td6.number_of_trains;
|
||||
td->number_of_cars_per_train = td6.number_of_cars_per_train;
|
||||
td->min_waiting_time = td6.min_waiting_time;
|
||||
td->max_waiting_time = td6.max_waiting_time;
|
||||
td->operation_setting = td6.operation_setting;
|
||||
td->max_speed = td6.max_speed;
|
||||
td->average_speed = td6.average_speed;
|
||||
td->ride_length = td6.ride_length;
|
||||
td->max_positive_vertical_g = td6.max_positive_vertical_g;
|
||||
td->max_negative_vertical_g = td6.max_negative_vertical_g;
|
||||
td->max_lateral_g = td6.max_lateral_g;
|
||||
td->entrance_style = td6.EntranceStyle;
|
||||
td->total_air_time = td6.TotalAirTime;
|
||||
td->depart_flags = td6.DepartFlags;
|
||||
td->number_of_trains = td6.NumberOfTrains;
|
||||
td->number_of_cars_per_train = td6.NumberOfCarsPerTrain;
|
||||
td->min_waiting_time = td6.MinWaitingTime;
|
||||
td->max_waiting_time = td6.MaxWaitingTime;
|
||||
td->operation_setting = td6.OperationSetting;
|
||||
td->max_speed = td6.MaxSpeed;
|
||||
td->average_speed = td6.AverageSpeed;
|
||||
td->ride_length = td6.RideLength;
|
||||
td->max_positive_vertical_g = td6.MaxPositiveVerticalG;
|
||||
td->max_negative_vertical_g = td6.MaxNegativeVerticalG;
|
||||
td->max_lateral_g = td6.MaxLateralG;
|
||||
|
||||
if (td->type == RIDE_TYPE_MINI_GOLF)
|
||||
{
|
||||
td->holes = td6.holes;
|
||||
td->holes = td6.Holes;
|
||||
}
|
||||
else
|
||||
{
|
||||
td->inversions = td6.inversions;
|
||||
td->inversions = td6.Inversions;
|
||||
}
|
||||
|
||||
td->drops = td6.drops;
|
||||
td->highest_drop_height = td6.highest_drop_height;
|
||||
td->excitement = td6.excitement;
|
||||
td->intensity = td6.intensity;
|
||||
td->nausea = td6.nausea;
|
||||
td->upkeep_cost = td6.upkeep_cost;
|
||||
td->drops = td6.Drops;
|
||||
td->highest_drop_height = td6.HighestDropHeight;
|
||||
td->excitement = td6.Excitement;
|
||||
td->intensity = td6.Intensity;
|
||||
td->nausea = td6.Nausea;
|
||||
td->upkeep_cost = td6.UpkeepCost;
|
||||
for (auto i = 0; i < Limits::NumColourSchemes; ++i)
|
||||
{
|
||||
td->track_spine_colour[i] = td6.track_spine_colour[i];
|
||||
td->track_rail_colour[i] = td6.track_rail_colour[i];
|
||||
td->track_support_colour[i] = td6.track_support_colour[i];
|
||||
td->track_spine_colour[i] = td6.TrackSpineColour[i];
|
||||
td->track_rail_colour[i] = td6.TrackRailColour[i];
|
||||
td->track_support_colour[i] = td6.TrackSupportColour[i];
|
||||
}
|
||||
td->flags2 = td6.flags2;
|
||||
td->vehicle_object = ObjectEntryDescriptor(td6.vehicle_object);
|
||||
td->space_required_x = td6.space_required_x;
|
||||
td->space_required_y = td6.space_required_y;
|
||||
td->lift_hill_speed = td6.lift_hill_speed_num_circuits & 0b00011111;
|
||||
td->num_circuits = td6.lift_hill_speed_num_circuits >> 5;
|
||||
td->flags2 = td6.Flags2;
|
||||
td->vehicle_object = ObjectEntryDescriptor(td6.VehicleObject);
|
||||
td->space_required_x = td6.SpaceRequiredX;
|
||||
td->space_required_y = td6.SpaceRequiredY;
|
||||
td->lift_hill_speed = td6.LiftHillSpeedNumCircuits & 0b00011111;
|
||||
td->num_circuits = td6.LiftHillSpeedNumCircuits >> 5;
|
||||
|
||||
auto version = static_cast<RCT12TrackDesignVersion>((td6.version_and_colour_scheme >> 2) & 3);
|
||||
auto version = static_cast<RCT12TrackDesignVersion>((td6.VersionAndColourScheme >> 2) & 3);
|
||||
if (version != RCT12TrackDesignVersion::TD6)
|
||||
{
|
||||
LOG_ERROR("Unsupported track design.");
|
||||
@@ -141,17 +141,17 @@ namespace RCT2
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
{
|
||||
TD46MazeElement t6MazeElement{};
|
||||
t6MazeElement.all = !0;
|
||||
while (t6MazeElement.all != 0)
|
||||
t6MazeElement.All = !0;
|
||||
while (t6MazeElement.All != 0)
|
||||
{
|
||||
_stream.Read(&t6MazeElement, sizeof(TD46MazeElement));
|
||||
if (t6MazeElement.all != 0)
|
||||
if (t6MazeElement.All != 0)
|
||||
{
|
||||
TrackDesignMazeElement mazeElement{};
|
||||
mazeElement.x = t6MazeElement.x;
|
||||
mazeElement.y = t6MazeElement.y;
|
||||
mazeElement.direction = t6MazeElement.direction;
|
||||
mazeElement.type = t6MazeElement.type;
|
||||
mazeElement.direction = t6MazeElement.Direction;
|
||||
mazeElement.type = t6MazeElement.Type;
|
||||
td->maze_elements.push_back(mazeElement);
|
||||
}
|
||||
}
|
||||
@@ -165,14 +165,14 @@ namespace RCT2
|
||||
_stream.Read(&t6TrackElement, sizeof(TD46TrackElement));
|
||||
TrackDesignTrackElement trackElement{};
|
||||
|
||||
track_type_t trackType = RCT2TrackTypeToOpenRCT2(t6TrackElement.type, td->type, true);
|
||||
track_type_t trackType = RCT2TrackTypeToOpenRCT2(t6TrackElement.Type, td->type, true);
|
||||
if (trackType == TrackElemType::InvertedUp90ToFlatQuarterLoopAlias)
|
||||
{
|
||||
trackType = TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop;
|
||||
}
|
||||
|
||||
trackElement.type = trackType;
|
||||
trackElement.flags = t6TrackElement.flags;
|
||||
trackElement.flags = t6TrackElement.Flags;
|
||||
td->track_elements.push_back(trackElement);
|
||||
}
|
||||
|
||||
@@ -197,13 +197,13 @@ namespace RCT2
|
||||
TD6SceneryElement t6SceneryElement{};
|
||||
_stream.Read(&t6SceneryElement, sizeof(TD6SceneryElement));
|
||||
TrackDesignSceneryElement sceneryElement{};
|
||||
sceneryElement.scenery_object = ObjectEntryDescriptor(t6SceneryElement.scenery_object);
|
||||
sceneryElement.scenery_object = ObjectEntryDescriptor(t6SceneryElement.SceneryObject);
|
||||
sceneryElement.loc.x = t6SceneryElement.x * COORDS_XY_STEP;
|
||||
sceneryElement.loc.y = t6SceneryElement.y * COORDS_XY_STEP;
|
||||
sceneryElement.loc.z = t6SceneryElement.z * COORDS_Z_STEP;
|
||||
sceneryElement.flags = t6SceneryElement.flags;
|
||||
sceneryElement.primary_colour = t6SceneryElement.primary_colour;
|
||||
sceneryElement.secondary_colour = t6SceneryElement.secondary_colour;
|
||||
sceneryElement.flags = t6SceneryElement.Flags;
|
||||
sceneryElement.primary_colour = t6SceneryElement.PrimaryColour;
|
||||
sceneryElement.secondary_colour = t6SceneryElement.SecondaryColour;
|
||||
td->scenery_elements.push_back(std::move(sceneryElement));
|
||||
}
|
||||
|
||||
|
||||
@@ -246,15 +246,15 @@ private:
|
||||
auto chunkReader = SawyerChunkReader(stream.get());
|
||||
|
||||
const auto header = chunkReader.ReadChunkAs<RCT2::S6Header>();
|
||||
if (header.type == S6_TYPE_SCENARIO)
|
||||
if (header.Type == S6_TYPE_SCENARIO)
|
||||
{
|
||||
auto info = chunkReader.ReadChunkAs<RCT2::S6Info>();
|
||||
// If the name or the details contain a colour code, they might be in UTF-8 already.
|
||||
// This is caused by a bug that was in OpenRCT2 for 3 years.
|
||||
if (!IsLikelyUTF8(info.name) && !IsLikelyUTF8(info.details))
|
||||
if (!IsLikelyUTF8(info.Name) && !IsLikelyUTF8(info.Details))
|
||||
{
|
||||
RCT2StringToUTF8Self(info.name, sizeof(info.name));
|
||||
RCT2StringToUTF8Self(info.details, sizeof(info.details));
|
||||
RCT2StringToUTF8Self(info.Name, sizeof(info.Name));
|
||||
RCT2StringToUTF8Self(info.Details, sizeof(info.Details));
|
||||
}
|
||||
|
||||
*entry = CreateNewScenarioEntry(path, timestamp, &info);
|
||||
@@ -277,20 +277,20 @@ private:
|
||||
// Set new entry
|
||||
String::Set(entry.path, sizeof(entry.path), path.c_str());
|
||||
entry.timestamp = timestamp;
|
||||
entry.category = s6Info->category;
|
||||
entry.objective_type = s6Info->objective_type;
|
||||
entry.objective_arg_1 = s6Info->objective_arg_1;
|
||||
entry.objective_arg_2 = s6Info->objective_arg_2;
|
||||
entry.objective_arg_3 = s6Info->objective_arg_3;
|
||||
entry.category = s6Info->Category;
|
||||
entry.objective_type = s6Info->ObjectiveType;
|
||||
entry.objective_arg_1 = s6Info->ObjectiveArg1;
|
||||
entry.objective_arg_2 = s6Info->ObjectiveArg2;
|
||||
entry.objective_arg_3 = s6Info->ObjectiveArg3;
|
||||
entry.highscore = nullptr;
|
||||
if (String::IsNullOrEmpty(s6Info->name))
|
||||
if (String::IsNullOrEmpty(s6Info->Name))
|
||||
{
|
||||
// If the scenario doesn't have a name, set it to the filename
|
||||
String::Set(entry.name, sizeof(entry.name), Path::GetFileNameWithoutExtension(entry.path).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
String::Set(entry.name, sizeof(entry.name), s6Info->name);
|
||||
String::Set(entry.name, sizeof(entry.name), s6Info->Name);
|
||||
// Normalise the name to make the scenario as recognisable as possible.
|
||||
ScenarioSources::NormaliseName(entry.name, sizeof(entry.name), entry.name);
|
||||
}
|
||||
@@ -298,7 +298,7 @@ private:
|
||||
// entry.name will be translated later so keep the untranslated name here
|
||||
String::Set(entry.internal_name, sizeof(entry.internal_name), entry.name);
|
||||
|
||||
String::Set(entry.details, sizeof(entry.details), s6Info->details);
|
||||
String::Set(entry.details, sizeof(entry.details), s6Info->Details);
|
||||
|
||||
// Look up and store information regarding the origins of this scenario.
|
||||
SourceDescriptor desc;
|
||||
|
||||
Reference in new issue
Block a user