From b01ff01e827079cb17546b866c623c2310469f6f Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 5 Nov 2018 11:40:43 +0100 Subject: [PATCH] Extend support for 8 cars corrupt elements --- src/openrct2/rct12/RCT12.h | 24 ++++++++++++------------ src/openrct2/rct2/S6Importer.cpp | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 0533655887..fe860ac651 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -89,7 +89,8 @@ enum class RCT12TileElementType : uint8_t LargeScenery = (6 << 2), Banner = (7 << 2), Corrupt = (8 << 2), - EightCarsCorrupt = (15 << 2), + EightCarsCorrupt14 = (14 << 2), + EightCarsCorrupt15 = (15 << 2), }; struct RCT12SurfaceElement; struct RCT12PathElement; @@ -100,7 +101,8 @@ struct RCT12WallElement; struct RCT12EntranceElement; struct RCT12BannerElement; struct RCT12CorruptElement; -struct RCT12EightCarsCorruptElement; +struct RCT12EightCarsCorruptElement14; +struct RCT12EightCarsCorruptElement15; struct RCT12TileElementBase { @@ -157,14 +159,6 @@ struct RCT12TileElement : public RCT12TileElementBase { return as(); } - RCT12CorruptElement* AsCorrupt() const - { - return as(); - } - RCT12EightCarsCorruptElement* AsEightCarsCorrupt() const - { - return as(); - } void ClearAs(uint8_t newType); }; assert_struct_size(RCT12TileElement, 8); @@ -358,10 +352,16 @@ struct RCT12CorruptElement : RCT12TileElementBase }; assert_struct_size(RCT12CorruptElement, 8); -struct RCT12EightCarsCorruptElement : RCT12TileElementBase +struct RCT12EightCarsCorruptElement14 : RCT12TileElementBase { uint8_t pad[4]; }; -assert_struct_size(RCT12EightCarsCorruptElement, 8); +assert_struct_size(RCT12EightCarsCorruptElement14, 8); + +struct RCT12EightCarsCorruptElement15 : RCT12TileElementBase +{ + uint8_t pad[4]; +}; +assert_struct_size(RCT12EightCarsCorruptElement15, 8); #pragma pack(pop) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 77754eaae6..acfda40e1c 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -857,7 +857,8 @@ public: auto tileElementType = (RCT12TileElementType)src->GetType(); // Todo: replace with setting invisibility bit if (tileElementType == RCT12TileElementType::Corrupt - || tileElementType == RCT12TileElementType::EightCarsCorrupt) + || tileElementType == RCT12TileElementType::EightCarsCorrupt14 + || tileElementType == RCT12TileElementType::EightCarsCorrupt15) memcpy(dst, src, sizeof(*src)); else ImportTileElement(dst, src);