Beautify TrackData.cpp

This commit is contained in:
spacek531 2025-01-20 06:26:31 -08:00 committed by GitHub
parent 81168d57b8
commit 5bec62c540
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1232,50 +1232,50 @@ namespace OpenRCT2::TrackMetaData
{ false, TrackPitch::Up90, TrackRoll::None, TrackCurve::None, TrackPitch::Up60, TrackRoll::None, TrackElemType::Up90ToUp60 },
{ false, TrackPitch::Up90, TrackRoll::None, TrackCurve::None, TrackPitch::Up90, TrackRoll::None, TrackElemType::Up90 },
{ false, TrackPitch::Up90, TrackRoll::None, TrackCurve::RightSmall, TrackPitch::Up90, TrackRoll::None, TrackElemType::RightQuarterTurn1TileUp90 },
{ false, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftEighthToDiagUp25 }, // TrackElemType::LeftEighthToDiagUp25
{ false, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightEighthToDiagUp25 }, // TrackElemType::RightEighthToDiagUp25
{ false, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftEighthToDiagDown25 }, // TrackElemType::LeftEighthToDiagDown25
{ false, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightEighthToDiagDown25 }, // TrackElemType::RightEighthToDiagDown25
{ true, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftEighthToOrthogonalUp25 }, // TrackElemType::LeftEighthToOrthogonalUp25
{ true, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightEighthToOrthogonalUp25 }, // TrackElemType::RightEighthToOrthogonalUp25
{ true, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftEighthToOrthogonalDown25 }, // TrackElemType::LeftEighthToOrthogonalDown25
{ true, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightEighthToOrthogonalDown25 }, // TrackElemType::RightEighthToOrthogonalDown25
{ true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagUp25ToLeftBankedUp25 }, // TrackElemType::DiagUp25ToLeftBankedUp25
{ true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagUp25ToRightBankedUp25 }, // TrackElemType::DiagUp25ToRightBankedUp25
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagLeftBankedUp25ToUp25 }, // TrackElemType::DiagLeftBankedUp25ToUp25
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagRightBankedUp25ToUp25 }, // TrackElemType::DiagRightBankedUp25ToUp25
{ true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagDown25ToLeftBankedDown25 }, // TrackElemType::DiagDown25ToLeftBankedDown25
{ true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagDown25ToRightBankedDown25 }, // TrackElemType::DiagDown25ToRightBankedDown25
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagLeftBankedDown25ToDown25 }, // TrackElemType::DiagLeftBankedDown25ToDown25
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagRightBankedDown25ToDown25 }, // TrackElemType::DiagRightBankedDown25ToDown25
{ true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagLeftBankedFlatToLeftBankedUp25 }, // TrackElemType::DiagLeftBankedFlatToLeftBankedUp25
{ true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagRightBankedFlatToRightBankedUp25 }, // TrackElemType::DiagRightBankedFlatToRightBankedUp25
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat }, // TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBankedUp25ToRightBankedFlat }, // TrackElemType::DiagRightBankedUp25ToRightBankedFlat
{ true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagLeftBankedFlatToLeftBankedDown25 }, // TrackElemType::DiagLeftBankedFlatToLeftBankedDown25
{ true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagRightBankedFlatToRightBankedDown25 }, // TrackElemType::DiagRightBankedFlatToRightBankedDown25
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat }, // TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBankedDown25ToRightBankedFlat }, // TrackElemType::DiagRightBankedDown25ToRightBankedFlat
{ true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagFlatToLeftBankedUp25 }, // TrackElemType::DiagFlatToLeftBankedUp25
{ true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagFlatToRightBankedUp25 }, // TrackElemType::DiagFlatToRightBankedUp25
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankedUp25ToFlat }, // TrackElemType::DiagLeftBankedUp25ToFlat
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankedUp25ToFlat }, // TrackElemType::DiagRightBankedUp25ToFlat
{ true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagFlatToLeftBankedDown25 }, // TrackElemType::DiagFlatToLeftBankedDown25
{ true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagFlatToRightBankedDown25 }, // TrackElemType::DiagFlatToRightBankedDown25
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankedDown25ToFlat }, // TrackElemType::DiagLeftBankedDown25ToFlat
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankedDown25ToFlat }, // TrackElemType::DiagRightBankedDown25ToFlat
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagUp25LeftBanked }, // TrackElemType::Up25LeftBanked
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagUp25RightBanked }, // TrackElemType::Up25RightBanked
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagDown25LeftBanked }, // TrackElemType::Down25LeftBanked
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagDown25RightBanked }, // TrackElemType::Down25RightBanked
{ false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftEighthBankToDiagUp25 }, // TrackElemType::LeftEighthBankToDiagUp25
{ false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightEighthBankToDiagUp25 }, // TrackElemType::RightEighthBankToDiagUp25
{ false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftEighthBankToDiagDown25 }, // TrackElemType::LeftEighthBankToDiagDown25
{ false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightEighthBankToDiagDown25 }, // TrackElemType::RightEighthBankToDiagDown25
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonalUp25 }, // TrackElemType::LeftEighthBankToOrthogonalUp25
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonalUp25 }, // TrackElemType::RightEighthBankToOrthogonalUp25
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonalDown25 }, // TrackElemType::LeftEighthBankToOrthogonalDown25
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonalDown25 }, // TrackElemType::RightEighthBankToOrthogonalDown25
{ false, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftEighthToDiagUp25 },
{ false, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightEighthToDiagUp25 },
{ false, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftEighthToDiagDown25 },
{ false, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightEighthToDiagDown25 },
{ true, TrackPitch::Up25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::LeftEighthToOrthogonalUp25 },
{ true, TrackPitch::Up25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::None, TrackElemType::RightEighthToOrthogonalUp25 },
{ true, TrackPitch::Down25, TrackRoll::None, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::LeftEighthToOrthogonalDown25 },
{ true, TrackPitch::Down25, TrackRoll::None, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::None, TrackElemType::RightEighthToOrthogonalDown25 },
{ true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagUp25ToLeftBankedUp25 },
{ true, TrackPitch::Up25, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagUp25ToRightBankedUp25 },
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagLeftBankedUp25ToUp25 },
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::None, TrackElemType::DiagRightBankedUp25ToUp25 },
{ true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagDown25ToLeftBankedDown25 },
{ true, TrackPitch::Down25, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagDown25ToRightBankedDown25 },
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagLeftBankedDown25ToDown25 },
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::None, TrackElemType::DiagRightBankedDown25ToDown25 },
{ true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagLeftBankedFlatToLeftBankedUp25 },
{ true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagRightBankedFlatToRightBankedUp25 },
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBankedUp25ToLeftBankedFlat },
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBankedUp25ToRightBankedFlat },
{ true, TrackPitch::None, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagLeftBankedFlatToLeftBankedDown25 },
{ true, TrackPitch::None, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagRightBankedFlatToRightBankedDown25 },
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::Left, TrackElemType::DiagLeftBankedDown25ToLeftBankedFlat },
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::Right, TrackElemType::DiagRightBankedDown25ToRightBankedFlat },
{ true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagFlatToLeftBankedUp25 },
{ true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagFlatToRightBankedUp25 },
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankedUp25ToFlat },
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankedUp25ToFlat },
{ true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagFlatToLeftBankedDown25 },
{ true, TrackPitch::None, TrackRoll::None, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagFlatToRightBankedDown25 },
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagLeftBankedDown25ToFlat },
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::None, TrackRoll::None, TrackElemType::DiagRightBankedDown25ToFlat },
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::None, TrackPitch::Up25, TrackRoll::Left, TrackElemType::DiagUp25LeftBanked },
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::None, TrackPitch::Up25, TrackRoll::Right, TrackElemType::DiagUp25RightBanked },
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::None, TrackPitch::Down25, TrackRoll::Left, TrackElemType::DiagDown25LeftBanked },
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::None, TrackPitch::Down25, TrackRoll::Right, TrackElemType::DiagDown25RightBanked },
{ false, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftEighthBankToDiagUp25 },
{ false, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightEighthBankToDiagUp25 },
{ false, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftEighthBankToDiagDown25 },
{ false, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightEighthBankToDiagDown25 },
{ true, TrackPitch::Up25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Up25, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonalUp25 },
{ true, TrackPitch::Up25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Up25, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonalUp25 },
{ true, TrackPitch::Down25, TrackRoll::Left, TrackCurve::LeftLarge, TrackPitch::Down25, TrackRoll::Left, TrackElemType::LeftEighthBankToOrthogonalDown25 },
{ true, TrackPitch::Down25, TrackRoll::Right, TrackCurve::RightLarge, TrackPitch::Down25, TrackRoll::Right, TrackElemType::RightEighthBankToOrthogonalDown25 },
};
/** rct2: 0x00993D1C */
@ -3158,7 +3158,7 @@ namespace OpenRCT2::TrackMetaData
{ TrackGroup::slopeCurveSteep, TrackPitch::Down60, TrackPitch::Down60, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::RightQuarterTurn1TileDown60
{ TrackGroup::brakes, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Brakes
{ TrackGroup::booster, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Booster
{ TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::InvertedUp90ToFlatQuarterLoopAlias / Maze
{ TrackGroup::flat, TrackPitch::None, TrackPitch::None, TrackRoll::None, TrackRoll::None, 0 }, // TrackElemType::Maze
{ TrackGroup::helixUpBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftQuarterBankedHelixLargeUp
{ TrackGroup::helixUpBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Right, TrackRoll::Right, 0 }, // TrackElemType::RightQuarterBankedHelixLargeUp
{ TrackGroup::helixDownBankedQuarter, TrackPitch::None, TrackPitch::None, TrackRoll::Left, TrackRoll::Left, 0 }, // TrackElemType::LeftQuarterBankedHelixLargeDown
@ -3474,6 +3474,8 @@ namespace OpenRCT2::TrackMetaData
};
static_assert(std::size(TrackTypeToSpinFunction) == EnumValue(TrackElemType::Count));
#pragma region GForces
template<int32_t TConstant>
static int32_t EvaluatorConst(const int16_t)
{
@ -4478,6 +4480,8 @@ namespace OpenRCT2::TrackMetaData
}
}
#pragma endregion
static constexpr StringId RideConfigurationStringIds[] = {
kStringIdEmpty, // 0
STR_STATION_PLATFORM, // 1
@ -4831,6 +4835,8 @@ namespace OpenRCT2::TrackMetaData
};
static_assert(std::size(RideConfigurationStringIds) == EnumValue(TrackElemType::Count));
#pragma region trackBlocks
static constexpr SequenceDescriptor kFlatSeq0 = {
.clearance = { 0, 0, 0, 0, { 0b1111, 0 }, 0 },
.allowedWallEdges = 0b1010,
@ -13045,6 +13051,8 @@ namespace OpenRCT2::TrackMetaData
kRightEighthDiveLoopDownToDiagSeq3, kRightEighthDiveLoopDownToDiagSeq4, kRightEighthDiveLoopDownToDiagSeq5 } },
};
#pragma endregion
static constexpr auto BuildDescriptorTable()
{
std::array<TrackElementDescriptor, EnumValue(TrackElemType::Count)> res{};