diff --git a/src/openrct2-ui/interface/Dropdown.h b/src/openrct2-ui/interface/Dropdown.h index 47133f6ee0..2610b92352 100644 --- a/src/openrct2-ui/interface/Dropdown.h +++ b/src/openrct2-ui/interface/Dropdown.h @@ -16,7 +16,7 @@ using namespace OpenRCT2; -namespace Dropdown +namespace OpenRCT2::Dropdown { struct Item; @@ -36,7 +36,7 @@ namespace Dropdown void SetChecked(int32_t index, bool value); void SetDisabled(int32_t index, bool value); void SetImage(int32_t index, ImageId image); -} // namespace Dropdown +} // namespace OpenRCT2::Dropdown namespace OpenRCT2::Ui::Windows { @@ -67,7 +67,7 @@ namespace OpenRCT2::Ui::Windows colour_t ColourDropDownIndexToColour(uint8_t ddidx); } // namespace OpenRCT2::Ui::Windows -namespace Dropdown +namespace OpenRCT2::Dropdown { enum class ItemFlag : uint8_t { @@ -142,4 +142,4 @@ namespace Dropdown return true; } -} // namespace Dropdown +} // namespace OpenRCT2::Dropdown diff --git a/src/openrct2-ui/interface/Graph.cpp b/src/openrct2-ui/interface/Graph.cpp index de7d981d8c..8d146cd3a4 100644 --- a/src/openrct2-ui/interface/Graph.cpp +++ b/src/openrct2-ui/interface/Graph.cpp @@ -17,7 +17,7 @@ using namespace OpenRCT2; -namespace Graph +namespace OpenRCT2::Graph { static void DrawMonths(DrawPixelInfo& dpi, const uint8_t* history, int32_t count, const ScreenCoordsXY& origCoords) { @@ -105,7 +105,7 @@ namespace Graph DrawLineA(dpi, history, count, screenPos); DrawLineB(dpi, history, count, screenPos); } -} // namespace Graph +} // namespace OpenRCT2::Graph struct FinancialTooltipInfo { @@ -153,7 +153,7 @@ static const FinancialTooltipInfo FinanceTooltipInfoFromMoney( return { coords, history[historyIndex] }; } -namespace Graph +namespace OpenRCT2::Graph { static void DrawMonths(DrawPixelInfo& dpi, const money64* history, int32_t count, const ScreenCoordsXY& origCoords) { @@ -288,4 +288,4 @@ namespace Graph DrawLineB(dpi, history, count, screenCoords, modifier, offset); DrawHoveredValue(dpi, history, count, screenCoords, modifier, offset); } -} // namespace Graph +} // namespace OpenRCT2::Graph diff --git a/src/openrct2-ui/interface/Graph.h b/src/openrct2-ui/interface/Graph.h index 3f273b03a7..2c3c8fe425 100644 --- a/src/openrct2-ui/interface/Graph.h +++ b/src/openrct2-ui/interface/Graph.h @@ -13,10 +13,10 @@ #include #include -namespace Graph +namespace OpenRCT2::Graph { void Draw(DrawPixelInfo& dpi, uint8_t* history, int32_t count, const ScreenCoordsXY& screenPos); void Draw( DrawPixelInfo& dpi, const money64* history, const int32_t count, const ScreenCoordsXY& coords, const int32_t modifier, const int32_t offset); -} // namespace Graph +} // namespace OpenRCT2::Graph diff --git a/src/openrct2-ui/interface/LandTool.h b/src/openrct2-ui/interface/LandTool.h index 5df7d42a1e..003910cd99 100644 --- a/src/openrct2-ui/interface/LandTool.h +++ b/src/openrct2-ui/interface/LandTool.h @@ -25,11 +25,11 @@ extern ObjectEntryIndex gLandToolTerrainEdge; extern money64 gWaterToolRaiseCost; extern money64 gWaterToolLowerCost; -namespace LandTool +namespace OpenRCT2::LandTool { uint32_t SizeToSpriteIndex(uint16_t size); void ShowSurfaceStyleDropdown(WindowBase* w, Widget* widget, ObjectEntryIndex currentSurfaceType); ObjectEntryIndex GetSurfaceStyleFromDropdownIndex(size_t index); void ShowEdgeStyleDropdown(WindowBase* w, Widget* widget, ObjectEntryIndex currentEdgeType); ObjectEntryIndex GetEdgeStyleFromDropdownIndex(size_t index); -} // namespace LandTool +} // namespace OpenRCT2::LandTool diff --git a/src/openrct2-ui/interface/Theme.cpp b/src/openrct2-ui/interface/Theme.cpp index 3ee9e3951a..48c3e11c6d 100644 --- a/src/openrct2-ui/interface/Theme.cpp +++ b/src/openrct2-ui/interface/Theme.cpp @@ -528,7 +528,7 @@ UITheme UITheme::CreatePredefined(const std::string& name, const UIThemeWindowEn #pragma endregion -namespace ThemeManager +namespace OpenRCT2::ThemeManager { struct AvailableTheme { @@ -688,7 +688,7 @@ namespace ThemeManager auto env = context->GetPlatformEnvironment(); return env->GetDirectoryPath(DIRBASE::USER, DIRID::THEME); } -} // namespace ThemeManager +} // namespace OpenRCT2::ThemeManager void ThemeManagerLoadAvailableThemes() { diff --git a/src/openrct2-ui/ride/Construction.cpp b/src/openrct2-ui/ride/Construction.cpp index 42b6817922..6aad021e35 100644 --- a/src/openrct2-ui/ride/Construction.cpp +++ b/src/openrct2-ui/ride/Construction.cpp @@ -19,83 +19,89 @@ using namespace OpenRCT2::TrackMetaData; -/** - * - * rct2: 0x006B4800 - */ -void RideConstructNew(RideSelection listItem) +namespace OpenRCT2 { - int32_t rideEntryIndex = RideGetEntryIndex(listItem.Type, listItem.EntryIndex); - int32_t colour1 = RideGetRandomColourPresetIndex(listItem.Type); - int32_t colour2 = RideGetUnusedPresetVehicleColour(rideEntryIndex); - - auto gameAction = RideCreateAction( - listItem.Type, listItem.EntryIndex, colour1, colour2, OpenRCT2::GetGameState().LastEntranceStyle); - - gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) - return; - const auto rideIndex = result->GetData(); - auto ride = GetRide(rideIndex); - RideConstructionStart(*ride); - }); - - GameActions::Execute(&gameAction); -} - -SpecialElementsDropdownState BuildSpecialElementsList( - const Ride& currentRide, uint8_t buildDirection, TrackPitch buildSlope, TrackRoll buildBank, RideConstructionState state) -{ - auto buildDirectionIsDiagonal = TrackPieceDirectionIsDiagonal(buildDirection); - SpecialElementsDropdownState list; - - // if it's building neither forwards nor backwards, no list is available - if (state != RideConstructionState::Front && state != RideConstructionState::Place && state != RideConstructionState::Back) - return list; - - for (track_type_t trackType : DropdownOrder) + /** + * + * rct2: 0x006B4800 + */ + void RideConstructNew(RideSelection listItem) { - const auto& ted = GetTrackElementDescriptor(trackType); - if (!IsTrackEnabled(ted.Definition.Type)) - continue; - bool entryIsDisabled; + int32_t rideEntryIndex = RideGetEntryIndex(listItem.Type, listItem.EntryIndex); + int32_t colour1 = RideGetRandomColourPresetIndex(listItem.Type); + int32_t colour2 = RideGetUnusedPresetVehicleColour(rideEntryIndex); - // If the current build orientation (slope, bank, diagonal) matches the track element's, show the piece as enabled - if (state == RideConstructionState::Back) - { - entryIsDisabled = ted.Definition.PitchEnd != buildSlope || ted.Definition.RollEnd != buildBank - || TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_end) != buildDirectionIsDiagonal; - } - else - { - entryIsDisabled = ted.Definition.PitchStart != buildSlope || ted.Definition.RollStart != buildBank - || TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_begin) != buildDirectionIsDiagonal; - } + auto gameAction = RideCreateAction( + listItem.Type, listItem.EntryIndex, colour1, colour2, OpenRCT2::GetGameState().LastEntranceStyle); - // Additional tower bases can only be built if the ride allows for it (elevator) - if (trackType == TrackElemType::TowerBase - && !currentRide.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES)) - entryIsDisabled = true; + gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + return; + const auto rideIndex = result->GetData(); + auto ride = GetRide(rideIndex); + RideConstructionStart(*ride); + }); - // Check if a previous element exists, to collate entries if possible - if (!list.Elements.empty() && GetTrackElementDescriptor(list.Elements.back().TrackType).Description == ted.Description) - { - // If the current element is disabled, do not add current element. - if (entryIsDisabled) - continue; - auto& lastElement = list.Elements.back(); - // If the previous element is disabled and current element is enabled, replace the previous element - if (lastElement.Disabled && !entryIsDisabled) - { - lastElement.TrackType = trackType; - lastElement.Disabled = false; - list.HasActiveElements = true; - continue; - } - // If the previous element and current element are enabled, add both to the list - } - list.Elements.push_back({ trackType, entryIsDisabled }); - list.HasActiveElements |= !entryIsDisabled; + GameActions::Execute(&gameAction); } - return list; -} + + SpecialElementsDropdownState BuildSpecialElementsList( + const Ride& currentRide, uint8_t buildDirection, TrackPitch buildSlope, TrackRoll buildBank, + RideConstructionState state) + { + auto buildDirectionIsDiagonal = TrackPieceDirectionIsDiagonal(buildDirection); + SpecialElementsDropdownState list; + + // if it's building neither forwards nor backwards, no list is available + if (state != RideConstructionState::Front && state != RideConstructionState::Place + && state != RideConstructionState::Back) + return list; + + for (track_type_t trackType : DropdownOrder) + { + const auto& ted = GetTrackElementDescriptor(trackType); + if (!IsTrackEnabled(ted.Definition.Type)) + continue; + bool entryIsDisabled; + + // If the current build orientation (slope, bank, diagonal) matches the track element's, show the piece as enabled + if (state == RideConstructionState::Back) + { + entryIsDisabled = ted.Definition.PitchEnd != buildSlope || ted.Definition.RollEnd != buildBank + || TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_end) != buildDirectionIsDiagonal; + } + else + { + entryIsDisabled = ted.Definition.PitchStart != buildSlope || ted.Definition.RollStart != buildBank + || TrackPieceDirectionIsDiagonal(ted.Coordinates.rotation_begin) != buildDirectionIsDiagonal; + } + + // Additional tower bases can only be built if the ride allows for it (elevator) + if (trackType == TrackElemType::TowerBase + && !currentRide.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES)) + entryIsDisabled = true; + + // Check if a previous element exists, to collate entries if possible + if (!list.Elements.empty() + && GetTrackElementDescriptor(list.Elements.back().TrackType).Description == ted.Description) + { + // If the current element is disabled, do not add current element. + if (entryIsDisabled) + continue; + auto& lastElement = list.Elements.back(); + // If the previous element is disabled and current element is enabled, replace the previous element + if (lastElement.Disabled && !entryIsDisabled) + { + lastElement.TrackType = trackType; + lastElement.Disabled = false; + list.HasActiveElements = true; + continue; + } + // If the previous element and current element are enabled, add both to the list + } + list.Elements.push_back({ trackType, entryIsDisabled }); + list.HasActiveElements |= !entryIsDisabled; + } + return list; + } +} // namespace OpenRCT2 diff --git a/src/openrct2-ui/ride/Construction.h b/src/openrct2-ui/ride/Construction.h index f8149a79ef..63415e2325 100644 --- a/src/openrct2-ui/ride/Construction.h +++ b/src/openrct2-ui/ride/Construction.h @@ -12,153 +12,157 @@ #include #include -enum class RideConstructionState : uint8_t; - -/** - * Order of special track elements dropdown. Elements with the same name string must be sequential or they show up twice. - */ -constexpr std::array DropdownOrder = { - TrackElemType::EndStation, - TrackElemType::SBendLeft, - TrackElemType::SBendRight, - TrackElemType::LeftVerticalLoop, - TrackElemType::RightVerticalLoop, - TrackElemType::LeftTwistDownToUp, - TrackElemType::LeftTwistUpToDown, - TrackElemType::RightTwistDownToUp, - TrackElemType::RightTwistUpToDown, - TrackElemType::HalfLoopUp, - TrackElemType::HalfLoopDown, - TrackElemType::LeftCorkscrewUp, - TrackElemType::LeftCorkscrewDown, - TrackElemType::RightCorkscrewUp, - TrackElemType::RightCorkscrewDown, - TrackElemType::TowerBase, - TrackElemType::TowerSection, - TrackElemType::LeftHalfBankedHelixUpSmall, - TrackElemType::RightHalfBankedHelixUpSmall, - TrackElemType::LeftHalfBankedHelixDownSmall, - TrackElemType::RightHalfBankedHelixDownSmall, - TrackElemType::LeftHalfBankedHelixUpLarge, - TrackElemType::RightHalfBankedHelixUpLarge, - TrackElemType::LeftHalfBankedHelixDownLarge, - TrackElemType::RightHalfBankedHelixDownLarge, - TrackElemType::Booster, - TrackElemType::Brakes, - TrackElemType::DiagBrakes, - TrackElemType::OnRidePhoto, - TrackElemType::LeftQuarterBankedHelixLargeUp, - TrackElemType::RightQuarterBankedHelixLargeUp, - TrackElemType::LeftQuarterBankedHelixLargeDown, - TrackElemType::RightQuarterBankedHelixLargeDown, - TrackElemType::LeftQuarterHelixLargeUp, - TrackElemType::RightQuarterHelixLargeUp, - TrackElemType::LeftQuarterHelixLargeDown, - TrackElemType::RightQuarterHelixLargeDown, - TrackElemType::Waterfall, - TrackElemType::Rapids, - TrackElemType::Watersplash, - TrackElemType::Whirlpool, - TrackElemType::CableLiftHill, - TrackElemType::ReverseFreefallSlope, - TrackElemType::ReverseFreefallVertical, - TrackElemType::BrakeForDrop, - TrackElemType::LogFlumeReverser, - TrackElemType::SpinningTunnel, - TrackElemType::LeftBarrelRollUpToDown, - TrackElemType::LeftBarrelRollDownToUp, - TrackElemType::RightBarrelRollUpToDown, - TrackElemType::RightBarrelRollDownToUp, - TrackElemType::PoweredLift, - TrackElemType::LeftLargeHalfLoopUp, - TrackElemType::LeftLargeHalfLoopDown, - TrackElemType::RightLargeHalfLoopUp, - TrackElemType::RightLargeHalfLoopDown, - TrackElemType::LeftFlyerTwistUp, - TrackElemType::LeftFlyerTwistDown, - TrackElemType::RightFlyerTwistUp, - TrackElemType::RightFlyerTwistDown, - TrackElemType::FlyerHalfLoopUninvertedUp, - TrackElemType::FlyerHalfLoopInvertedDown, - TrackElemType::FlyerHalfLoopInvertedUp, - TrackElemType::FlyerHalfLoopUninvertedDown, - TrackElemType::LeftFlyerCorkscrewUp, - TrackElemType::LeftFlyerCorkscrewDown, - TrackElemType::RightFlyerCorkscrewUp, - TrackElemType::RightFlyerCorkscrewDown, - TrackElemType::HeartLineTransferUp, - TrackElemType::HeartLineTransferDown, - TrackElemType::LeftHeartLineRoll, - TrackElemType::RightHeartLineRoll, - TrackElemType::MinigolfHoleA, - TrackElemType::MinigolfHoleB, - TrackElemType::MinigolfHoleC, - TrackElemType::MinigolfHoleD, - TrackElemType::MinigolfHoleE, - TrackElemType::MultiDimInvertedFlatToDown90QuarterLoop, - TrackElemType::Up90ToInvertedFlatQuarterLoop, - TrackElemType::InvertedFlatToDown90QuarterLoop, - TrackElemType::MultiDimUp90ToInvertedFlatQuarterLoop, - TrackElemType::MultiDimFlatToDown90QuarterLoop, - TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop, - TrackElemType::LeftCurvedLiftHill, - TrackElemType::RightCurvedLiftHill, - TrackElemType::LeftReverser, - TrackElemType::RightReverser, - TrackElemType::AirThrustTopCap, - TrackElemType::AirThrustVerticalDown, - TrackElemType::AirThrustVerticalDownToLevel, - TrackElemType::BlockBrakes, - TrackElemType::DiagBlockBrakes, - TrackElemType::RotationControlToggle, - TrackElemType::LeftLargeCorkscrewUp, - TrackElemType::LeftLargeCorkscrewDown, - TrackElemType::RightLargeCorkscrewUp, - TrackElemType::RightLargeCorkscrewDown, - TrackElemType::LeftMediumHalfLoopUp, - TrackElemType::LeftMediumHalfLoopDown, - TrackElemType::RightMediumHalfLoopUp, - TrackElemType::RightMediumHalfLoopDown, - TrackElemType::LeftZeroGRollUp, - TrackElemType::LeftZeroGRollDown, - TrackElemType::RightZeroGRollUp, - TrackElemType::RightZeroGRollDown, - TrackElemType::LeftLargeZeroGRollUp, - TrackElemType::LeftLargeZeroGRollDown, - TrackElemType::RightLargeZeroGRollUp, - TrackElemType::RightLargeZeroGRollDown, - TrackElemType::LeftFlyerLargeHalfLoopUninvertedUp, - TrackElemType::LeftFlyerLargeHalfLoopInvertedDown, - TrackElemType::LeftFlyerLargeHalfLoopInvertedUp, - TrackElemType::LeftFlyerLargeHalfLoopUninvertedDown, - TrackElemType::RightFlyerLargeHalfLoopUninvertedUp, - TrackElemType::RightFlyerLargeHalfLoopInvertedDown, - TrackElemType::RightFlyerLargeHalfLoopInvertedUp, - TrackElemType::RightFlyerLargeHalfLoopUninvertedDown, -}; -constexpr size_t DropdownLength = DropdownOrder.size(); - -// Update the magic number with the current number of track elements to silence -static_assert(TrackElemType::Count == 339, "Reminder to add new track element to special dropdown list"); - -constexpr bool TrackPieceDirectionIsDiagonal(const uint8_t direction) +namespace OpenRCT2 { - return direction >= kNumOrthogonalDirections; -} + enum class RideConstructionState : uint8_t; -struct SpecialElement -{ - track_type_t TrackType; - bool Disabled; -}; + /** + * Order of special track elements dropdown. Elements with the same name string must be sequential or they show up twice. + */ + constexpr std::array DropdownOrder = { + TrackElemType::EndStation, + TrackElemType::SBendLeft, + TrackElemType::SBendRight, + TrackElemType::LeftVerticalLoop, + TrackElemType::RightVerticalLoop, + TrackElemType::LeftTwistDownToUp, + TrackElemType::LeftTwistUpToDown, + TrackElemType::RightTwistDownToUp, + TrackElemType::RightTwistUpToDown, + TrackElemType::HalfLoopUp, + TrackElemType::HalfLoopDown, + TrackElemType::LeftCorkscrewUp, + TrackElemType::LeftCorkscrewDown, + TrackElemType::RightCorkscrewUp, + TrackElemType::RightCorkscrewDown, + TrackElemType::TowerBase, + TrackElemType::TowerSection, + TrackElemType::LeftHalfBankedHelixUpSmall, + TrackElemType::RightHalfBankedHelixUpSmall, + TrackElemType::LeftHalfBankedHelixDownSmall, + TrackElemType::RightHalfBankedHelixDownSmall, + TrackElemType::LeftHalfBankedHelixUpLarge, + TrackElemType::RightHalfBankedHelixUpLarge, + TrackElemType::LeftHalfBankedHelixDownLarge, + TrackElemType::RightHalfBankedHelixDownLarge, + TrackElemType::Booster, + TrackElemType::Brakes, + TrackElemType::DiagBrakes, + TrackElemType::OnRidePhoto, + TrackElemType::LeftQuarterBankedHelixLargeUp, + TrackElemType::RightQuarterBankedHelixLargeUp, + TrackElemType::LeftQuarterBankedHelixLargeDown, + TrackElemType::RightQuarterBankedHelixLargeDown, + TrackElemType::LeftQuarterHelixLargeUp, + TrackElemType::RightQuarterHelixLargeUp, + TrackElemType::LeftQuarterHelixLargeDown, + TrackElemType::RightQuarterHelixLargeDown, + TrackElemType::Waterfall, + TrackElemType::Rapids, + TrackElemType::Watersplash, + TrackElemType::Whirlpool, + TrackElemType::CableLiftHill, + TrackElemType::ReverseFreefallSlope, + TrackElemType::ReverseFreefallVertical, + TrackElemType::BrakeForDrop, + TrackElemType::LogFlumeReverser, + TrackElemType::SpinningTunnel, + TrackElemType::LeftBarrelRollUpToDown, + TrackElemType::LeftBarrelRollDownToUp, + TrackElemType::RightBarrelRollUpToDown, + TrackElemType::RightBarrelRollDownToUp, + TrackElemType::PoweredLift, + TrackElemType::LeftLargeHalfLoopUp, + TrackElemType::LeftLargeHalfLoopDown, + TrackElemType::RightLargeHalfLoopUp, + TrackElemType::RightLargeHalfLoopDown, + TrackElemType::LeftFlyerTwistUp, + TrackElemType::LeftFlyerTwistDown, + TrackElemType::RightFlyerTwistUp, + TrackElemType::RightFlyerTwistDown, + TrackElemType::FlyerHalfLoopUninvertedUp, + TrackElemType::FlyerHalfLoopInvertedDown, + TrackElemType::FlyerHalfLoopInvertedUp, + TrackElemType::FlyerHalfLoopUninvertedDown, + TrackElemType::LeftFlyerCorkscrewUp, + TrackElemType::LeftFlyerCorkscrewDown, + TrackElemType::RightFlyerCorkscrewUp, + TrackElemType::RightFlyerCorkscrewDown, + TrackElemType::HeartLineTransferUp, + TrackElemType::HeartLineTransferDown, + TrackElemType::LeftHeartLineRoll, + TrackElemType::RightHeartLineRoll, + TrackElemType::MinigolfHoleA, + TrackElemType::MinigolfHoleB, + TrackElemType::MinigolfHoleC, + TrackElemType::MinigolfHoleD, + TrackElemType::MinigolfHoleE, + TrackElemType::MultiDimInvertedFlatToDown90QuarterLoop, + TrackElemType::Up90ToInvertedFlatQuarterLoop, + TrackElemType::InvertedFlatToDown90QuarterLoop, + TrackElemType::MultiDimUp90ToInvertedFlatQuarterLoop, + TrackElemType::MultiDimFlatToDown90QuarterLoop, + TrackElemType::MultiDimInvertedUp90ToFlatQuarterLoop, + TrackElemType::LeftCurvedLiftHill, + TrackElemType::RightCurvedLiftHill, + TrackElemType::LeftReverser, + TrackElemType::RightReverser, + TrackElemType::AirThrustTopCap, + TrackElemType::AirThrustVerticalDown, + TrackElemType::AirThrustVerticalDownToLevel, + TrackElemType::BlockBrakes, + TrackElemType::DiagBlockBrakes, + TrackElemType::RotationControlToggle, + TrackElemType::LeftLargeCorkscrewUp, + TrackElemType::LeftLargeCorkscrewDown, + TrackElemType::RightLargeCorkscrewUp, + TrackElemType::RightLargeCorkscrewDown, + TrackElemType::LeftMediumHalfLoopUp, + TrackElemType::LeftMediumHalfLoopDown, + TrackElemType::RightMediumHalfLoopUp, + TrackElemType::RightMediumHalfLoopDown, + TrackElemType::LeftZeroGRollUp, + TrackElemType::LeftZeroGRollDown, + TrackElemType::RightZeroGRollUp, + TrackElemType::RightZeroGRollDown, + TrackElemType::LeftLargeZeroGRollUp, + TrackElemType::LeftLargeZeroGRollDown, + TrackElemType::RightLargeZeroGRollUp, + TrackElemType::RightLargeZeroGRollDown, + TrackElemType::LeftFlyerLargeHalfLoopUninvertedUp, + TrackElemType::LeftFlyerLargeHalfLoopInvertedDown, + TrackElemType::LeftFlyerLargeHalfLoopInvertedUp, + TrackElemType::LeftFlyerLargeHalfLoopUninvertedDown, + TrackElemType::RightFlyerLargeHalfLoopUninvertedUp, + TrackElemType::RightFlyerLargeHalfLoopInvertedDown, + TrackElemType::RightFlyerLargeHalfLoopInvertedUp, + TrackElemType::RightFlyerLargeHalfLoopUninvertedDown, + }; + constexpr size_t DropdownLength = DropdownOrder.size(); -struct SpecialElementsDropdownState -{ - bool HasActiveElements = false; - std::vector Elements{}; -}; + // Update the magic number with the current number of track elements to silence + static_assert(TrackElemType::Count == 339, "Reminder to add new track element to special dropdown list"); -SpecialElementsDropdownState BuildSpecialElementsList( - const Ride& currentRide, uint8_t buildDirection, TrackPitch buildSlope, TrackRoll buildBank, RideConstructionState state); + constexpr bool TrackPieceDirectionIsDiagonal(const uint8_t direction) + { + return direction >= kNumOrthogonalDirections; + } -void RideConstructNew(RideSelection listItem); + struct SpecialElement + { + track_type_t TrackType; + bool Disabled; + }; + + struct SpecialElementsDropdownState + { + bool HasActiveElements = false; + std::vector Elements{}; + }; + + SpecialElementsDropdownState BuildSpecialElementsList( + const Ride& currentRide, uint8_t buildDirection, TrackPitch buildSlope, TrackRoll buildBank, + RideConstructionState state); + + void RideConstructNew(RideSelection listItem); +} // namespace OpenRCT2 diff --git a/src/openrct2-ui/scripting/ScTitleSequence.hpp b/src/openrct2-ui/scripting/ScTitleSequence.hpp index d9e8a8b0d3..7b91d16d60 100644 --- a/src/openrct2-ui/scripting/ScTitleSequence.hpp +++ b/src/openrct2-ui/scripting/ScTitleSequence.hpp @@ -365,7 +365,7 @@ namespace OpenRCT2::Scripting const auto* item = GetItem(); if (item != nullptr) { - return item->PredefinedIndex != PREDEFINED_INDEX_CUSTOM; + return item->PredefinedIndex != TitleSequenceManager::kPredefinedIndexCustom; } return {}; } @@ -545,7 +545,7 @@ namespace OpenRCT2::Scripting return std::nullopt; } - const TitleSequenceManagerItem* GetItem() const + const TitleSequenceManager::Item* GetItem() const { auto index = GetManagerIndex(); if (index) diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 0539932a93..f594ee4e38 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -1739,11 +1739,11 @@ static Widget *window_options_page_widgets[] = { { case WIDX_TITLE_SEQUENCE_DROPDOWN: { - uint32_t numItems = static_cast(TitleSequenceManagerGetCount()); + uint32_t numItems = static_cast(TitleSequenceManager::GetCount()); for (size_t i = 0; i < numItems; i++) { gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItems[i].Args = reinterpret_cast(TitleSequenceManagerGetName(i)); + gDropdownItems[i].Args = reinterpret_cast(TitleSequenceManager::GetName(i)); } gDropdownItems[numItems].Format = 0; @@ -1797,7 +1797,7 @@ static Widget *window_options_page_widgets[] = { { case WIDX_TITLE_SEQUENCE_DROPDOWN: { - auto numItems = static_cast(TitleSequenceManagerGetCount()); + auto numItems = static_cast(TitleSequenceManager::GetCount()); if (dropdownIndex < numItems && dropdownIndex != static_cast(TitleGetCurrentSequence())) { Config::Get().interface.RandomTitleSequence = false; @@ -1843,7 +1843,7 @@ static Widget *window_options_page_widgets[] = { } else { - auto name = TitleSequenceManagerGetName(TitleGetConfigSequence()); + auto name = TitleSequenceManager::GetName(TitleGetConfigSequence()); ft.Add(STR_STRING); ft.Add(name); } diff --git a/src/openrct2-win/openrct2-win.cpp b/src/openrct2-win/openrct2-win.cpp index a93c82c89d..3222618cde 100644 --- a/src/openrct2-win/openrct2-win.cpp +++ b/src/openrct2-win/openrct2-win.cpp @@ -25,6 +25,8 @@ #include #include +using namespace OpenRCT2; + static std::vector GetCommandLineArgs(int argc, wchar_t** argvW); /** diff --git a/src/openrct2/CommandLineSprite.cpp b/src/openrct2/CommandLineSprite.cpp index 104b31757b..e9a185fe38 100644 --- a/src/openrct2/CommandLineSprite.cpp +++ b/src/openrct2/CommandLineSprite.cpp @@ -32,6 +32,7 @@ #include #include +using namespace OpenRCT2; using namespace OpenRCT2::Drawing; static int32_t CommandLineForSpriteCombine(const char** argv, int32_t argc); diff --git a/src/openrct2/Diagnostic.cpp b/src/openrct2/Diagnostic.cpp index c6554a0f26..93f757e018 100644 --- a/src/openrct2/Diagnostic.cpp +++ b/src/openrct2/Diagnostic.cpp @@ -20,6 +20,8 @@ # include #endif +using namespace OpenRCT2; + [[maybe_unused]] static bool _log_location_enabled = true; bool _log_levels[EnumValue(DiagnosticLevel::Count)] = { true, true, true, false, true, diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 104ea85f2d..b78808aae6 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -53,7 +53,7 @@ using namespace OpenRCT2; -namespace Editor +namespace OpenRCT2::Editor { static std::array, EnumValue(ObjectType::Count)> _editorSelectedObjectFlags; @@ -530,7 +530,7 @@ namespace Editor list[index] |= flags; } } -} // namespace Editor +} // namespace OpenRCT2::Editor void EditorOpenWindowsForCurrentStep() { diff --git a/src/openrct2/Editor.h b/src/openrct2/Editor.h index 0d4fd571a7..a1c200f953 100644 --- a/src/openrct2/Editor.h +++ b/src/openrct2/Editor.h @@ -13,7 +13,7 @@ struct ResultWithMessage; -namespace Editor +namespace OpenRCT2::Editor { void Load(); void ConvertSaveToScenario(); @@ -29,7 +29,7 @@ namespace Editor uint8_t GetSelectedObjectFlags(ObjectType objectType, size_t index); void ClearSelectedObject(ObjectType objectType, size_t index, uint32_t flags); void SetSelectedObject(ObjectType objectType, size_t index, uint32_t flags); -} // namespace Editor +} // namespace OpenRCT2::Editor enum class EditorStep : uint8_t { diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 20a172465f..e25580571c 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -34,6 +34,8 @@ #include #include +using namespace OpenRCT2; + std::optional _gSceneryGroupPartialSelectError; std::vector _objectSelectionFlags; uint32_t _numSelectedObjectsForType[EnumValue(ObjectType::Count)]; diff --git a/src/openrct2/FileClassifier.cpp b/src/openrct2/FileClassifier.cpp index 3b3ff5f774..7760afa296 100644 --- a/src/openrct2/FileClassifier.cpp +++ b/src/openrct2/FileClassifier.cpp @@ -20,6 +20,8 @@ #include "scenario/Scenario.h" #include "util/SawyerCoding.h" +using namespace OpenRCT2; + static bool TryClassifyAsPark(OpenRCT2::IStream* stream, ClassifiedFileInfo* result); static bool TryClassifyAsS6(OpenRCT2::IStream* stream, ClassifiedFileInfo* result); static bool TryClassifyAsS4(OpenRCT2::IStream* stream, ClassifiedFileInfo* result); diff --git a/src/openrct2/ParkImporter.cpp b/src/openrct2/ParkImporter.cpp index 42d27de24d..590a7b7e9e 100644 --- a/src/openrct2/ParkImporter.cpp +++ b/src/openrct2/ParkImporter.cpp @@ -17,7 +17,7 @@ #include -namespace ParkImporter +namespace OpenRCT2::ParkImporter { std::unique_ptr Create(const std::string& hintPath) { @@ -53,4 +53,4 @@ namespace ParkImporter { return String::IEquals(extension, ".sc4") || String::IEquals(extension, ".sc6") || String::IEquals(extension, ".sea"); } -} // namespace ParkImporter +} // namespace OpenRCT2::ParkImporter diff --git a/src/openrct2/ParkImporter.h b/src/openrct2/ParkImporter.h index 5f41f93884..db247ee44c 100644 --- a/src/openrct2/ParkImporter.h +++ b/src/openrct2/ParkImporter.h @@ -61,7 +61,7 @@ public: virtual bool GetDetails(ScenarioIndexEntry* dst) = 0; }; -namespace ParkImporter +namespace OpenRCT2::ParkImporter { [[nodiscard]] std::unique_ptr Create(const std::string& hintPath); [[nodiscard]] std::unique_ptr CreateS4(); @@ -71,7 +71,7 @@ namespace ParkImporter bool ExtensionIsOpenRCT2ParkFile(std::string_view extension); bool ExtensionIsRCT1(std::string_view extension); bool ExtensionIsScenario(std::string_view extension); -} // namespace ParkImporter +} // namespace OpenRCT2::ParkImporter class ObjectLoadException : public std::exception { diff --git a/src/openrct2/TrackImporter.cpp b/src/openrct2/TrackImporter.cpp index 5366f40ffe..74af4fd35a 100644 --- a/src/openrct2/TrackImporter.cpp +++ b/src/openrct2/TrackImporter.cpp @@ -14,7 +14,7 @@ #include -namespace TrackImporter +namespace OpenRCT2::TrackImporter { std::unique_ptr Create(const std::string& hintPath) { @@ -35,4 +35,4 @@ namespace TrackImporter { return String::IEquals(extension, ".td4"); } -} // namespace TrackImporter +} // namespace OpenRCT2::TrackImporter diff --git a/src/openrct2/TrackImporter.h b/src/openrct2/TrackImporter.h index 9b72c25b73..7385742305 100644 --- a/src/openrct2/TrackImporter.h +++ b/src/openrct2/TrackImporter.h @@ -30,11 +30,11 @@ public: [[nodiscard]] virtual std::unique_ptr Import() = 0; }; -namespace TrackImporter +namespace OpenRCT2::TrackImporter { [[nodiscard]] std::unique_ptr Create(const std::string& hintPath); [[nodiscard]] std::unique_ptr CreateTD4(); [[nodiscard]] std::unique_ptr CreateTD6(); bool ExtensionIsRCT1(const std::string& extension); -} // namespace TrackImporter +} // namespace OpenRCT2::TrackImporter diff --git a/src/openrct2/actions/BalloonPressAction.cpp b/src/openrct2/actions/BalloonPressAction.cpp index 2d5b9332f3..1f6ed0b8ea 100644 --- a/src/openrct2/actions/BalloonPressAction.cpp +++ b/src/openrct2/actions/BalloonPressAction.cpp @@ -14,6 +14,8 @@ #include "../entity/EntityRegistry.h" #include "GameAction.h" +using namespace OpenRCT2; + BalloonPressAction::BalloonPressAction(EntityId spriteIndex) : _spriteIndex(spriteIndex) { diff --git a/src/openrct2/actions/BalloonPressAction.h b/src/openrct2/actions/BalloonPressAction.h index 4e2a47acdc..6fd8eacf1f 100644 --- a/src/openrct2/actions/BalloonPressAction.h +++ b/src/openrct2/actions/BalloonPressAction.h @@ -25,6 +25,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/BannerPlaceAction.h b/src/openrct2/actions/BannerPlaceAction.h index be30479f23..e543e99006 100644 --- a/src/openrct2/actions/BannerPlaceAction.h +++ b/src/openrct2/actions/BannerPlaceAction.h @@ -32,8 +32,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: PathElement* GetValidPathElement() const; diff --git a/src/openrct2/actions/BannerRemoveAction.h b/src/openrct2/actions/BannerRemoveAction.h index 2aafda10c3..b28ea2b7dc 100644 --- a/src/openrct2/actions/BannerRemoveAction.h +++ b/src/openrct2/actions/BannerRemoveAction.h @@ -25,8 +25,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: BannerElement* GetBannerElementAt() const; diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index e52eab5baf..cbb562f1a3 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -16,6 +16,8 @@ #include "../world/Banner.h" #include "GameAction.h" +using namespace OpenRCT2; + BannerSetColourAction::BannerSetColourAction(const CoordsXYZD& loc, uint8_t primaryColour) : _loc(loc) , _primaryColour(primaryColour) diff --git a/src/openrct2/actions/BannerSetColourAction.h b/src/openrct2/actions/BannerSetColourAction.h index dc4642b895..5b22269dc3 100644 --- a/src/openrct2/actions/BannerSetColourAction.h +++ b/src/openrct2/actions/BannerSetColourAction.h @@ -26,9 +26,9 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; }; diff --git a/src/openrct2/actions/BannerSetNameAction.cpp b/src/openrct2/actions/BannerSetNameAction.cpp index 5037375860..6859eb183b 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -19,6 +19,8 @@ #include "../world/Banner.h" #include "GameAction.h" +using namespace OpenRCT2; + BannerSetNameAction::BannerSetNameAction(BannerIndex bannerIndex, const std::string& name) : _bannerIndex(bannerIndex) , _name(name) diff --git a/src/openrct2/actions/BannerSetNameAction.h b/src/openrct2/actions/BannerSetNameAction.h index e92819c537..41922a6bf0 100644 --- a/src/openrct2/actions/BannerSetNameAction.h +++ b/src/openrct2/actions/BannerSetNameAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 7239bef430..18225ca1d8 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -17,6 +17,8 @@ #include "../world/Banner.h" #include "GameAction.h" +using namespace OpenRCT2; + BannerSetStyleAction::BannerSetStyleAction(BannerSetStyleType type, BannerIndex bannerIndex, uint8_t parameter) : _type(type) , _bannerIndex(bannerIndex) diff --git a/src/openrct2/actions/BannerSetStyleAction.h b/src/openrct2/actions/BannerSetStyleAction.h index 640fb075e3..bc4b16bdb8 100644 --- a/src/openrct2/actions/BannerSetStyleAction.h +++ b/src/openrct2/actions/BannerSetStyleAction.h @@ -37,6 +37,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/CheatSetAction.h b/src/openrct2/actions/CheatSetAction.h index f6d6d0c449..b0ff9c1084 100644 --- a/src/openrct2/actions/CheatSetAction.h +++ b/src/openrct2/actions/CheatSetAction.h @@ -29,8 +29,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: ParametersRange GetParameterRange(CheatType cheatType) const; diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index b079f08374..a334aae4ee 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -22,6 +22,8 @@ #include "SmallSceneryRemoveAction.h" #include "WallRemoveAction.h" +using namespace OpenRCT2; + ClearAction::ClearAction(MapRange range, ClearableItems itemsToClear) : _range(range) , _itemsToClear(itemsToClear) diff --git a/src/openrct2/actions/ClearAction.h b/src/openrct2/actions/ClearAction.h index 875840e935..1619269521 100644 --- a/src/openrct2/actions/ClearAction.h +++ b/src/openrct2/actions/ClearAction.h @@ -13,16 +13,14 @@ #include "../management/Finance.h" #include "GameAction.h" -using namespace OpenRCT2; - using ClearableItems = uint8_t; -namespace CLEARABLE_ITEMS +namespace OpenRCT2::CLEARABLE_ITEMS { constexpr ClearableItems SCENERY_SMALL = 1 << 0; constexpr ClearableItems SCENERY_LARGE = 1 << 1; constexpr ClearableItems SCENERY_FOOTPATH = 1 << 2; -} // namespace CLEARABLE_ITEMS +} // namespace OpenRCT2::CLEARABLE_ITEMS class ClearAction final : public GameActionBase { @@ -39,12 +37,12 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result CreateResult() const; - GameActions::Result QueryExecute(bool executing) const; + OpenRCT2::GameActions::Result CreateResult() const; + OpenRCT2::GameActions::Result QueryExecute(bool executing) const; money64 ClearSceneryFromTile(const CoordsXY& tilePos, bool executing) const; /** diff --git a/src/openrct2/actions/ClimateSetAction.cpp b/src/openrct2/actions/ClimateSetAction.cpp index 2d8ae45d77..4dabe11b0e 100644 --- a/src/openrct2/actions/ClimateSetAction.cpp +++ b/src/openrct2/actions/ClimateSetAction.cpp @@ -12,6 +12,8 @@ #include "../Diagnostic.h" #include "../GameState.h" +using namespace OpenRCT2; + ClimateSetAction::ClimateSetAction(ClimateType climate) : _climate(climate) { diff --git a/src/openrct2/actions/ClimateSetAction.h b/src/openrct2/actions/ClimateSetAction.h index 0a1db89c16..39f5664407 100644 --- a/src/openrct2/actions/ClimateSetAction.h +++ b/src/openrct2/actions/ClimateSetAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/CustomAction.cpp b/src/openrct2/actions/CustomAction.cpp index 887b28ba64..922bf8ab67 100644 --- a/src/openrct2/actions/CustomAction.cpp +++ b/src/openrct2/actions/CustomAction.cpp @@ -13,6 +13,8 @@ # include "../Context.h" # include "../scripting/ScriptEngine.h" +using namespace OpenRCT2; + CustomAction::CustomAction(const std::string& id, const std::string& json, const std::string& pluginName) : _id(id) , _json(json) diff --git a/src/openrct2/actions/CustomAction.h b/src/openrct2/actions/CustomAction.h index a4778fd3d4..eb44d92d5e 100644 --- a/src/openrct2/actions/CustomAction.h +++ b/src/openrct2/actions/CustomAction.h @@ -31,8 +31,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; #endif diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 029a16c2d3..f5e79e09a4 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -25,6 +25,8 @@ #include "../world/Scenery.h" #include "../world/Wall.h" +using namespace OpenRCT2; + FootpathAdditionPlaceAction::FootpathAdditionPlaceAction(const CoordsXYZ& loc, ObjectEntryIndex pathItemType) : _loc(loc) , _entryIndex(pathItemType) diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.h b/src/openrct2/actions/FootpathAdditionPlaceAction.h index 1d78f786aa..1edcfd3005 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.h +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index 49fc8fbf2d..71ab50eb27 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -22,6 +22,8 @@ #include "../world/Park.h" #include "../world/Wall.h" +using namespace OpenRCT2; + FootpathAdditionRemoveAction::FootpathAdditionRemoveAction(const CoordsXYZ& loc) : _loc(loc) { diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.h b/src/openrct2/actions/FootpathAdditionRemoveAction.h index 2afb27aab2..ce660ec543 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.h +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.h @@ -25,6 +25,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/FootpathLayoutPlaceAction.h b/src/openrct2/actions/FootpathLayoutPlaceAction.h index 8a60e5591e..130c540f22 100644 --- a/src/openrct2/actions/FootpathLayoutPlaceAction.h +++ b/src/openrct2/actions/FootpathLayoutPlaceAction.h @@ -32,11 +32,11 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result ElementInsertQuery(GameActions::Result res) const; - GameActions::Result ElementInsertExecute(GameActions::Result res) const; + OpenRCT2::GameActions::Result ElementInsertQuery(OpenRCT2::GameActions::Result res) const; + OpenRCT2::GameActions::Result ElementInsertExecute(OpenRCT2::GameActions::Result res) const; bool IsSameAsEntranceElement(const EntranceElement& entranceElement) const; }; diff --git a/src/openrct2/actions/FootpathPlaceAction.h b/src/openrct2/actions/FootpathPlaceAction.h index 0fb4bc796a..6d3e72cf1c 100644 --- a/src/openrct2/actions/FootpathPlaceAction.h +++ b/src/openrct2/actions/FootpathPlaceAction.h @@ -32,14 +32,14 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result ElementUpdateQuery(PathElement* pathElement, GameActions::Result res) const; - GameActions::Result ElementUpdateExecute(PathElement* pathElement, GameActions::Result res) const; - GameActions::Result ElementInsertQuery(GameActions::Result res) const; - GameActions::Result ElementInsertExecute(GameActions::Result res) const; + OpenRCT2::GameActions::Result ElementUpdateQuery(PathElement* pathElement, OpenRCT2::GameActions::Result res) const; + OpenRCT2::GameActions::Result ElementUpdateExecute(PathElement* pathElement, OpenRCT2::GameActions::Result res) const; + OpenRCT2::GameActions::Result ElementInsertQuery(OpenRCT2::GameActions::Result res) const; + OpenRCT2::GameActions::Result ElementInsertExecute(OpenRCT2::GameActions::Result res) const; void AutomaticallySetPeepSpawn() const; void RemoveIntersectingWalls(PathElement* pathElement) const; PathElement* MapGetFootpathElementSlope(const CoordsXYZ& footpathPos, int32_t slope) const; diff --git a/src/openrct2/actions/FootpathRemoveAction.h b/src/openrct2/actions/FootpathRemoveAction.h index 418ecc546d..8fba1e7185 100644 --- a/src/openrct2/actions/FootpathRemoveAction.h +++ b/src/openrct2/actions/FootpathRemoveAction.h @@ -26,11 +26,11 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: TileElement* GetFootpathElement() const; money64 GetRefundPrice(TileElement* footpathElement) const; - GameActions::Result RemoveBannersAtElement(const CoordsXY& loc, TileElement* tileElement) const; + OpenRCT2::GameActions::Result RemoveBannersAtElement(const CoordsXY& loc, TileElement* tileElement) const; }; diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 35c7e44439..5d4dfa72a3 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -34,7 +34,7 @@ using namespace OpenRCT2; -namespace GameActions +namespace OpenRCT2::GameActions { struct QueuedGameAction { @@ -467,7 +467,7 @@ namespace GameActions { return ExecuteInternal(action, false); } -} // namespace GameActions +} // namespace OpenRCT2::GameActions const char* GameAction::GetName() const { diff --git a/src/openrct2/actions/GameAction.h b/src/openrct2/actions/GameAction.h index 3c3079924f..2531d45273 100644 --- a/src/openrct2/actions/GameAction.h +++ b/src/openrct2/actions/GameAction.h @@ -20,7 +20,7 @@ #include #include -namespace GameActions +namespace OpenRCT2::GameActions { namespace Flags { @@ -30,7 +30,7 @@ namespace GameActions constexpr uint16_t IgnoreForReplays = 1 << 3; } // namespace Flags -} // namespace GameActions +} // namespace OpenRCT2::GameActions #ifdef __WARN_SUGGEST_FINAL_METHODS__ # pragma GCC diagnostic push @@ -112,7 +112,7 @@ class GameAction { public: using Ptr = std::unique_ptr; - using Callback_t = std::function; + using Callback_t = std::function; private: GameCommand const _type; @@ -152,7 +152,7 @@ public: } /** - * Gets the GameActions::Flags flags that are enabled for this game action. + * Gets the OpenRCT2::GameActions::Flags flags that are enabled for this game action. */ virtual uint16_t GetActionFlags() const { @@ -161,12 +161,12 @@ public: if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) != 0 || (GetFlags() & GAME_COMMAND_FLAG_NO_SPEND) != 0) { - flags |= GameActions::Flags::ClientOnly; + flags |= OpenRCT2::GameActions::Flags::ClientOnly; } if (GetFlags() & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) { - flags |= GameActions::Flags::AllowWhilePaused; + flags |= OpenRCT2::GameActions::Flags::AllowWhilePaused; } return flags; @@ -233,12 +233,12 @@ public: /** * Query the result of the game action without changing the game state. */ - virtual GameActions::Result Query() const = 0; + virtual OpenRCT2::GameActions::Result Query() const = 0; /** * Apply the game action and change the game state. */ - virtual GameActions::Result Execute() const = 0; + virtual OpenRCT2::GameActions::Result Execute() const = 0; bool LocationValid(const CoordsXY& coords) const; }; @@ -262,7 +262,7 @@ public: } }; -namespace GameActions +namespace OpenRCT2::GameActions { using GameActionFactory = GameAction* (*)(); @@ -286,11 +286,11 @@ namespace GameActions GameAction::Ptr Clone(const GameAction* action); // This should be used if a round trip is to be expected. - GameActions::Result Query(const GameAction* action); - GameActions::Result Execute(const GameAction* action); + OpenRCT2::GameActions::Result Query(const GameAction* action); + OpenRCT2::GameActions::Result Execute(const GameAction* action); // This should be used from within game actions. - GameActions::Result QueryNested(const GameAction* action); - GameActions::Result ExecuteNested(const GameAction* action); + OpenRCT2::GameActions::Result QueryNested(const GameAction* action); + OpenRCT2::GameActions::Result ExecuteNested(const GameAction* action); -} // namespace GameActions +} // namespace OpenRCT2::GameActions diff --git a/src/openrct2/actions/GameActionRegistry.cpp b/src/openrct2/actions/GameActionRegistry.cpp index 83cd37b5fe..7b12548a9f 100644 --- a/src/openrct2/actions/GameActionRegistry.cpp +++ b/src/openrct2/actions/GameActionRegistry.cpp @@ -95,7 +95,9 @@ #include -namespace GameActions +using namespace OpenRCT2; + +namespace OpenRCT2::GameActions { struct GameActionEntry { @@ -255,4 +257,4 @@ namespace GameActions return false; } -} // namespace GameActions +} // namespace OpenRCT2::GameActions diff --git a/src/openrct2/actions/GameActionResult.cpp b/src/openrct2/actions/GameActionResult.cpp index 08c0a29503..cf1b4cb3af 100644 --- a/src/openrct2/actions/GameActionResult.cpp +++ b/src/openrct2/actions/GameActionResult.cpp @@ -6,7 +6,7 @@ using namespace OpenRCT2; -namespace GameActions +namespace OpenRCT2::GameActions { Result::Result(GameActions::Status error, StringId title, StringId message, uint8_t* args /*= nullptr*/) : Error(error) @@ -43,4 +43,4 @@ namespace GameActions return std::visit(StringVariantVisitor{ ErrorMessageArgs.data() }, ErrorMessage); } -} // namespace GameActions +} // namespace OpenRCT2::GameActions diff --git a/src/openrct2/actions/GameActionResult.h b/src/openrct2/actions/GameActionResult.h index 77dae0978b..cfe5e68c80 100644 --- a/src/openrct2/actions/GameActionResult.h +++ b/src/openrct2/actions/GameActionResult.h @@ -20,7 +20,7 @@ #include #include -namespace GameActions +namespace OpenRCT2::GameActions { /** * Common error codes for game actions. @@ -56,7 +56,7 @@ namespace GameActions public: using StringVariant = std::variant; - GameActions::Status Error = GameActions::Status::Ok; + OpenRCT2::GameActions::Status Error = OpenRCT2::GameActions::Status::Ok; StringVariant ErrorTitle = STR_NONE; StringVariant ErrorMessage = STR_NONE; std::array ErrorMessageArgs{}; @@ -74,7 +74,7 @@ namespace GameActions #endif Result() = default; - Result(GameActions::Status error, StringId title, StringId message, uint8_t* args = nullptr); + Result(OpenRCT2::GameActions::Status error, StringId title, StringId message, uint8_t* args = nullptr); std::string GetErrorTitle() const; std::string GetErrorMessage() const; @@ -102,4 +102,4 @@ namespace GameActions } }; -} // namespace GameActions +} // namespace OpenRCT2::GameActions diff --git a/src/openrct2/actions/GameSetSpeedAction.h b/src/openrct2/actions/GameSetSpeedAction.h index 36774321a5..2b1fe31bcb 100644 --- a/src/openrct2/actions/GameSetSpeedAction.h +++ b/src/openrct2/actions/GameSetSpeedAction.h @@ -25,8 +25,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: bool IsValidSpeed(int32_t speed) const; diff --git a/src/openrct2/actions/GuestSetFlagsAction.cpp b/src/openrct2/actions/GuestSetFlagsAction.cpp index 5d1b117847..4ca03ab9b7 100644 --- a/src/openrct2/actions/GuestSetFlagsAction.cpp +++ b/src/openrct2/actions/GuestSetFlagsAction.cpp @@ -14,6 +14,8 @@ #include "../OpenRCT2.h" #include "../entity/EntityRegistry.h" +using namespace OpenRCT2; + GuestSetFlagsAction::GuestSetFlagsAction(EntityId peepId, uint32_t flags) : _peepId(peepId) , _newFlags(flags) diff --git a/src/openrct2/actions/GuestSetFlagsAction.h b/src/openrct2/actions/GuestSetFlagsAction.h index 47c3307947..a4a4f48a45 100644 --- a/src/openrct2/actions/GuestSetFlagsAction.h +++ b/src/openrct2/actions/GuestSetFlagsAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index 88e0c3efab..a47ff275f0 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -20,6 +20,8 @@ #include "../windows/Intent.h" #include "../world/Park.h" +using namespace OpenRCT2; + GuestSetNameAction::GuestSetNameAction(EntityId spriteIndex, const std::string& name) : _spriteIndex(spriteIndex) , _name(name) diff --git a/src/openrct2/actions/GuestSetNameAction.h b/src/openrct2/actions/GuestSetNameAction.h index f888badeec..837b89a222 100644 --- a/src/openrct2/actions/GuestSetNameAction.h +++ b/src/openrct2/actions/GuestSetNameAction.h @@ -29,6 +29,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/LandBuyRightsAction.h b/src/openrct2/actions/LandBuyRightsAction.h index f3ab6f27f2..e7c2efa68d 100644 --- a/src/openrct2/actions/LandBuyRightsAction.h +++ b/src/openrct2/actions/LandBuyRightsAction.h @@ -39,10 +39,10 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; - GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const; }; diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 69151655b4..cae96d4096 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -26,6 +26,8 @@ #include "../world/SurfaceData.h" #include "../world/tile_element/Slope.h" +using namespace OpenRCT2; + LandLowerAction::LandLowerAction(const CoordsXY& coords, MapRange range, uint8_t selectionType) : _coords(coords) , _range(range) diff --git a/src/openrct2/actions/LandLowerAction.h b/src/openrct2/actions/LandLowerAction.h index cbc41eec25..2d7d48b3aa 100644 --- a/src/openrct2/actions/LandLowerAction.h +++ b/src/openrct2/actions/LandLowerAction.h @@ -27,9 +27,9 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; }; diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index b1a38e8528..b0c3efa34b 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -27,6 +27,8 @@ #include "../world/SurfaceData.h" #include "../world/tile_element/Slope.h" +using namespace OpenRCT2; + LandRaiseAction::LandRaiseAction(const CoordsXY& coords, MapRange range, uint8_t selectionType) : _coords(coords) , _range(range) diff --git a/src/openrct2/actions/LandRaiseAction.h b/src/openrct2/actions/LandRaiseAction.h index f9d33c806c..a70ac9e55c 100644 --- a/src/openrct2/actions/LandRaiseAction.h +++ b/src/openrct2/actions/LandRaiseAction.h @@ -27,9 +27,9 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; }; diff --git a/src/openrct2/actions/LandSetHeightAction.h b/src/openrct2/actions/LandSetHeightAction.h index d5f718e749..2d1f851e46 100644 --- a/src/openrct2/actions/LandSetHeightAction.h +++ b/src/openrct2/actions/LandSetHeightAction.h @@ -27,8 +27,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: StringId CheckParameters() const; diff --git a/src/openrct2/actions/LandSetRightsAction.h b/src/openrct2/actions/LandSetRightsAction.h index 785ae00ce7..ffc5289992 100644 --- a/src/openrct2/actions/LandSetRightsAction.h +++ b/src/openrct2/actions/LandSetRightsAction.h @@ -38,10 +38,10 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; - GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const; }; diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index 70e99834f8..7871f48f1b 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -29,6 +29,8 @@ #include +using namespace OpenRCT2; + LandSmoothAction::LandSmoothAction(const CoordsXY& coords, MapRange range, uint8_t selectionType, bool isLowering) : _coords(coords) , _range(range) diff --git a/src/openrct2/actions/LandSmoothAction.h b/src/openrct2/actions/LandSmoothAction.h index 8faa5ff10c..67f8e128f4 100644 --- a/src/openrct2/actions/LandSmoothAction.h +++ b/src/openrct2/actions/LandSmoothAction.h @@ -33,11 +33,11 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result SmoothLandTile( + OpenRCT2::GameActions::Result SmoothLandTile( int32_t direction, bool isExecuting, const CoordsXY& loc, SurfaceElement* surfaceElement) const; money64 SmoothLandRowByEdge( bool isExecuting, const CoordsXY& loc, int32_t expectedLandHeight1, int32_t expectedLandHeight2, int32_t stepX, @@ -45,5 +45,5 @@ private: money64 SmoothLandRowByCorner( bool isExecuting, const CoordsXY& loc, int32_t expectedLandHeight, int32_t stepX, int32_t stepY, int32_t direction, int32_t checkDirection) const; - GameActions::Result SmoothLand(bool isExecuting) const; + OpenRCT2::GameActions::Result SmoothLand(bool isExecuting) const; }; diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.h b/src/openrct2/actions/LargeSceneryPlaceAction.h index 868d13188b..dc5f59aadf 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.h +++ b/src/openrct2/actions/LargeSceneryPlaceAction.h @@ -42,8 +42,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: int16_t GetTotalNumTiles(LargeSceneryTile* tiles) const; diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.h b/src/openrct2/actions/LargeSceneryRemoveAction.h index bd15e5975a..b49a8a819a 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.h +++ b/src/openrct2/actions/LargeSceneryRemoveAction.h @@ -26,8 +26,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: TileElement* FindLargeSceneryElement(const CoordsXYZ& pos, int32_t sequenceIndex) const; diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index feecd7f603..a76a41efce 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -16,6 +16,8 @@ #include "../object/LargeSceneryEntry.h" #include "../world/Scenery.h" +using namespace OpenRCT2; + LargeScenerySetColourAction::LargeScenerySetColourAction( const CoordsXYZD& loc, uint8_t tileIndex, uint8_t primaryColour, uint8_t secondaryColour, uint8_t tertiaryColour) : _loc(loc) diff --git a/src/openrct2/actions/LargeScenerySetColourAction.h b/src/openrct2/actions/LargeScenerySetColourAction.h index 9a156fe7a1..c2a8290cb6 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.h +++ b/src/openrct2/actions/LargeScenerySetColourAction.h @@ -30,9 +30,9 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; }; diff --git a/src/openrct2/actions/LoadOrQuitAction.cpp b/src/openrct2/actions/LoadOrQuitAction.cpp index 0463abda8d..71efb52f0a 100644 --- a/src/openrct2/actions/LoadOrQuitAction.cpp +++ b/src/openrct2/actions/LoadOrQuitAction.cpp @@ -12,6 +12,8 @@ #include "../Context.h" #include "../OpenRCT2.h" +using namespace OpenRCT2; + LoadOrQuitAction::LoadOrQuitAction(LoadOrQuitModes mode, PromptMode savePromptMode) : _mode(mode) , _savePromptMode(savePromptMode) diff --git a/src/openrct2/actions/LoadOrQuitAction.h b/src/openrct2/actions/LoadOrQuitAction.h index 89df8c390a..f985f2c8a2 100644 --- a/src/openrct2/actions/LoadOrQuitAction.h +++ b/src/openrct2/actions/LoadOrQuitAction.h @@ -32,6 +32,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/MapChangeSizeAction.cpp b/src/openrct2/actions/MapChangeSizeAction.cpp index 18f4d86c2c..30b4b9398e 100644 --- a/src/openrct2/actions/MapChangeSizeAction.cpp +++ b/src/openrct2/actions/MapChangeSizeAction.cpp @@ -17,6 +17,8 @@ #include "../windows/Intent.h" #include "../world/Park.h" +using namespace OpenRCT2; + MapChangeSizeAction::MapChangeSizeAction(const TileCoordsXY& targetSize) : MapChangeSizeAction(targetSize, TileCoordsXY()) { diff --git a/src/openrct2/actions/MapChangeSizeAction.h b/src/openrct2/actions/MapChangeSizeAction.h index e46bae208a..2af093562e 100644 --- a/src/openrct2/actions/MapChangeSizeAction.h +++ b/src/openrct2/actions/MapChangeSizeAction.h @@ -23,8 +23,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: TileCoordsXY _targetSize; diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 75fcdb04cf..9cf4e20d89 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -16,6 +16,8 @@ #include "../ride/gentle/Maze.h" #include "../world/ConstructionClearance.h" +using namespace OpenRCT2; + using namespace OpenRCT2::TrackMetaData; MazePlaceTrackAction::MazePlaceTrackAction(const CoordsXYZ& location, RideId rideIndex, uint16_t mazeEntry) diff --git a/src/openrct2/actions/MazePlaceTrackAction.h b/src/openrct2/actions/MazePlaceTrackAction.h index c93d5fb3f9..ea7ac093af 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.h +++ b/src/openrct2/actions/MazePlaceTrackAction.h @@ -23,6 +23,6 @@ public: void AcceptParameters(GameActionParameterVisitor& visitor) override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index b9541d8a11..e8cfd8945d 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -24,6 +24,8 @@ #include "../world/Footpath.h" #include "../world/Park.h" +using namespace OpenRCT2; + using namespace OpenRCT2::TrackMetaData; // clang-format off diff --git a/src/openrct2/actions/MazeSetTrackAction.h b/src/openrct2/actions/MazeSetTrackAction.h index a1604425c1..f6e97658a2 100644 --- a/src/openrct2/actions/MazeSetTrackAction.h +++ b/src/openrct2/actions/MazeSetTrackAction.h @@ -25,8 +25,8 @@ public: void AcceptParameters(GameActionParameterVisitor& visitor) override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: uint8_t MazeGetSegmentBit(const CoordsXY&) const; diff --git a/src/openrct2/actions/NetworkModifyGroupAction.cpp b/src/openrct2/actions/NetworkModifyGroupAction.cpp index be469c3889..d0ea39590c 100644 --- a/src/openrct2/actions/NetworkModifyGroupAction.cpp +++ b/src/openrct2/actions/NetworkModifyGroupAction.cpp @@ -12,6 +12,8 @@ #include "../network/network.h" #include "../util/Util.h" +using namespace OpenRCT2; + NetworkModifyGroupAction::NetworkModifyGroupAction( ModifyGroupType type, uint8_t groupId, const std::string name, uint32_t permissionIndex, PermissionState permissionState) : _type(type) diff --git a/src/openrct2/actions/NetworkModifyGroupAction.h b/src/openrct2/actions/NetworkModifyGroupAction.h index 02760ffb45..6da7b851f5 100644 --- a/src/openrct2/actions/NetworkModifyGroupAction.h +++ b/src/openrct2/actions/NetworkModifyGroupAction.h @@ -49,6 +49,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/ParkEntrancePlaceAction.h b/src/openrct2/actions/ParkEntrancePlaceAction.h index 6afed853b5..006eeb1123 100644 --- a/src/openrct2/actions/ParkEntrancePlaceAction.h +++ b/src/openrct2/actions/ParkEntrancePlaceAction.h @@ -26,8 +26,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: bool CheckMapCapacity(int16_t numTiles) const; diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.h b/src/openrct2/actions/ParkEntranceRemoveAction.h index c0d0cf72d6..937cf88217 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.h +++ b/src/openrct2/actions/ParkEntranceRemoveAction.h @@ -25,8 +25,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: void ParkEntranceRemoveSegment(const CoordsXYZ& loc) const; diff --git a/src/openrct2/actions/ParkMarketingAction.h b/src/openrct2/actions/ParkMarketingAction.h index 9cd58eac7c..ac3cf7e9df 100644 --- a/src/openrct2/actions/ParkMarketingAction.h +++ b/src/openrct2/actions/ParkMarketingAction.h @@ -27,10 +27,10 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result CreateResult() const; + OpenRCT2::GameActions::Result CreateResult() const; money64 CalculatePrice() const; }; diff --git a/src/openrct2/actions/ParkSetDateAction.h b/src/openrct2/actions/ParkSetDateAction.h index 592230ea75..7bf710bb5b 100644 --- a/src/openrct2/actions/ParkSetDateAction.h +++ b/src/openrct2/actions/ParkSetDateAction.h @@ -27,6 +27,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/ParkSetEntranceFeeAction.h b/src/openrct2/actions/ParkSetEntranceFeeAction.h index 53f9d03b33..a4b403f3b8 100644 --- a/src/openrct2/actions/ParkSetEntranceFeeAction.h +++ b/src/openrct2/actions/ParkSetEntranceFeeAction.h @@ -25,6 +25,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/ParkSetLoanAction.h b/src/openrct2/actions/ParkSetLoanAction.h index d0b3b6d4cc..0bd48eb165 100644 --- a/src/openrct2/actions/ParkSetLoanAction.h +++ b/src/openrct2/actions/ParkSetLoanAction.h @@ -25,6 +25,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/ParkSetNameAction.cpp b/src/openrct2/actions/ParkSetNameAction.cpp index 369c03330a..8ec0fb6b85 100644 --- a/src/openrct2/actions/ParkSetNameAction.cpp +++ b/src/openrct2/actions/ParkSetNameAction.cpp @@ -21,6 +21,8 @@ #include "../windows/Intent.h" #include "../world/Park.h" +using namespace OpenRCT2; + ParkSetNameAction::ParkSetNameAction(const std::string& name) : _name(name) { diff --git a/src/openrct2/actions/ParkSetNameAction.h b/src/openrct2/actions/ParkSetNameAction.h index f2cbba8a7f..cb7ab47352 100644 --- a/src/openrct2/actions/ParkSetNameAction.h +++ b/src/openrct2/actions/ParkSetNameAction.h @@ -25,6 +25,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/ParkSetParameterAction.h b/src/openrct2/actions/ParkSetParameterAction.h index 089007f2e6..1fea683d83 100644 --- a/src/openrct2/actions/ParkSetParameterAction.h +++ b/src/openrct2/actions/ParkSetParameterAction.h @@ -41,6 +41,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/ParkSetResearchFundingAction.h b/src/openrct2/actions/ParkSetResearchFundingAction.h index 8fcf7ed391..2044e7f8c7 100644 --- a/src/openrct2/actions/ParkSetResearchFundingAction.h +++ b/src/openrct2/actions/ParkSetResearchFundingAction.h @@ -27,6 +27,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/PauseToggleAction.cpp b/src/openrct2/actions/PauseToggleAction.cpp index 3989f859e7..b1a27caf0c 100644 --- a/src/openrct2/actions/PauseToggleAction.cpp +++ b/src/openrct2/actions/PauseToggleAction.cpp @@ -9,6 +9,8 @@ #include "PauseToggleAction.h" +using namespace OpenRCT2; + uint16_t PauseToggleAction::GetActionFlags() const { return GameAction::GetActionFlags() | GameActions::Flags::AllowWhilePaused | GameActions::Flags::IgnoreForReplays; diff --git a/src/openrct2/actions/PauseToggleAction.h b/src/openrct2/actions/PauseToggleAction.h index 4f0a805eaa..9d0d13f123 100644 --- a/src/openrct2/actions/PauseToggleAction.h +++ b/src/openrct2/actions/PauseToggleAction.h @@ -20,7 +20,7 @@ public: uint16_t GetActionFlags() const override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; // clang-format on diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index 5ea02f4bfb..f51675278b 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -16,6 +16,8 @@ #include "../network/network.h" #include "../util/Util.h" +using namespace OpenRCT2; + PeepPickupAction::PeepPickupAction(PeepPickupType type, EntityId entityId, const CoordsXYZ& loc, NetworkPlayerId_t owner) : _type(type) , _entityId(entityId) diff --git a/src/openrct2/actions/PeepPickupAction.h b/src/openrct2/actions/PeepPickupAction.h index 72b9c0fad9..a6e4b29d78 100644 --- a/src/openrct2/actions/PeepPickupAction.h +++ b/src/openrct2/actions/PeepPickupAction.h @@ -37,8 +37,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: void CancelConcurrentPickups(Peep* pickedPeep) const; diff --git a/src/openrct2/actions/PeepSpawnPlaceAction.h b/src/openrct2/actions/PeepSpawnPlaceAction.h index 803301e9fb..5dab93a935 100644 --- a/src/openrct2/actions/PeepSpawnPlaceAction.h +++ b/src/openrct2/actions/PeepSpawnPlaceAction.h @@ -25,6 +25,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/PlayerKickAction.cpp b/src/openrct2/actions/PlayerKickAction.cpp index fa93fd54bd..a47555002b 100644 --- a/src/openrct2/actions/PlayerKickAction.cpp +++ b/src/openrct2/actions/PlayerKickAction.cpp @@ -11,6 +11,8 @@ #include "../network/network.h" +using namespace OpenRCT2; + PlayerKickAction::PlayerKickAction(NetworkPlayerId_t playerId) : _playerId(playerId) { diff --git a/src/openrct2/actions/PlayerKickAction.h b/src/openrct2/actions/PlayerKickAction.h index 5810226066..1085c28286 100644 --- a/src/openrct2/actions/PlayerKickAction.h +++ b/src/openrct2/actions/PlayerKickAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/PlayerSetGroupAction.cpp b/src/openrct2/actions/PlayerSetGroupAction.cpp index 45eb65dec1..78802b4201 100644 --- a/src/openrct2/actions/PlayerSetGroupAction.cpp +++ b/src/openrct2/actions/PlayerSetGroupAction.cpp @@ -11,6 +11,8 @@ #include "../network/network.h" +using namespace OpenRCT2; + PlayerSetGroupAction::PlayerSetGroupAction(NetworkPlayerId_t playerId, uint8_t groupId) : _playerId(playerId) , _groupId(groupId) diff --git a/src/openrct2/actions/PlayerSetGroupAction.h b/src/openrct2/actions/PlayerSetGroupAction.h index 1b70c6a5ce..ab2fb005cc 100644 --- a/src/openrct2/actions/PlayerSetGroupAction.h +++ b/src/openrct2/actions/PlayerSetGroupAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/RideCreateAction.h b/src/openrct2/actions/RideCreateAction.h index 9917e96de7..56c9455d2d 100644 --- a/src/openrct2/actions/RideCreateAction.h +++ b/src/openrct2/actions/RideCreateAction.h @@ -32,6 +32,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/RideDemolishAction.h b/src/openrct2/actions/RideDemolishAction.h index 629a2f1cb7..ca0302aba8 100644 --- a/src/openrct2/actions/RideDemolishAction.h +++ b/src/openrct2/actions/RideDemolishAction.h @@ -26,14 +26,14 @@ public: uint32_t GetCooldownTime() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result DemolishRide(Ride& ride) const; + OpenRCT2::GameActions::Result DemolishRide(Ride& ride) const; money64 MazeRemoveTrack(const CoordsXYZD& coords) const; money64 DemolishTracks() const; - GameActions::Result RefurbishRide(Ride& ride) const; + OpenRCT2::GameActions::Result RefurbishRide(Ride& ride) const; money64 GetRefurbishPrice(const Ride& ride) const; money64 GetRefundPrice(const Ride& ride) const; }; diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.h b/src/openrct2/actions/RideEntranceExitPlaceAction.h index 78dae48a7b..0944ba1d19 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.h +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.h @@ -31,8 +31,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; - static GameActions::Result TrackPlaceQuery(const CoordsXYZ& loc, const bool isExit); + static OpenRCT2::GameActions::Result TrackPlaceQuery(const CoordsXYZ& loc, const bool isExit); }; diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.h b/src/openrct2/actions/RideEntranceExitRemoveAction.h index 6c35ea2f44..e9cde696b2 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.h +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.h @@ -28,6 +28,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/RideFreezeRatingAction.cpp b/src/openrct2/actions/RideFreezeRatingAction.cpp index 066d696154..3b0eefff45 100644 --- a/src/openrct2/actions/RideFreezeRatingAction.cpp +++ b/src/openrct2/actions/RideFreezeRatingAction.cpp @@ -11,6 +11,8 @@ #include "../Diagnostic.h" +using namespace OpenRCT2; + RideFreezeRatingAction::RideFreezeRatingAction(RideId rideIndex, RideRatingType type, ride_rating value) : _rideIndex(rideIndex) , _type(type) diff --git a/src/openrct2/actions/RideFreezeRatingAction.h b/src/openrct2/actions/RideFreezeRatingAction.h index b26dfb7f5f..e0a95f462a 100644 --- a/src/openrct2/actions/RideFreezeRatingAction.h +++ b/src/openrct2/actions/RideFreezeRatingAction.h @@ -32,6 +32,6 @@ public: void AcceptParameters(GameActionParameterVisitor& visitor) override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index f3140d28f6..95ff32c0c0 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -21,6 +21,8 @@ #include "../ui/WindowManager.h" #include "../world/Park.h" +using namespace OpenRCT2; + RideSetAppearanceAction::RideSetAppearanceAction(RideId rideIndex, RideSetAppearanceType type, uint16_t value, uint32_t index) : _rideIndex(rideIndex) , _type(type) diff --git a/src/openrct2/actions/RideSetAppearanceAction.h b/src/openrct2/actions/RideSetAppearanceAction.h index 0b9fcbcef7..0ae64d344f 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.h +++ b/src/openrct2/actions/RideSetAppearanceAction.h @@ -42,6 +42,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/RideSetColourSchemeAction.cpp b/src/openrct2/actions/RideSetColourSchemeAction.cpp index 0e67a15264..7ed4050284 100644 --- a/src/openrct2/actions/RideSetColourSchemeAction.cpp +++ b/src/openrct2/actions/RideSetColourSchemeAction.cpp @@ -18,6 +18,8 @@ #include "../ride/RideConstruction.h" #include "../world/Park.h" +using namespace OpenRCT2; + RideSetColourSchemeAction::RideSetColourSchemeAction( const CoordsXYZD& location, track_type_t trackType, uint16_t newColourScheme) : _loc(location) diff --git a/src/openrct2/actions/RideSetColourSchemeAction.h b/src/openrct2/actions/RideSetColourSchemeAction.h index edb8ca0257..6fab260008 100644 --- a/src/openrct2/actions/RideSetColourSchemeAction.h +++ b/src/openrct2/actions/RideSetColourSchemeAction.h @@ -27,6 +27,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/RideSetNameAction.cpp b/src/openrct2/actions/RideSetNameAction.cpp index 0cd0c3c787..228baf1ac0 100644 --- a/src/openrct2/actions/RideSetNameAction.cpp +++ b/src/openrct2/actions/RideSetNameAction.cpp @@ -21,6 +21,8 @@ #include "../ui/WindowManager.h" #include "../world/Park.h" +using namespace OpenRCT2; + RideSetNameAction::RideSetNameAction(RideId rideIndex, const std::string& name) : _rideIndex(rideIndex) , _name(name) diff --git a/src/openrct2/actions/RideSetNameAction.h b/src/openrct2/actions/RideSetNameAction.h index 52a106351c..b4c33f2387 100644 --- a/src/openrct2/actions/RideSetNameAction.h +++ b/src/openrct2/actions/RideSetNameAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index 7e6e4481bb..9ebc35e396 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -20,6 +20,8 @@ #include "../ride/ShopItem.h" #include "../world/Park.h" +using namespace OpenRCT2; + RideSetPriceAction::RideSetPriceAction(RideId rideIndex, money64 price, bool primaryPrice) : _rideIndex(rideIndex) , _price(price) diff --git a/src/openrct2/actions/RideSetPriceAction.h b/src/openrct2/actions/RideSetPriceAction.h index 2b40811bc5..edbbaeeb56 100644 --- a/src/openrct2/actions/RideSetPriceAction.h +++ b/src/openrct2/actions/RideSetPriceAction.h @@ -27,8 +27,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: void RideSetCommonPrice(ShopItem shopItem) const; diff --git a/src/openrct2/actions/RideSetSettingAction.h b/src/openrct2/actions/RideSetSettingAction.h index 030860e4d1..a11bf03b0a 100644 --- a/src/openrct2/actions/RideSetSettingAction.h +++ b/src/openrct2/actions/RideSetSettingAction.h @@ -42,8 +42,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: bool RideIsModeValid(const Ride& ride) const; diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index a17e628eb2..df5862aa6e 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -21,6 +21,8 @@ #include "../ui/WindowManager.h" #include "../world/Park.h" +using namespace OpenRCT2; + static StringId _StatusErrorTitles[] = { STR_CANT_CLOSE, STR_CANT_OPEN, diff --git a/src/openrct2/actions/RideSetStatusAction.h b/src/openrct2/actions/RideSetStatusAction.h index a868775d52..9802fb6b7e 100644 --- a/src/openrct2/actions/RideSetStatusAction.h +++ b/src/openrct2/actions/RideSetStatusAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/RideSetVehicleAction.h b/src/openrct2/actions/RideSetVehicleAction.h index a6e6a12687..5862d9b140 100644 --- a/src/openrct2/actions/RideSetVehicleAction.h +++ b/src/openrct2/actions/RideSetVehicleAction.h @@ -37,8 +37,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: bool RideIsVehicleTypeValid(const Ride& ride) const; diff --git a/src/openrct2/actions/ScenarioSetSettingAction.h b/src/openrct2/actions/ScenarioSetSettingAction.h index 3c5058fcbe..92e01ad860 100644 --- a/src/openrct2/actions/ScenarioSetSettingAction.h +++ b/src/openrct2/actions/ScenarioSetSettingAction.h @@ -57,10 +57,10 @@ public: uint16_t GetActionFlags() const override { - return GameAction::GetActionFlags() | GameActions::Flags::AllowWhilePaused; + return GameAction::GetActionFlags() | OpenRCT2::GameActions::Flags::AllowWhilePaused; } void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/ScenerySetRestrictedAction.cpp b/src/openrct2/actions/ScenerySetRestrictedAction.cpp index faa57f5a6a..136386a18a 100644 --- a/src/openrct2/actions/ScenerySetRestrictedAction.cpp +++ b/src/openrct2/actions/ScenerySetRestrictedAction.cpp @@ -12,6 +12,8 @@ #include "../object/SceneryGroupObject.h" #include "../world/Scenery.h" +using namespace OpenRCT2; + ScenerySetRestrictedAction::ScenerySetRestrictedAction(ObjectType objectType, ObjectEntryIndex entryIndex, bool isRestricted) : _objectType(objectType) , _objectIndex(entryIndex) diff --git a/src/openrct2/actions/ScenerySetRestrictedAction.h b/src/openrct2/actions/ScenerySetRestrictedAction.h index c8ec22e119..76dcea708d 100644 --- a/src/openrct2/actions/ScenerySetRestrictedAction.h +++ b/src/openrct2/actions/ScenerySetRestrictedAction.h @@ -25,6 +25,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index ce9f71433a..8519a86de3 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -18,6 +18,8 @@ #include +using namespace OpenRCT2; + SignSetNameAction::SignSetNameAction(BannerIndex bannerIndex, const std::string& name) : _bannerIndex(bannerIndex) , _name(name) diff --git a/src/openrct2/actions/SignSetNameAction.h b/src/openrct2/actions/SignSetNameAction.h index 2be31d280e..0dcd2241ee 100644 --- a/src/openrct2/actions/SignSetNameAction.h +++ b/src/openrct2/actions/SignSetNameAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 1b363db47b..a6b4c1c829 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -19,6 +19,8 @@ #include "../world/Banner.h" #include "../world/Scenery.h" +using namespace OpenRCT2; + SignSetStyleAction::SignSetStyleAction(BannerIndex bannerIndex, uint8_t mainColour, uint8_t textColour, bool isLarge) : _bannerIndex(bannerIndex) , _mainColour(mainColour) diff --git a/src/openrct2/actions/SignSetStyleAction.h b/src/openrct2/actions/SignSetStyleAction.h index baec7d4d5f..df18d657c1 100644 --- a/src/openrct2/actions/SignSetStyleAction.h +++ b/src/openrct2/actions/SignSetStyleAction.h @@ -28,6 +28,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.h b/src/openrct2/actions/SmallSceneryPlaceAction.h index 0949818b4d..4c4d1ff3ee 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.h +++ b/src/openrct2/actions/SmallSceneryPlaceAction.h @@ -41,6 +41,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.h b/src/openrct2/actions/SmallSceneryRemoveAction.h index 3b80d9cea5..05308959b9 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.h +++ b/src/openrct2/actions/SmallSceneryRemoveAction.h @@ -28,8 +28,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: TileElement* FindSceneryElement() const; diff --git a/src/openrct2/actions/SmallScenerySetColourAction.h b/src/openrct2/actions/SmallScenerySetColourAction.h index 7900be55ab..ea2b11252c 100644 --- a/src/openrct2/actions/SmallScenerySetColourAction.h +++ b/src/openrct2/actions/SmallScenerySetColourAction.h @@ -32,9 +32,9 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; }; diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index 3243cf5e33..2d90269c63 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -14,6 +14,8 @@ #include "../entity/Staff.h" #include "../interface/Window.h" +using namespace OpenRCT2; + StaffFireAction::StaffFireAction(EntityId spriteId) : _spriteId(spriteId) { diff --git a/src/openrct2/actions/StaffFireAction.h b/src/openrct2/actions/StaffFireAction.h index 20665b175a..e6ecdc386d 100644 --- a/src/openrct2/actions/StaffFireAction.h +++ b/src/openrct2/actions/StaffFireAction.h @@ -25,6 +25,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/StaffHireNewAction.h b/src/openrct2/actions/StaffHireNewAction.h index ec1e9ca2b0..9dffc5aa42 100644 --- a/src/openrct2/actions/StaffHireNewAction.h +++ b/src/openrct2/actions/StaffHireNewAction.h @@ -34,10 +34,10 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool execute) const; + OpenRCT2::GameActions::Result QueryExecute(bool execute) const; void AutoPositionNewStaff(Peep* newPeep) const; }; diff --git a/src/openrct2/actions/StaffSetColourAction.cpp b/src/openrct2/actions/StaffSetColourAction.cpp index 524806774c..4ef7a6dbbf 100644 --- a/src/openrct2/actions/StaffSetColourAction.cpp +++ b/src/openrct2/actions/StaffSetColourAction.cpp @@ -20,6 +20,8 @@ #include "../ui/WindowManager.h" #include "../windows/Intent.h" +using namespace OpenRCT2; + StaffSetColourAction::StaffSetColourAction(StaffType staffType, uint8_t colour) : _staffType(static_cast(staffType)) , _colour(colour) diff --git a/src/openrct2/actions/StaffSetColourAction.h b/src/openrct2/actions/StaffSetColourAction.h index 5cb20cae2f..fe6fa3ee24 100644 --- a/src/openrct2/actions/StaffSetColourAction.h +++ b/src/openrct2/actions/StaffSetColourAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 23095cd6eb..e057fca248 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -16,6 +16,8 @@ #include "../localisation/StringIds.h" #include "../windows/Intent.h" +using namespace OpenRCT2; + /** rct2: 0x00982134 */ constexpr bool peep_slow_walking_types[] = { false, // PeepSpriteType::Normal diff --git a/src/openrct2/actions/StaffSetCostumeAction.h b/src/openrct2/actions/StaffSetCostumeAction.h index e8d45a88ba..f5a8a33ee2 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.h +++ b/src/openrct2/actions/StaffSetCostumeAction.h @@ -27,6 +27,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index 84c829a602..91ef26f86f 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -21,6 +21,8 @@ #include "../windows/Intent.h" #include "../world/Park.h" +using namespace OpenRCT2; + StaffSetNameAction::StaffSetNameAction(EntityId spriteIndex, const std::string& name) : _spriteIndex(spriteIndex) , _name(name) diff --git a/src/openrct2/actions/StaffSetNameAction.h b/src/openrct2/actions/StaffSetNameAction.h index 3230a5fcfe..ec75bc9aac 100644 --- a/src/openrct2/actions/StaffSetNameAction.h +++ b/src/openrct2/actions/StaffSetNameAction.h @@ -25,6 +25,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index b2c319c1da..f5adaf0071 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -17,6 +17,8 @@ #include "../localisation/StringIds.h" #include "../windows/Intent.h" +using namespace OpenRCT2; + StaffSetOrdersAction::StaffSetOrdersAction(EntityId spriteIndex, uint8_t ordersId) : _spriteIndex(spriteIndex) , _ordersId(ordersId) diff --git a/src/openrct2/actions/StaffSetOrdersAction.h b/src/openrct2/actions/StaffSetOrdersAction.h index 7f363a194f..416696156d 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.h +++ b/src/openrct2/actions/StaffSetOrdersAction.h @@ -26,6 +26,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index 967d9e7ec7..ac28607d5c 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -16,6 +16,8 @@ #include "../entity/Staff.h" #include "../interface/Window.h" +using namespace OpenRCT2; + StaffSetPatrolAreaAction::StaffSetPatrolAreaAction(EntityId spriteId, const MapRange& range, const StaffSetPatrolAreaMode mode) : _spriteId(spriteId) , _range(range) diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.h b/src/openrct2/actions/StaffSetPatrolAreaAction.h index aa534b786e..a285e46d85 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.h +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.h @@ -25,7 +25,7 @@ private: MapRange _range; StaffSetPatrolAreaMode _mode; - GameActions::Result QueryExecute(bool executing) const; + OpenRCT2::GameActions::Result QueryExecute(bool executing) const; public: StaffSetPatrolAreaAction() = default; @@ -35,6 +35,6 @@ public: void AcceptParameters(GameActionParameterVisitor& visitor) override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/SurfaceSetStyleAction.h b/src/openrct2/actions/SurfaceSetStyleAction.h index d917efc71f..2a3e5eceb3 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.h +++ b/src/openrct2/actions/SurfaceSetStyleAction.h @@ -25,6 +25,6 @@ public: void AcceptParameters(GameActionParameterVisitor& visitor) override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/TileModifyAction.h b/src/openrct2/actions/TileModifyAction.h index 008073a094..16f0a9bd03 100644 --- a/src/openrct2/actions/TileModifyAction.h +++ b/src/openrct2/actions/TileModifyAction.h @@ -63,9 +63,9 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; }; diff --git a/src/openrct2/actions/TrackDesignAction.h b/src/openrct2/actions/TrackDesignAction.h index 8244059706..bd8a2b56da 100644 --- a/src/openrct2/actions/TrackDesignAction.h +++ b/src/openrct2/actions/TrackDesignAction.h @@ -28,6 +28,6 @@ public: void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/TrackPlaceAction.h b/src/openrct2/actions/TrackPlaceAction.h index 859b792fd4..7142eb1ecc 100644 --- a/src/openrct2/actions/TrackPlaceAction.h +++ b/src/openrct2/actions/TrackPlaceAction.h @@ -40,8 +40,8 @@ public: uint16_t GetActionFlags() const override final; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: bool CheckMapCapacity(int16_t numTiles) const; diff --git a/src/openrct2/actions/TrackRemoveAction.h b/src/openrct2/actions/TrackRemoveAction.h index 28096b2719..8caafaa85a 100644 --- a/src/openrct2/actions/TrackRemoveAction.h +++ b/src/openrct2/actions/TrackRemoveAction.h @@ -27,6 +27,6 @@ public: uint16_t GetActionFlags() const override final; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp index d2cb71c881..4e4711343b 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp @@ -12,6 +12,8 @@ #include "../Diagnostic.h" #include "../management/Finance.h" +using namespace OpenRCT2; + TrackSetBrakeSpeedAction::TrackSetBrakeSpeedAction(const CoordsXYZ& loc, track_type_t trackType, uint8_t brakeSpeed) : _loc(loc) , _trackType(trackType) diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.h b/src/openrct2/actions/TrackSetBrakeSpeedAction.h index cabfae6756..ead200491e 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.h +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.h @@ -27,9 +27,9 @@ public: uint16_t GetActionFlags() const override final; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; }; diff --git a/src/openrct2/actions/WallPlaceAction.h b/src/openrct2/actions/WallPlaceAction.h index a253768d7f..d2ee3d3732 100644 --- a/src/openrct2/actions/WallPlaceAction.h +++ b/src/openrct2/actions/WallPlaceAction.h @@ -42,8 +42,8 @@ public: uint16_t GetActionFlags() const override final; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: /** @@ -56,7 +56,8 @@ private: * * rct2: 0x006E5C1A */ - GameActions::Result WallCheckObstruction(const WallSceneryEntry* wall, int32_t z0, int32_t z1, bool* wallAcrossTrack) const; + OpenRCT2::GameActions::Result WallCheckObstruction( + const WallSceneryEntry* wall, int32_t z0, int32_t z1, bool* wallAcrossTrack) const; /** * Gets whether the given track type can have a wall placed on the edge of the given direction. diff --git a/src/openrct2/actions/WallRemoveAction.h b/src/openrct2/actions/WallRemoveAction.h index d846e2def0..d465cca58a 100644 --- a/src/openrct2/actions/WallRemoveAction.h +++ b/src/openrct2/actions/WallRemoveAction.h @@ -22,8 +22,8 @@ public: void AcceptParameters(GameActionParameterVisitor& visitor) override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: TileElement* GetFirstWallElementAt(const CoordsXYZD& location, bool isGhost) const; diff --git a/src/openrct2/actions/WallSetColourAction.h b/src/openrct2/actions/WallSetColourAction.h index 3bdaff4744..752e06a695 100644 --- a/src/openrct2/actions/WallSetColourAction.h +++ b/src/openrct2/actions/WallSetColourAction.h @@ -28,6 +28,6 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; }; diff --git a/src/openrct2/actions/WaterLowerAction.h b/src/openrct2/actions/WaterLowerAction.h index bbbb862be0..63a4130ac9 100644 --- a/src/openrct2/actions/WaterLowerAction.h +++ b/src/openrct2/actions/WaterLowerAction.h @@ -25,10 +25,10 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; uint8_t GetLowestHeight(const MapRange& validRange) const; }; diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index 5f75573326..79adb81efc 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -15,6 +15,8 @@ #include "../ride/RideConstruction.h" #include "WaterSetHeightAction.h" +using namespace OpenRCT2; + WaterRaiseAction::WaterRaiseAction(MapRange range) : _range(range) { diff --git a/src/openrct2/actions/WaterRaiseAction.h b/src/openrct2/actions/WaterRaiseAction.h index 1e0e90e360..53eb820ac5 100644 --- a/src/openrct2/actions/WaterRaiseAction.h +++ b/src/openrct2/actions/WaterRaiseAction.h @@ -25,10 +25,10 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: - GameActions::Result QueryExecute(bool isExecuting) const; + OpenRCT2::GameActions::Result QueryExecute(bool isExecuting) const; uint16_t GetHighestHeight(const MapRange& validRange) const; }; diff --git a/src/openrct2/actions/WaterSetHeightAction.h b/src/openrct2/actions/WaterSetHeightAction.h index 7f71192e7f..cc2e68a373 100644 --- a/src/openrct2/actions/WaterSetHeightAction.h +++ b/src/openrct2/actions/WaterSetHeightAction.h @@ -26,8 +26,8 @@ public: uint16_t GetActionFlags() const override; void Serialise(DataSerialiser& stream) override; - GameActions::Result Query() const override; - GameActions::Result Execute() const override; + OpenRCT2::GameActions::Result Query() const override; + OpenRCT2::GameActions::Result Execute() const override; private: StringId CheckParameters() const; diff --git a/src/openrct2/command_line/CommandLine.cpp b/src/openrct2/command_line/CommandLine.cpp index da05376047..124e9269aa 100644 --- a/src/openrct2/command_line/CommandLine.cpp +++ b/src/openrct2/command_line/CommandLine.cpp @@ -17,6 +17,8 @@ #include +using namespace OpenRCT2; + #pragma region CommandLineArgEnumerator CommandLineArgEnumerator::CommandLineArgEnumerator(const char* const* arguments, int32_t count) @@ -91,7 +93,7 @@ bool CommandLineArgEnumerator::TryPopString(const char** result) #pragma endregion -namespace CommandLine +namespace OpenRCT2::CommandLine { constexpr const char* HelpText = "openrct2 -ha shows help for all commands. " "openrct2 -h will show help and details for a given command."; @@ -522,7 +524,7 @@ namespace CommandLine } return nullptr; } -} // namespace CommandLine +} // namespace OpenRCT2::CommandLine int32_t CommandLineRun(const char** argv, int32_t argc) { diff --git a/src/openrct2/command_line/CommandLine.hpp b/src/openrct2/command_line/CommandLine.hpp index fb44894eed..fbc6d497be 100644 --- a/src/openrct2/command_line/CommandLine.hpp +++ b/src/openrct2/command_line/CommandLine.hpp @@ -111,7 +111,7 @@ constexpr char NAC = '\0'; name, "", nullptr, subcommandtable, nullptr \ } -namespace CommandLine +namespace OpenRCT2::CommandLine { extern const CommandLineCommand RootCommands[]; extern const CommandLineCommand ScreenshotCommands[]; @@ -126,4 +126,4 @@ namespace CommandLine exitcode_t HandleCommandConvert(CommandLineArgEnumerator* enumerator); exitcode_t HandleCommandUri(CommandLineArgEnumerator* enumerator); -} // namespace CommandLine +} // namespace OpenRCT2::CommandLine diff --git a/src/openrct2/command_line/ParkInfoCommands.cpp b/src/openrct2/command_line/ParkInfoCommands.cpp index 7a68e4ea3f..3bd117ad8f 100644 --- a/src/openrct2/command_line/ParkInfoCommands.cpp +++ b/src/openrct2/command_line/ParkInfoCommands.cpp @@ -16,6 +16,8 @@ #include "../object/ObjectRepository.h" #include "CommandLine.hpp" +using namespace OpenRCT2; + // clang-format off static constexpr CommandLineOptionDefinition NoOptions[] { diff --git a/src/openrct2/command_line/ScreenshotCommands.cpp b/src/openrct2/command_line/ScreenshotCommands.cpp index 59054bbbc4..2241a4b96f 100644 --- a/src/openrct2/command_line/ScreenshotCommands.cpp +++ b/src/openrct2/command_line/ScreenshotCommands.cpp @@ -10,6 +10,8 @@ #include "../interface/Screenshot.h" #include "CommandLine.hpp" +using namespace OpenRCT2; + static ScreenshotOptions _options; // clang-format off diff --git a/src/openrct2/command_line/SpriteCommands.cpp b/src/openrct2/command_line/SpriteCommands.cpp index 7e13e9791f..83763418a5 100644 --- a/src/openrct2/command_line/SpriteCommands.cpp +++ b/src/openrct2/command_line/SpriteCommands.cpp @@ -12,6 +12,8 @@ #include "../core/String.hpp" #include "CommandLine.hpp" +using namespace OpenRCT2; + #define SZ_DEFAULT "default" #define SZ_CLOSEST "closest" #define SZ_DITHERING "dithering" diff --git a/src/openrct2/command_line/UriHandler.cpp b/src/openrct2/command_line/UriHandler.cpp index 9d286b57c2..8603300cc3 100644 --- a/src/openrct2/command_line/UriHandler.cpp +++ b/src/openrct2/command_line/UriHandler.cpp @@ -13,6 +13,8 @@ #include "../network/network.h" #include "CommandLine.hpp" +using namespace OpenRCT2; + static exitcode_t HandleUri(const std::string& uri); #ifndef DISABLE_NETWORK diff --git a/src/openrct2/config/ConfigEnum.hpp b/src/openrct2/config/ConfigEnum.hpp index 07cc6478fb..d343451fd6 100644 --- a/src/openrct2/config/ConfigEnum.hpp +++ b/src/openrct2/config/ConfigEnum.hpp @@ -61,7 +61,7 @@ public: { for (const auto& entry : _entries) { - if (String::IEquals(entry.Key, key)) + if (OpenRCT2::String::IEquals(entry.Key, key)) { return entry.Value; } diff --git a/src/openrct2/config/IniReader.cpp b/src/openrct2/config/IniReader.cpp index e701b4a40e..1b37470285 100644 --- a/src/openrct2/config/IniReader.cpp +++ b/src/openrct2/config/IniReader.cpp @@ -19,6 +19,8 @@ #include #include +using namespace OpenRCT2; + /** * Simple tuple (start, length) representing a text span in a buffer. */ diff --git a/src/openrct2/config/IniWriter.cpp b/src/openrct2/config/IniWriter.cpp index b92e11444a..96e80c7913 100644 --- a/src/openrct2/config/IniWriter.cpp +++ b/src/openrct2/config/IniWriter.cpp @@ -15,6 +15,8 @@ #include +using namespace OpenRCT2; + class IniWriter final : public IIniWriter { private: diff --git a/src/openrct2/core/Collections.hpp b/src/openrct2/core/Collections.hpp index 084626011d..2fc851ae0b 100644 --- a/src/openrct2/core/Collections.hpp +++ b/src/openrct2/core/Collections.hpp @@ -14,7 +14,7 @@ #include -namespace Collections +namespace OpenRCT2::Collections { template static void AddRange(TCollection& collection, std::initializer_list initializerList) @@ -97,4 +97,4 @@ namespace Collections } #pragma endregion -} // namespace Collections +} // namespace OpenRCT2::Collections diff --git a/src/openrct2/core/Console.cpp b/src/openrct2/core/Console.cpp index 17997342cb..f33537b942 100644 --- a/src/openrct2/core/Console.cpp +++ b/src/openrct2/core/Console.cpp @@ -15,7 +15,7 @@ #include #include -namespace Console +namespace OpenRCT2::Console { void Write(char c) { @@ -108,4 +108,4 @@ namespace Console std::printf("%s\n", buffer); } } // namespace Error -} // namespace Console +} // namespace OpenRCT2::Console diff --git a/src/openrct2/core/Console.hpp b/src/openrct2/core/Console.hpp index ac146890b2..b61264b221 100644 --- a/src/openrct2/core/Console.hpp +++ b/src/openrct2/core/Console.hpp @@ -13,7 +13,7 @@ #include -namespace Console +namespace OpenRCT2::Console { void Write(char c); void Write(const utf8* str); @@ -31,4 +31,4 @@ namespace Console void WriteLine(const utf8* format, ...); void WriteLine_VA(const utf8* format, va_list args); } // namespace Error -} // namespace Console +} // namespace OpenRCT2::Console diff --git a/src/openrct2/core/Crypt.CNG.cpp b/src/openrct2/core/Crypt.CNG.cpp index bc16d5ddc3..6befecd7e1 100644 --- a/src/openrct2/core/Crypt.CNG.cpp +++ b/src/openrct2/core/Crypt.CNG.cpp @@ -29,7 +29,7 @@ constexpr bool NT_SUCCESS(NTSTATUS status) {return status >= 0;} // clang-format on -using namespace Crypt; +using namespace OpenRCT2::Crypt; static void CngThrowOnBadStatus(std::string_view name, NTSTATUS status) { @@ -63,7 +63,7 @@ public: { // BCRYPT_HASH_REUSABLE_FLAG only available from Windows 8 _algName = algName; - _reusable = Platform::IsOSVersionAtLeast(6, 2, 0); + _reusable = OpenRCT2::Platform::IsOSVersionAtLeast(6, 2, 0); Initialise(); } @@ -653,7 +653,7 @@ public: private: static std::tuple HashData(const void* data, size_t dataLen) { - auto hash = Crypt::SHA256(data, dataLen); + auto hash = OpenRCT2::Crypt::SHA256(data, dataLen); return ToHeap(hash.data(), hash.size()); } @@ -667,7 +667,7 @@ private: } }; -namespace Crypt +namespace OpenRCT2::Crypt { std::unique_ptr CreateSHA1() { @@ -688,6 +688,6 @@ namespace Crypt { return std::make_unique(); } -} // namespace Crypt +} // namespace OpenRCT2::Crypt #endif diff --git a/src/openrct2/core/Crypt.OpenRCT2.cpp b/src/openrct2/core/Crypt.OpenRCT2.cpp index 03b7405d2c..1246d61594 100644 --- a/src/openrct2/core/Crypt.OpenRCT2.cpp +++ b/src/openrct2/core/Crypt.OpenRCT2.cpp @@ -14,7 +14,7 @@ #include #include -using namespace Crypt; +using namespace OpenRCT2::Crypt; class OpenRCT2FNV1aAlgorithm final : public FNV1aAlgorithm { @@ -91,10 +91,10 @@ public: } }; -namespace Crypt +namespace OpenRCT2::Crypt { std::unique_ptr CreateFNV1a() { return std::make_unique(); } -} // namespace Crypt +} // namespace OpenRCT2::Crypt diff --git a/src/openrct2/core/Crypt.OpenSSL.cpp b/src/openrct2/core/Crypt.OpenSSL.cpp index 51c75540d5..da16f49ca4 100644 --- a/src/openrct2/core/Crypt.OpenSSL.cpp +++ b/src/openrct2/core/Crypt.OpenSSL.cpp @@ -20,7 +20,7 @@ # include # include -using namespace Crypt; +using namespace OpenRCT2::Crypt; static void OpenSSLThrowOnBadStatus(std::string_view name, int status) { @@ -326,7 +326,7 @@ public: } }; -namespace Crypt +namespace OpenRCT2::Crypt { std::unique_ptr CreateSHA1() { @@ -351,7 +351,7 @@ namespace Crypt OpenSSLInitialise(); return std::make_unique(); } -} // namespace Crypt +} // namespace OpenRCT2::Crypt # pragma GCC diagnostic pop diff --git a/src/openrct2/core/Crypt.h b/src/openrct2/core/Crypt.h index 3b904a233f..3d9fbd507b 100644 --- a/src/openrct2/core/Crypt.h +++ b/src/openrct2/core/Crypt.h @@ -15,7 +15,7 @@ #include #include -namespace Crypt +namespace OpenRCT2::Crypt { template class HashAlgorithm { @@ -72,4 +72,4 @@ namespace Crypt { return CreateSHA256()->Update(data, dataLen)->Finish(); } -} // namespace Crypt +} // namespace OpenRCT2::Crypt diff --git a/src/openrct2/core/Diagnostics.cpp b/src/openrct2/core/Diagnostics.cpp index 07879c56c7..91a8e1f1af 100644 --- a/src/openrct2/core/Diagnostics.cpp +++ b/src/openrct2/core/Diagnostics.cpp @@ -13,7 +13,7 @@ #include "Diagnostics.hpp" -namespace Debug +namespace OpenRCT2::Debug { void Break() { @@ -26,4 +26,4 @@ namespace Debug # endif #endif } -} // namespace Debug +} // namespace OpenRCT2::Debug diff --git a/src/openrct2/core/Diagnostics.hpp b/src/openrct2/core/Diagnostics.hpp index 8d76d2dbd4..575d759f9e 100644 --- a/src/openrct2/core/Diagnostics.hpp +++ b/src/openrct2/core/Diagnostics.hpp @@ -12,7 +12,7 @@ /** * Utility methods for asserting and logging. */ -namespace Debug +namespace OpenRCT2::Debug { void Break(); } diff --git a/src/openrct2/core/File.cpp b/src/openrct2/core/File.cpp index b666dab257..11c9705284 100644 --- a/src/openrct2/core/File.cpp +++ b/src/openrct2/core/File.cpp @@ -22,7 +22,7 @@ #include -namespace File +namespace OpenRCT2::File { bool Exists(u8string_view path) { @@ -138,4 +138,4 @@ namespace File { return Platform::GetFileSize(path); } -} // namespace File +} // namespace OpenRCT2::File diff --git a/src/openrct2/core/File.h b/src/openrct2/core/File.h index e7c748217b..62fe4a3d75 100644 --- a/src/openrct2/core/File.h +++ b/src/openrct2/core/File.h @@ -15,7 +15,7 @@ #include #include -namespace File +namespace OpenRCT2::File { bool Exists(u8string_view path); bool Copy(u8string_view srcPath, u8string_view dstPath, bool overwrite); @@ -27,4 +27,4 @@ namespace File void WriteAllBytes(u8string_view path, const void* buffer, size_t length); uint64_t GetLastModified(u8string_view path); uint64_t GetSize(u8string_view path); -} // namespace File +} // namespace OpenRCT2::File diff --git a/src/openrct2/core/FileIndex.hpp b/src/openrct2/core/FileIndex.hpp index 92b66b065a..1d7afef5d3 100644 --- a/src/openrct2/core/FileIndex.hpp +++ b/src/openrct2/core/FileIndex.hpp @@ -143,11 +143,11 @@ private: std::vector files; for (const auto& directory : SearchPaths) { - auto absoluteDirectory = Path::GetAbsolute(directory); + auto absoluteDirectory = OpenRCT2::Path::GetAbsolute(directory); LOG_VERBOSE("FileIndex:Scanning for %s in '%s'", _pattern.c_str(), absoluteDirectory.c_str()); - auto pattern = Path::Combine(absoluteDirectory, _pattern); - auto scanner = Path::ScanDirectory(pattern, true); + auto pattern = OpenRCT2::Path::Combine(absoluteDirectory, _pattern); + auto scanner = OpenRCT2::Path::ScanDirectory(pattern, true); while (scanner->Next()) { const auto& fileInfo = scanner->GetFileInfo(); @@ -157,7 +157,7 @@ private: stats.TotalFileSize += fileInfo.Size; stats.FileDateModifiedChecksum ^= static_cast(fileInfo.LastModified >> 32) ^ static_cast(fileInfo.LastModified & 0xFFFFFFFF); - stats.FileDateModifiedChecksum = Numerics::ror32(stats.FileDateModifiedChecksum, 5); + stats.FileDateModifiedChecksum = OpenRCT2::Numerics::ror32(stats.FileDateModifiedChecksum, 5); stats.PathChecksum += GetPathChecksum(path); files.push_back(std::move(path)); @@ -193,7 +193,7 @@ private: std::vector Build(int32_t language, const ScanResult& scanResult) const { std::vector allItems; - Console::WriteLine("Building %s (%zu items)", _name.c_str(), scanResult.Files.size()); + OpenRCT2::Console::WriteLine("Building %s (%zu items)", _name.c_str(), scanResult.Files.size()); auto startTime = std::chrono::high_resolution_clock::now(); @@ -211,7 +211,8 @@ private: auto reportProgress = [&]() { const size_t completed = processed; - Console::WriteFormat("File %5zu of %zu, done %3d%%\r", completed, totalCount, completed * 100 / totalCount); + OpenRCT2::Console::WriteFormat( + "File %5zu of %zu, done %3d%%\r", completed, totalCount, completed * 100 / totalCount); OpenRCT2::GetContext()->SetProgress(static_cast(completed), static_cast(totalCount)); }; @@ -243,7 +244,7 @@ private: auto endTime = std::chrono::high_resolution_clock::now(); auto duration = std::chrono::duration(endTime - startTime); - Console::WriteLine("Finished building %s in %.2f seconds.", _name.c_str(), duration.count()); + OpenRCT2::Console::WriteLine("Finished building %s in %.2f seconds.", _name.c_str(), duration.count()); return allItems; } @@ -252,7 +253,7 @@ private: { bool loadedItems = false; std::vector items; - if (File::Exists(_indexPath)) + if (OpenRCT2::File::Exists(_indexPath)) { try { @@ -280,13 +281,13 @@ private: } else { - Console::WriteLine("%s out of date", _name.c_str()); + OpenRCT2::Console::WriteLine("%s out of date", _name.c_str()); } } catch (const std::exception& e) { - Console::Error::WriteLine("Unable to load index: '%s'.", _indexPath.c_str()); - Console::Error::WriteLine("%s", e.what()); + OpenRCT2::Console::Error::WriteLine("Unable to load index: '%s'.", _indexPath.c_str()); + OpenRCT2::Console::Error::WriteLine("%s", e.what()); } } return std::make_tuple(loadedItems, std::move(items)); @@ -297,7 +298,7 @@ private: try { LOG_VERBOSE("FileIndex:Writing index: '%s'", _indexPath.c_str()); - Path::CreateDirectory(Path::GetDirectory(_indexPath)); + OpenRCT2::Path::CreateDirectory(OpenRCT2::Path::GetDirectory(_indexPath)); auto fs = OpenRCT2::FileStream(_indexPath, OpenRCT2::FILE_MODE_WRITE); // Write header @@ -319,8 +320,8 @@ private: } catch (const std::exception& e) { - Console::Error::WriteLine("Unable to save index: '%s'.", _indexPath.c_str()); - Console::Error::WriteLine("%s", e.what()); + OpenRCT2::Console::Error::WriteLine("Unable to save index: '%s'.", _indexPath.c_str()); + OpenRCT2::Console::Error::WriteLine("%s", e.what()); } } diff --git a/src/openrct2/core/FileScanner.cpp b/src/openrct2/core/FileScanner.cpp index 9a27c99646..84c83253a7 100644 --- a/src/openrct2/core/FileScanner.cpp +++ b/src/openrct2/core/FileScanner.cpp @@ -32,6 +32,8 @@ #include #include +using namespace OpenRCT2; + enum class DIRECTORY_CHILD_TYPE { DC_DIRECTORY, diff --git a/src/openrct2/core/FileScanner.h b/src/openrct2/core/FileScanner.h index d68e9346eb..4f51d942a7 100644 --- a/src/openrct2/core/FileScanner.h +++ b/src/openrct2/core/FileScanner.h @@ -15,7 +15,7 @@ #include #include -namespace FileScanner +namespace OpenRCT2::FileScanner { struct FileInfo { @@ -23,13 +23,13 @@ namespace FileScanner uint64_t Size; uint64_t LastModified; }; -} // namespace FileScanner +} // namespace OpenRCT2::FileScanner struct IFileScanner { virtual ~IFileScanner() = default; - virtual const FileScanner::FileInfo& GetFileInfo() const = 0; + virtual const OpenRCT2::FileScanner::FileInfo& GetFileInfo() const = 0; virtual const u8string& GetPath() const = 0; virtual u8string GetPathRelative() const = 0; @@ -45,7 +45,7 @@ struct QueryDirectoryResult uint32_t PathChecksum; }; -namespace Path +namespace OpenRCT2::Path { /** * Scans a directory and optionally sub directories for files that matches the @@ -64,4 +64,4 @@ namespace Path void QueryDirectory(QueryDirectoryResult* result, const std::string& pattern); [[nodiscard]] std::vector GetDirectories(const std::string& path); -} // namespace Path +} // namespace OpenRCT2::Path diff --git a/src/openrct2/core/FileWatcher.cpp b/src/openrct2/core/FileWatcher.cpp index 8792b91bed..42b5c7e47e 100644 --- a/src/openrct2/core/FileWatcher.cpp +++ b/src/openrct2/core/FileWatcher.cpp @@ -31,6 +31,8 @@ #include "FileSystem.hpp" #include "FileWatcher.h" +using namespace OpenRCT2; + #if defined(__linux__) FileWatcher::FileDescriptor::~FileDescriptor() { diff --git a/src/openrct2/core/FixedVector.h b/src/openrct2/core/FixedVector.h index f00c9656a5..056eda03b3 100644 --- a/src/openrct2/core/FixedVector.h +++ b/src/openrct2/core/FixedVector.h @@ -91,13 +91,13 @@ public: constexpr void push_back(const T& val) { - Guard::Assert(_count < MAX); + OpenRCT2::Guard::Assert(_count < MAX); _data[_count++] = val; } constexpr void push_back(T&& val) { - Guard::Assert(_count < MAX); + OpenRCT2::Guard::Assert(_count < MAX); _data[_count++] = std::move(val); } @@ -129,7 +129,7 @@ public: template constexpr reference_type emplace_back(Args&&... args) { - Guard::Assert(_count < MAX); + OpenRCT2::Guard::Assert(_count < MAX); reference_type res = _data[_count++]; ::new (&res) T(std::forward(args)...); return res; diff --git a/src/openrct2/core/Guard.cpp b/src/openrct2/core/Guard.cpp index 8db96d80f8..513ec82f2c 100644 --- a/src/openrct2/core/Guard.cpp +++ b/src/openrct2/core/Guard.cpp @@ -24,7 +24,7 @@ #include #include -namespace Guard +namespace OpenRCT2::Guard { constexpr const utf8* ASSERTION_MESSAGE = "An assertion failed, please report this to the OpenRCT2 developers."; @@ -152,4 +152,4 @@ namespace Guard # endif } #endif -} // namespace Guard +} // namespace OpenRCT2::Guard diff --git a/src/openrct2/core/Guard.hpp b/src/openrct2/core/Guard.hpp index 3087e8b6ed..9809af5195 100644 --- a/src/openrct2/core/Guard.hpp +++ b/src/openrct2/core/Guard.hpp @@ -25,7 +25,7 @@ enum class ASSERT_BEHAVIOUR /** * Utility methods for asserting function parameters. */ -namespace Guard +namespace OpenRCT2::Guard { ASSERT_BEHAVIOUR GetAssertBehaviour(); void SetAssertBehaviour(ASSERT_BEHAVIOUR behaviour); @@ -66,6 +66,6 @@ namespace Guard Guard::Assert(index < container.size(), "Index %zu out of bounds (%zu)", index, container.size()); } -} // namespace Guard +} // namespace OpenRCT2::Guard #define GUARD_LINE "Location: %s:%d", __func__, __LINE__ diff --git a/src/openrct2/core/Http.Android.cpp b/src/openrct2/core/Http.Android.cpp index 67cb15eafc..3f4a478819 100644 --- a/src/openrct2/core/Http.Android.cpp +++ b/src/openrct2/core/Http.Android.cpp @@ -20,7 +20,7 @@ # define OPENRCT2_USER_AGENT "OpenRCT2/" OPENRCT2_VERSION -namespace Http +namespace OpenRCT2::Http { Response Do(const Request& req) { @@ -174,6 +174,6 @@ namespace Http return response; } -} // namespace Http +} // namespace OpenRCT2::Http #endif diff --git a/src/openrct2/core/Http.WinHttp.cpp b/src/openrct2/core/Http.WinHttp.cpp index 2ac68212ee..b75c3ce2cd 100644 --- a/src/openrct2/core/Http.WinHttp.cpp +++ b/src/openrct2/core/Http.WinHttp.cpp @@ -20,7 +20,7 @@ # include # include -namespace Http +namespace OpenRCT2::Http { static constexpr char OPENRCT2_USER_AGENT[] = "OpenRCT2/" OPENRCT2_VERSION; @@ -235,6 +235,6 @@ namespace Http throw; } } -} // namespace Http +} // namespace OpenRCT2::Http #endif diff --git a/src/openrct2/core/Http.cURL.cpp b/src/openrct2/core/Http.cURL.cpp index 67603998f9..11cf9e5f8b 100644 --- a/src/openrct2/core/Http.cURL.cpp +++ b/src/openrct2/core/Http.cURL.cpp @@ -27,7 +27,7 @@ # define OPENRCT2_USER_AGENT "OpenRCT2/" OPENRCT2_VERSION -namespace Http +namespace OpenRCT2::Http { static size_t WriteData(const char* src, size_t size, size_t nmemb, void* userdata) { @@ -161,6 +161,6 @@ namespace Http return res; } -} // namespace Http +} // namespace OpenRCT2::Http #endif diff --git a/src/openrct2/core/Http.h b/src/openrct2/core/Http.h index 5c0be551f8..7c03f88bdf 100644 --- a/src/openrct2/core/Http.h +++ b/src/openrct2/core/Http.h @@ -16,7 +16,7 @@ # include # include -namespace Http +namespace OpenRCT2::Http { enum class Status { @@ -69,6 +69,6 @@ namespace Http }); thread.detach(); } -} // namespace Http +} // namespace OpenRCT2::Http #endif // DISABLE_HTTP diff --git a/src/openrct2/core/Imaging.cpp b/src/openrct2/core/Imaging.cpp index d7912eb0ec..4dcd88d79b 100644 --- a/src/openrct2/core/Imaging.cpp +++ b/src/openrct2/core/Imaging.cpp @@ -26,7 +26,7 @@ #include #include -namespace Imaging +namespace OpenRCT2::Imaging { constexpr auto EXCEPTION_IMAGE_FORMAT_UNKNOWN = "Unknown image format."; @@ -342,4 +342,4 @@ namespace Imaging throw std::runtime_error(EXCEPTION_IMAGE_FORMAT_UNKNOWN); } } -} // namespace Imaging +} // namespace OpenRCT2::Imaging diff --git a/src/openrct2/core/Imaging.h b/src/openrct2/core/Imaging.h index 99adb55e20..854c7698c9 100644 --- a/src/openrct2/core/Imaging.h +++ b/src/openrct2/core/Imaging.h @@ -43,7 +43,7 @@ struct Image using ImageReaderFunc = std::function; -namespace Imaging +namespace OpenRCT2::Imaging { IMAGE_FORMAT GetImageFormatFromPath(std::string_view path); Image ReadFromFile(std::string_view path, IMAGE_FORMAT format = IMAGE_FORMAT::AUTOMATIC); @@ -51,4 +51,4 @@ namespace Imaging void WriteToFile(std::string_view path, const Image& image, IMAGE_FORMAT format = IMAGE_FORMAT::AUTOMATIC); void SetReader(IMAGE_FORMAT format, ImageReaderFunc impl); -} // namespace Imaging +} // namespace OpenRCT2::Imaging diff --git a/src/openrct2/core/Json.cpp b/src/openrct2/core/Json.cpp index ea5bc5c1c9..490921c74b 100644 --- a/src/openrct2/core/Json.cpp +++ b/src/openrct2/core/Json.cpp @@ -14,7 +14,7 @@ #include "Memory.hpp" #include "String.hpp" -namespace Json +namespace OpenRCT2::Json { json_t ReadFromFile(u8string_view path, size_t maxSize) { @@ -125,4 +125,4 @@ namespace Json return retVal; } -} // namespace Json +} // namespace OpenRCT2::Json diff --git a/src/openrct2/core/Json.hpp b/src/openrct2/core/Json.hpp index d97338fb75..ae53d6cf81 100644 --- a/src/openrct2/core/Json.hpp +++ b/src/openrct2/core/Json.hpp @@ -21,7 +21,7 @@ using json_t = nlohmann::json; -namespace Json +namespace OpenRCT2::Json { // Don't try to load JSON files that exceed 64 MiB constexpr uint64_t MAX_JSON_SIZE = 64 * 1024 * 1024; @@ -183,7 +183,7 @@ namespace Json } return flags; } -} // namespace Json +} // namespace OpenRCT2::Json class JsonException final : public std::runtime_error { diff --git a/src/openrct2/core/Memory.hpp b/src/openrct2/core/Memory.hpp index e5db502599..e24d410c06 100644 --- a/src/openrct2/core/Memory.hpp +++ b/src/openrct2/core/Memory.hpp @@ -18,7 +18,7 @@ /** * Utility methods for memory management. Typically helpers and wrappers around the C standard library. */ -namespace Memory +namespace OpenRCT2::Memory { template static T* Allocate() { @@ -85,4 +85,4 @@ namespace Memory } Free(ptr); } -} // namespace Memory +} // namespace OpenRCT2::Memory diff --git a/src/openrct2/core/Meta.hpp b/src/openrct2/core/Meta.hpp index d7bbe8f8c6..4a374bb15b 100644 --- a/src/openrct2/core/Meta.hpp +++ b/src/openrct2/core/Meta.hpp @@ -11,7 +11,7 @@ #include -namespace Meta +namespace OpenRCT2::Meta { /** * Meta function for checking that all Conditions are true types. @@ -27,4 +27,4 @@ namespace Meta template using all_convertible = all...>; -} // namespace Meta +} // namespace OpenRCT2::Meta diff --git a/src/openrct2/core/Numerics.hpp b/src/openrct2/core/Numerics.hpp index 4bcfacc00c..0dcfad3c04 100644 --- a/src/openrct2/core/Numerics.hpp +++ b/src/openrct2/core/Numerics.hpp @@ -14,7 +14,7 @@ #include #include -namespace Numerics +namespace OpenRCT2::Numerics { /** * Bitwise left rotate @@ -77,4 +77,4 @@ namespace Numerics const constexpr auto rol64 = rol; const constexpr auto ror64 = ror; -} // namespace Numerics +} // namespace OpenRCT2::Numerics diff --git a/src/openrct2/core/Path.cpp b/src/openrct2/core/Path.cpp index c329c6b588..cf50b7a0b6 100644 --- a/src/openrct2/core/Path.cpp +++ b/src/openrct2/core/Path.cpp @@ -19,7 +19,7 @@ #include -namespace Path +namespace OpenRCT2::Path { u8string Combine(u8string_view a, u8string_view b) { @@ -135,4 +135,4 @@ namespace Path const auto result = fs::remove_all(fs::u8path(path), ec); return (result > 0) && ec.value() == 0; } -} // namespace Path +} // namespace OpenRCT2::Path diff --git a/src/openrct2/core/Path.hpp b/src/openrct2/core/Path.hpp index 6cc7c0bf43..76d0a771cd 100644 --- a/src/openrct2/core/Path.hpp +++ b/src/openrct2/core/Path.hpp @@ -13,7 +13,7 @@ #include -namespace Path +namespace OpenRCT2::Path { [[nodiscard]] u8string Combine(u8string_view a, u8string_view b); @@ -42,4 +42,4 @@ namespace Path * Note: This will not resolve the case for Windows. */ u8string ResolveCasing(u8string_view path); -} // namespace Path +} // namespace OpenRCT2::Path diff --git a/src/openrct2/core/Random.hpp b/src/openrct2/core/Random.hpp index cfb7a96631..60aba243ec 100644 --- a/src/openrct2/core/Random.hpp +++ b/src/openrct2/core/Random.hpp @@ -20,7 +20,7 @@ #include #include -namespace Random +namespace OpenRCT2::Random { using namespace Numerics; @@ -194,4 +194,4 @@ namespace Random using Seed = FixedSeedSequence<2>; using State = Engine::state_type; } // namespace RCT2 -} // namespace Random +} // namespace OpenRCT2::Random diff --git a/src/openrct2/core/String.cpp b/src/openrct2/core/String.cpp index 693f8e44c4..06a68935af 100644 --- a/src/openrct2/core/String.cpp +++ b/src/openrct2/core/String.cpp @@ -38,7 +38,7 @@ # define _stricmp(x, y) strcasecmp((x), (y)) #endif -namespace String +namespace OpenRCT2::String { std::string ToStd(const utf8* str) { @@ -725,7 +725,7 @@ namespace String return escaped.str(); } -} // namespace String +} // namespace OpenRCT2::String char32_t CodepointView::iterator::GetNextCodepoint(const char* ch, const char** next) { diff --git a/src/openrct2/core/String.hpp b/src/openrct2/core/String.hpp index 591a135cbc..15ae6e9188 100644 --- a/src/openrct2/core/String.hpp +++ b/src/openrct2/core/String.hpp @@ -38,7 +38,7 @@ namespace OpenRCT2 }; } -namespace String +namespace OpenRCT2::String { constexpr const utf8* Empty = ""; @@ -186,7 +186,7 @@ namespace String // Escapes special characters in a string to the percentage equivalent that can be used in URLs. std::string URLEncode(std::string_view value); -} // namespace String +} // namespace OpenRCT2::String class CodepointView { @@ -250,7 +250,7 @@ public: }; CodepointView(std::string_view str) - : _str(String::UTF8Truncate(str, str.size())) + : _str(OpenRCT2::String::UTF8Truncate(str, str.size())) { } diff --git a/src/openrct2/core/StringBuilder.cpp b/src/openrct2/core/StringBuilder.cpp index 1a10d12485..f335e5345e 100644 --- a/src/openrct2/core/StringBuilder.cpp +++ b/src/openrct2/core/StringBuilder.cpp @@ -13,6 +13,8 @@ #include +using namespace OpenRCT2; + StringBuilder::StringBuilder(size_t capacity) { _buffer.reserve(capacity); diff --git a/src/openrct2/core/StringReader.cpp b/src/openrct2/core/StringReader.cpp index d5c1eff216..96acb035a1 100644 --- a/src/openrct2/core/StringReader.cpp +++ b/src/openrct2/core/StringReader.cpp @@ -12,6 +12,8 @@ #include "../util/Util.h" #include "String.hpp" +using namespace OpenRCT2; + UTF8StringReader::UTF8StringReader(const utf8* text) { text = String::SkipBOM(text); diff --git a/src/openrct2/core/UnicodeChar.h b/src/openrct2/core/UnicodeChar.h index eda8bf6d9c..fcee85d382 100644 --- a/src/openrct2/core/UnicodeChar.h +++ b/src/openrct2/core/UnicodeChar.h @@ -11,7 +11,7 @@ #include -namespace UnicodeChar +namespace OpenRCT2::UnicodeChar { // Latin alphabet constexpr char32_t j = 0x6A; @@ -227,4 +227,4 @@ namespace UnicodeChar // Misc constexpr char32_t superscript_minus_one = 0x207B; -}; // namespace UnicodeChar +}; // namespace OpenRCT2::UnicodeChar diff --git a/src/openrct2/core/Zip.cpp b/src/openrct2/core/Zip.cpp index 84bcb1be85..c2b930b2ae 100644 --- a/src/openrct2/core/Zip.cpp +++ b/src/openrct2/core/Zip.cpp @@ -376,7 +376,7 @@ private: }; }; -namespace Zip +namespace OpenRCT2::Zip { std::unique_ptr Open(std::string_view path, ZIP_ACCESS access) { @@ -395,6 +395,6 @@ namespace Zip } return result; } -} // namespace Zip +} // namespace OpenRCT2::Zip #endif diff --git a/src/openrct2/core/Zip.h b/src/openrct2/core/Zip.h index a590a67df3..e063936c2d 100644 --- a/src/openrct2/core/Zip.h +++ b/src/openrct2/core/Zip.h @@ -55,8 +55,8 @@ enum class ZIP_ACCESS WRITE, }; -namespace Zip +namespace OpenRCT2::Zip { [[nodiscard]] std::unique_ptr Open(std::string_view path, ZIP_ACCESS zipAccess); [[nodiscard]] std::unique_ptr TryOpen(std::string_view path, ZIP_ACCESS zipAccess); -} // namespace Zip +} // namespace OpenRCT2::Zip diff --git a/src/openrct2/core/ZipAndroid.cpp b/src/openrct2/core/ZipAndroid.cpp index adfdb117ac..cfd17ca736 100644 --- a/src/openrct2/core/ZipAndroid.cpp +++ b/src/openrct2/core/ZipAndroid.cpp @@ -136,7 +136,7 @@ public: } }; -namespace Zip +namespace OpenRCT2::Zip { std::unique_ptr Open(std::string_view path, ZIP_ACCESS access) { @@ -155,7 +155,7 @@ namespace Zip } return result; } -} // namespace Zip +} // namespace OpenRCT2::Zip extern "C" { JNIEXPORT jlong JNICALL Java_io_openrct2_ZipArchive_allocBytes(JNIEnv* env, jclass, jbyteArray input, jint numBytes); diff --git a/src/openrct2/drawing/AVX2Drawing.cpp b/src/openrct2/drawing/AVX2Drawing.cpp index 39b2d1e55b..aea86a804b 100644 --- a/src/openrct2/drawing/AVX2Drawing.cpp +++ b/src/openrct2/drawing/AVX2Drawing.cpp @@ -51,7 +51,7 @@ void MaskAvx2( int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst, int32_t maskWrap, int32_t colourWrap, int32_t dstWrap) { - Guard::Fail("AVX2 function called on a CPU that doesn't support AVX2"); + OpenRCT2::Guard::Fail("AVX2 function called on a CPU that doesn't support AVX2"); } #endif // __AVX2__ diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index 0e4e00ffd4..57d74a43d2 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -23,6 +23,8 @@ #include #include +using namespace OpenRCT2; + static constexpr int32_t SpriteFontLineHeight[FontStyleCount] = { 10, 10, diff --git a/src/openrct2/drawing/Image.cpp b/src/openrct2/drawing/Image.cpp index ec65717d15..dab2c01e27 100644 --- a/src/openrct2/drawing/Image.cpp +++ b/src/openrct2/drawing/Image.cpp @@ -19,6 +19,8 @@ #include #include +using namespace OpenRCT2; + constexpr uint32_t BASE_IMAGE_ID = SPR_IMAGE_LIST_BEGIN; constexpr uint32_t MAX_IMAGES = SPR_IMAGE_LIST_END - BASE_IMAGE_ID; diff --git a/src/openrct2/drawing/SSE41Drawing.cpp b/src/openrct2/drawing/SSE41Drawing.cpp index 3276634b1c..3177f81919 100644 --- a/src/openrct2/drawing/SSE41Drawing.cpp +++ b/src/openrct2/drawing/SSE41Drawing.cpp @@ -65,7 +65,7 @@ void MaskSse4_1( int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst, int32_t maskWrap, int32_t colourWrap, int32_t dstWrap) { - Guard::Fail("SSE 4.1 function called on a CPU that doesn't support SSE 4.1"); + OpenRCT2::Guard::Fail("SSE 4.1 function called on a CPU that doesn't support SSE 4.1"); } #endif // __SSE4_1__ diff --git a/src/openrct2/entity/EntityBase.cpp b/src/openrct2/entity/EntityBase.cpp index ac71e56e36..8402fb3388 100644 --- a/src/openrct2/entity/EntityBase.cpp +++ b/src/openrct2/entity/EntityBase.cpp @@ -11,6 +11,8 @@ #include "../core/DataSerialiser.h" +using namespace OpenRCT2; + // Required for GetEntity to return a default template<> bool EntityBase::Is() const { diff --git a/src/openrct2/entity/Fountain.h b/src/openrct2/entity/Fountain.h index dc44252ce0..9820afb8a3 100644 --- a/src/openrct2/entity/Fountain.h +++ b/src/openrct2/entity/Fountain.h @@ -49,7 +49,7 @@ private: static bool IsJumpingFountain(JumpingFountainType newType, const CoordsXYZ& newLoc); }; -namespace FOUNTAIN_FLAG +namespace OpenRCT2::FOUNTAIN_FLAG { const uint32_t FAST = 1 << 0; const uint32_t GOTO_EDGE = 1 << 1; @@ -57,4 +57,4 @@ namespace FOUNTAIN_FLAG const uint32_t TERMINATE = 1 << 3; const uint32_t BOUNCE = 1 << 4; const uint32_t DIRECTION = 1 << 7; -}; // namespace FOUNTAIN_FLAG +}; // namespace OpenRCT2::FOUNTAIN_FLAG diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index a188c493aa..2689e8338a 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -30,7 +30,7 @@ class Formatter; struct TileElement; struct PaintSession; -namespace GameActions +namespace OpenRCT2::GameActions { class Result; } @@ -394,7 +394,7 @@ public: // Peep bool CanBePickedUp() const; void Pickup(); void PickupAbort(int32_t old_x); - [[nodiscard]] GameActions::Result Place(const TileCoordsXYZ& location, bool apply); + [[nodiscard]] OpenRCT2::GameActions::Result Place(const TileCoordsXYZ& location, bool apply); void RemoveFromRide(); void FormatActionTo(Formatter&) const; void FormatNameTo(Formatter&) const; diff --git a/src/openrct2/entity/Staff.h b/src/openrct2/entity/Staff.h index 92daf85551..614236eac7 100644 --- a/src/openrct2/entity/Staff.h +++ b/src/openrct2/entity/Staff.h @@ -142,7 +142,7 @@ enum class EntertainerCostume : uint8_t extern const StringId StaffCostumeNames[EnumValue(EntertainerCostume::Count)]; colour_t StaffGetColour(StaffType staffType); -GameActions::Result StaffSetColour(StaffType staffType, colour_t value); +OpenRCT2::GameActions::Result StaffSetColour(StaffType staffType, colour_t value); uint32_t StaffGetAvailableEntertainerCostumes(); int32_t StaffGetAvailableEntertainerCostumeList(EntertainerCostume* costumeList); diff --git a/src/openrct2/interface/Colour.cpp b/src/openrct2/interface/Colour.cpp index 6a7ca15c42..b4bd48c3a4 100644 --- a/src/openrct2/interface/Colour.cpp +++ b/src/openrct2/interface/Colour.cpp @@ -64,7 +64,7 @@ void ColoursInitMaps() } } -namespace Colour +namespace OpenRCT2::Colour { static const EnumMap LookupTable{ { "black", COLOUR_BLACK }, @@ -140,7 +140,7 @@ namespace Colour return "black"; } -} // namespace Colour +} // namespace OpenRCT2::Colour #ifndef NO_TTF static BlendColourMapType BlendColourMap = { 0 }; diff --git a/src/openrct2/interface/Colour.h b/src/openrct2/interface/Colour.h index d333c6838b..180dc09c63 100644 --- a/src/openrct2/interface/Colour.h +++ b/src/openrct2/interface/Colour.h @@ -259,11 +259,11 @@ extern ColourShadeMap ColourMapA[COLOUR_COUNT]; void ColoursInitMaps(); -namespace Colour +namespace OpenRCT2::Colour { colour_t FromString(std::string_view s, colour_t defaultValue = COLOUR_BLACK); u8string ToString(colour_t colour); -} // namespace Colour +} // namespace OpenRCT2::Colour #ifndef NO_TTF uint8_t BlendColours(const uint8_t paletteIndex1, const uint8_t paletteIndex2); diff --git a/src/openrct2/interface/Cursors.cpp b/src/openrct2/interface/Cursors.cpp index f4018a4a84..f155866928 100644 --- a/src/openrct2/interface/Cursors.cpp +++ b/src/openrct2/interface/Cursors.cpp @@ -14,7 +14,7 @@ #include #include -namespace Cursor +namespace OpenRCT2::Cursor { static const EnumMap LookupTable{ { "CURSOR_BLANK", CursorID::Blank }, @@ -53,4 +53,4 @@ namespace Cursor auto result = LookupTable.find(s); return (result != LookupTable.end()) ? result->second : defaultValue; } -} // namespace Cursor +} // namespace OpenRCT2::Cursor diff --git a/src/openrct2/interface/Cursors.h b/src/openrct2/interface/Cursors.h index 796779c155..b18d1b43ce 100644 --- a/src/openrct2/interface/Cursors.h +++ b/src/openrct2/interface/Cursors.h @@ -46,7 +46,7 @@ enum class CursorID : uint8_t Undefined = 0xFF }; -namespace Cursor +namespace OpenRCT2::Cursor { CursorID FromString(const std::string& s, CursorID defaultValue); } diff --git a/src/openrct2/interface/StdInOutConsole.cpp b/src/openrct2/interface/StdInOutConsole.cpp index dc64a0930c..2909940bad 100644 --- a/src/openrct2/interface/StdInOutConsole.cpp +++ b/src/openrct2/interface/StdInOutConsole.cpp @@ -22,8 +22,6 @@ # pragma warning(disable : 4996) #endif -using namespace OpenRCT2; - void StdInOutConsole::Start() { // Only start if stdin/stdout is a TTY @@ -70,7 +68,7 @@ void StdInOutConsole::Start() std::future StdInOutConsole::Eval(const std::string& s) { #ifdef ENABLE_SCRIPTING - auto& scriptEngine = GetContext()->GetScriptEngine(); + auto& scriptEngine = OpenRCT2::GetContext()->GetScriptEngine(); return scriptEngine.Eval(s); #else // Push on-demand evaluations onto a queue so that it can be processed deterministically @@ -125,7 +123,7 @@ void StdInOutConsole::WriteLine(const std::string& s, FormatToken colourFormat) break; } - if (!Platform::IsColourTerminalSupported()) + if (!OpenRCT2::Platform::IsColourTerminalSupported()) { std::printf("%s\n", s.c_str()); std::fflush(stdout); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index aa1c7e7ce1..55a9d98c14 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -74,11 +74,11 @@ static constexpr float window_scroll_locations[][2] = { }; // clang-format on -namespace WindowCloseFlags +namespace OpenRCT2::WindowCloseFlags { static constexpr uint32_t None = 0; static constexpr uint32_t CloseSingle = (1 << 0); -} // namespace WindowCloseFlags +} // namespace OpenRCT2::WindowCloseFlags static void WindowDrawCore(DrawPixelInfo& dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom); static void WindowDrawSingle(DrawPixelInfo& dpi, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom); diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 2d5cff3e5f..ccb8f87b88 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -37,11 +37,15 @@ struct WindowCloseModifier; enum class VisibilityCache : uint8_t; enum class CursorID : uint8_t; -enum class RideConstructionState : uint8_t; enum class CloseWindowModifier : uint8_t; using rct_windownumber = uint16_t; +namespace OpenRCT2 +{ + enum class RideConstructionState : uint8_t; +} + struct WindowIdentifier { WindowClass classification; @@ -57,7 +61,7 @@ struct WidgetIdentifier extern WindowCloseModifier gLastCloseModifier; using WidgetFlags = uint32_t; -namespace WIDGET_FLAGS +namespace OpenRCT2::WIDGET_FLAGS { const WidgetFlags TEXT_IS_STRING = 1 << 0; const WidgetFlags IS_PRESSED = 1 << 2; @@ -65,7 +69,7 @@ namespace WIDGET_FLAGS const WidgetFlags TOOLTIP_IS_STRING = 1 << 4; const WidgetFlags IS_HIDDEN = 1 << 5; const WidgetFlags IS_HOLDABLE = 1 << 6; -} // namespace WIDGET_FLAGS +} // namespace OpenRCT2::WIDGET_FLAGS enum class WindowWidgetType : uint8_t; @@ -138,7 +142,7 @@ struct Widget bool IsVisible() const { - return !(flags & WIDGET_FLAGS::IS_HIDDEN); + return !(flags & OpenRCT2::WIDGET_FLAGS::IS_HIDDEN); } }; @@ -629,4 +633,4 @@ money64 PlaceProvisionalTrackPiece( RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndAlternativeState, const CoordsXYZ& trackPos); -extern RideConstructionState _rideConstructionState2; +extern OpenRCT2::RideConstructionState _rideConstructionState2; diff --git a/src/openrct2/localisation/Formatter.h b/src/openrct2/localisation/Formatter.h index 52acd0899a..94bd30e993 100644 --- a/src/openrct2/localisation/Formatter.h +++ b/src/openrct2/localisation/Formatter.h @@ -62,7 +62,7 @@ public: void Increment(size_t count) { auto finalCount = NumBytes() + count; - Guard::Assert(finalCount < Buffer.size(), "Increment is greater than buffer size!"); + OpenRCT2::Guard::Assert(finalCount < Buffer.size(), "Increment is greater than buffer size!"); if (finalCount < Buffer.size()) { CurrentBuf += count; diff --git a/src/openrct2/localisation/Language.cpp b/src/openrct2/localisation/Language.cpp index 66dc6d5af9..3df44bedd8 100644 --- a/src/openrct2/localisation/Language.cpp +++ b/src/openrct2/localisation/Language.cpp @@ -20,6 +20,8 @@ #include +using namespace OpenRCT2; + // clang-format off const LanguageDescriptor LanguagesDescriptors[LANGUAGE_COUNT] = { diff --git a/src/openrct2/localisation/LanguagePack.cpp b/src/openrct2/localisation/LanguagePack.cpp index 58594e3c43..0165c03987 100644 --- a/src/openrct2/localisation/LanguagePack.cpp +++ b/src/openrct2/localisation/LanguagePack.cpp @@ -25,6 +25,8 @@ #include #include +using namespace OpenRCT2; + // Don't try to load more than language files that exceed 64 MiB constexpr uint64_t MAX_LANGUAGE_SIZE = 64 * 1024 * 1024; constexpr uint64_t MAX_SCENARIO_OVERRIDES = 4096; @@ -475,7 +477,7 @@ private: } }; -namespace LanguagePackFactory +namespace OpenRCT2::LanguagePackFactory { std::unique_ptr FromFile(uint16_t id, const utf8* path) { @@ -494,4 +496,4 @@ namespace LanguagePackFactory auto languagePack = LanguagePack::FromText(id, text); return languagePack; } -} // namespace LanguagePackFactory +} // namespace OpenRCT2::LanguagePackFactory diff --git a/src/openrct2/localisation/LanguagePack.h b/src/openrct2/localisation/LanguagePack.h index 192d23e9a2..67393899f4 100644 --- a/src/openrct2/localisation/LanguagePack.h +++ b/src/openrct2/localisation/LanguagePack.h @@ -29,9 +29,9 @@ struct ILanguagePack virtual StringId GetScenarioOverrideStringId(const utf8* scenarioFilename, uint8_t index) = 0; }; -namespace LanguagePackFactory +namespace OpenRCT2::LanguagePackFactory { std::unique_ptr FromFile(uint16_t id, const utf8* path); std::unique_ptr FromLanguageId(uint16_t id); std::unique_ptr FromText(uint16_t id, const utf8* text); -} // namespace LanguagePackFactory +} // namespace OpenRCT2::LanguagePackFactory diff --git a/src/openrct2/management/Marketing.h b/src/openrct2/management/Marketing.h index 08c97bb47e..3392125761 100644 --- a/src/openrct2/management/Marketing.h +++ b/src/openrct2/management/Marketing.h @@ -53,7 +53,7 @@ struct MarketingCampaign }; }; -namespace MarketingCampaignFlags +namespace OpenRCT2::MarketingCampaignFlags { constexpr uint8_t FIRST_WEEK = 1 << 0; } diff --git a/src/openrct2/management/NewsItem.h b/src/openrct2/management/NewsItem.h index 279570b8f0..725514cabf 100644 --- a/src/openrct2/management/NewsItem.h +++ b/src/openrct2/management/NewsItem.h @@ -22,7 +22,7 @@ struct CoordsXYZ; class Formatter; -namespace News +namespace OpenRCT2::News { enum class ItemType : uint8_t { @@ -312,4 +312,4 @@ namespace News void AddItemToQueue(News::Item* newNewsItem); void RemoveItem(int32_t index); -} // namespace News +} // namespace OpenRCT2::News diff --git a/src/openrct2/management/Research.h b/src/openrct2/management/Research.h index 56638a0017..f956581365 100644 --- a/src/openrct2/management/Research.h +++ b/src/openrct2/management/Research.h @@ -25,7 +25,7 @@ namespace OpenRCT2 struct GameState_t; } -namespace Research +namespace OpenRCT2::Research { enum class EntryType : uint8_t { @@ -61,7 +61,7 @@ struct ResearchItem { ObjectEntryIndex entryIndex; uint8_t baseRideType; - Research::EntryType type; // 0: scenery entry, 1: ride entry + OpenRCT2::Research::EntryType type; // 0: scenery entry, 1: ride entry }; }; uint8_t flags; @@ -83,7 +83,7 @@ struct ResearchItem { } ResearchItem( - Research::EntryType _type, ObjectEntryIndex _entryIndex, uint8_t _baseRideType, ResearchCategory _category, + OpenRCT2::Research::EntryType _type, ObjectEntryIndex _entryIndex, uint8_t _baseRideType, ResearchCategory _category, uint8_t _flags) : entryIndex(_entryIndex) , baseRideType(_baseRideType) diff --git a/src/openrct2/network/DiscordService.cpp b/src/openrct2/network/DiscordService.cpp index 3fe20186df..b3a7375a71 100644 --- a/src/openrct2/network/DiscordService.cpp +++ b/src/openrct2/network/DiscordService.cpp @@ -24,6 +24,8 @@ # include # include +using namespace OpenRCT2; + namespace { using namespace std::chrono_literals; diff --git a/src/openrct2/network/NetworkConnection.cpp b/src/openrct2/network/NetworkConnection.cpp index 77fc4ea87b..474451493a 100644 --- a/src/openrct2/network/NetworkConnection.cpp +++ b/src/openrct2/network/NetworkConnection.cpp @@ -17,6 +17,8 @@ # include "Socket.h" # include "network.h" +using namespace OpenRCT2; + constexpr size_t NETWORK_DISCONNECT_REASON_BUFFER_SIZE = 256; constexpr size_t NetworkBufferSize = 1024 * 64; // 64 KiB, maximum packet size. diff --git a/src/openrct2/network/NetworkGroup.cpp b/src/openrct2/network/NetworkGroup.cpp index 1049d163a6..ed6ec8fde9 100644 --- a/src/openrct2/network/NetworkGroup.cpp +++ b/src/openrct2/network/NetworkGroup.cpp @@ -15,6 +15,8 @@ # include "NetworkAction.h" # include "NetworkTypes.h" +using namespace OpenRCT2; + NetworkGroup NetworkGroup::FromJson(const json_t& jsonData) { Guard::Assert(jsonData.is_object(), "NetworkGroup::FromJson expects parameter jsonData to be object"); diff --git a/src/openrct2/network/NetworkKey.cpp b/src/openrct2/network/NetworkKey.cpp index 5f53ba2a91..aec622e437 100644 --- a/src/openrct2/network/NetworkKey.cpp +++ b/src/openrct2/network/NetworkKey.cpp @@ -17,6 +17,8 @@ # include +using namespace OpenRCT2; + NetworkKey::NetworkKey() = default; NetworkKey::~NetworkKey() = default; diff --git a/src/openrct2/network/NetworkKey.h b/src/openrct2/network/NetworkKey.h index a0f64c5a67..36e8507ec8 100644 --- a/src/openrct2/network/NetworkKey.h +++ b/src/openrct2/network/NetworkKey.h @@ -20,7 +20,7 @@ namespace OpenRCT2 struct IStream; } -namespace Crypt +namespace OpenRCT2::Crypt { class RsaKey; } @@ -43,7 +43,7 @@ public: private: NetworkKey(const NetworkKey&) = delete; - std::unique_ptr _key; + std::unique_ptr _key; }; #endif // DISABLE_NETWORK diff --git a/src/openrct2/network/NetworkUser.cpp b/src/openrct2/network/NetworkUser.cpp index face41a365..36065bb761 100644 --- a/src/openrct2/network/NetworkUser.cpp +++ b/src/openrct2/network/NetworkUser.cpp @@ -21,6 +21,8 @@ # include +using namespace OpenRCT2; + constexpr const utf8* USER_STORE_FILENAME = "users.json"; std::unique_ptr NetworkUser::FromJson(const json_t& jsonData) diff --git a/src/openrct2/network/Socket.cpp b/src/openrct2/network/Socket.cpp index 4772a54484..68b3d05027 100644 --- a/src/openrct2/network/Socket.cpp +++ b/src/openrct2/network/Socket.cpp @@ -975,7 +975,7 @@ std::vector> GetBroadcastAddresses() return baddresses; } -namespace Convert +namespace OpenRCT2::Convert { uint16_t HostToNetwork(uint16_t value) { @@ -986,6 +986,6 @@ namespace Convert { return ntohs(value); } -} // namespace Convert +} // namespace OpenRCT2::Convert #endif diff --git a/src/openrct2/network/Socket.h b/src/openrct2/network/Socket.h index c1f1207f08..a0aa8b1341 100644 --- a/src/openrct2/network/Socket.h +++ b/src/openrct2/network/Socket.h @@ -101,8 +101,8 @@ public: [[nodiscard]] std::unique_ptr CreateUdpSocket(); [[nodiscard]] std::vector> GetBroadcastAddresses(); -namespace Convert +namespace OpenRCT2::Convert { uint16_t HostToNetwork(uint16_t value); uint16_t NetworkToHost(uint16_t value); -} // namespace Convert +} // namespace OpenRCT2::Convert diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index 0af8d505ee..f71d2afa04 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -27,7 +27,7 @@ constexpr uint16_t kMaxServerDescriptionLength = 256; class GameAction; struct Peep; struct CoordsXYZ; -namespace GameActions +namespace OpenRCT2::GameActions { class Result; } @@ -78,12 +78,12 @@ void NetworkSetPlayerGroup(uint32_t index, uint32_t groupindex); [[nodiscard]] uint8_t NetworkGetGroupID(uint32_t index); [[nodiscard]] int32_t NetworkGetNumGroups(); [[nodiscard]] const char* NetworkGetGroupName(uint32_t index); -[[nodiscard]] GameActions::Result NetworkSetPlayerGroup( +[[nodiscard]] OpenRCT2::GameActions::Result NetworkSetPlayerGroup( NetworkPlayerId_t actionPlayerId, NetworkPlayerId_t playerId, uint8_t groupId, bool isExecuting); -[[nodiscard]] GameActions::Result NetworkModifyGroups( +[[nodiscard]] OpenRCT2::GameActions::Result NetworkModifyGroups( NetworkPlayerId_t actionPlayerId, ModifyGroupType type, uint8_t groupId, const std::string& name, uint32_t permissionIndex, PermissionState permissionState, bool isExecuting); -[[nodiscard]] GameActions::Result NetworkKickPlayer(NetworkPlayerId_t playerId, bool isExecuting); +[[nodiscard]] OpenRCT2::GameActions::Result NetworkKickPlayer(NetworkPlayerId_t playerId, bool isExecuting); [[nodiscard]] uint8_t NetworkGetDefaultGroup(); [[nodiscard]] int32_t NetworkGetNumActions(); [[nodiscard]] StringId NetworkGetActionNameStringID(uint32_t index); diff --git a/src/openrct2/object/BannerObject.cpp b/src/openrct2/object/BannerObject.cpp index b9e6c3e1e6..96c16b047c 100644 --- a/src/openrct2/object/BannerObject.cpp +++ b/src/openrct2/object/BannerObject.cpp @@ -17,6 +17,8 @@ #include "../object/ObjectRepository.h" #include "ObjectList.h" +using namespace OpenRCT2; + void BannerObject::ReadLegacy(IReadObjectContext* context, OpenRCT2::IStream* stream) { stream->Seek(6, OpenRCT2::STREAM_SEEK_CURRENT); diff --git a/src/openrct2/object/EntranceObject.cpp b/src/openrct2/object/EntranceObject.cpp index d7632c24a3..1a2000c1ca 100644 --- a/src/openrct2/object/EntranceObject.cpp +++ b/src/openrct2/object/EntranceObject.cpp @@ -14,6 +14,8 @@ #include "../core/String.hpp" #include "../drawing/Drawing.h" +using namespace OpenRCT2; + void EntranceObject::ReadLegacy(IReadObjectContext* context, OpenRCT2::IStream* stream) { stream->Seek(6, OpenRCT2::STREAM_SEEK_CURRENT); diff --git a/src/openrct2/object/FootpathRailingsObject.cpp b/src/openrct2/object/FootpathRailingsObject.cpp index e133c8662a..f739bd6218 100644 --- a/src/openrct2/object/FootpathRailingsObject.cpp +++ b/src/openrct2/object/FootpathRailingsObject.cpp @@ -12,6 +12,8 @@ #include "../core/IStream.hpp" #include "../core/Json.hpp" +using namespace OpenRCT2; + void FootpathRailingsObject::Load() { GetStringTable().Sort(); diff --git a/src/openrct2/object/FootpathSurfaceObject.cpp b/src/openrct2/object/FootpathSurfaceObject.cpp index 9d9bf22100..80c808f0e5 100644 --- a/src/openrct2/object/FootpathSurfaceObject.cpp +++ b/src/openrct2/object/FootpathSurfaceObject.cpp @@ -15,6 +15,8 @@ #include "FootpathEntry.h" #include "ObjectRepository.h" +using namespace OpenRCT2; + void FootpathSurfaceObject::Load() { GetStringTable().Sort(); diff --git a/src/openrct2/object/LargeSceneryObject.cpp b/src/openrct2/object/LargeSceneryObject.cpp index 56b85a376f..b0d24dc5f4 100644 --- a/src/openrct2/object/LargeSceneryObject.cpp +++ b/src/openrct2/object/LargeSceneryObject.cpp @@ -22,6 +22,8 @@ #include +using namespace OpenRCT2; + static RCTLargeSceneryText ReadLegacy3DFont(OpenRCT2::IStream& stream) { RCTLargeSceneryText _3dFontLegacy = {}; diff --git a/src/openrct2/object/Object.h b/src/openrct2/object/Object.h index 1616c39c57..dac0f12964 100644 --- a/src/openrct2/object/Object.h +++ b/src/openrct2/object/Object.h @@ -29,7 +29,7 @@ constexpr size_t VersionNumFields = 3; using ObjectVersion = std::tuple; static_assert(std::tuple_size{} == VersionNumFields); -namespace ObjectSelectionFlags +namespace OpenRCT2::ObjectSelectionFlags { constexpr uint8_t Selected = (1 << 0); constexpr uint8_t InUse = (1 << 2); @@ -37,7 +37,7 @@ namespace ObjectSelectionFlags constexpr uint8_t AlwaysRequired = (1 << 4); constexpr uint8_t Flag6 = (1 << 5); constexpr uint8_t AllFlags = 0xFF; -}; // namespace ObjectSelectionFlags +}; // namespace OpenRCT2::ObjectSelectionFlags enum class ObjectSourceGame : uint8_t { diff --git a/src/openrct2/object/ObjectFactory.cpp b/src/openrct2/object/ObjectFactory.cpp index 42757eed43..6d82195985 100644 --- a/src/openrct2/object/ObjectFactory.cpp +++ b/src/openrct2/object/ObjectFactory.cpp @@ -48,6 +48,8 @@ #include #include +using namespace OpenRCT2; + struct IFileDataRetriever { virtual ~IFileDataRetriever() = default; @@ -211,7 +213,7 @@ public: } }; -namespace ObjectFactory +namespace OpenRCT2::ObjectFactory { /** * @param jRoot Must be JSON node of type object @@ -591,4 +593,4 @@ namespace ObjectFactory } return result; } -} // namespace ObjectFactory +} // namespace OpenRCT2::ObjectFactory diff --git a/src/openrct2/object/ObjectFactory.h b/src/openrct2/object/ObjectFactory.h index d4e95aa913..f0343f9928 100644 --- a/src/openrct2/object/ObjectFactory.h +++ b/src/openrct2/object/ObjectFactory.h @@ -19,7 +19,7 @@ class Object; struct RCTObjectEntry; enum class ObjectType : uint8_t; -namespace ObjectFactory +namespace OpenRCT2::ObjectFactory { [[nodiscard]] std::unique_ptr CreateObjectFromLegacyFile( IObjectRepository& objectRepository, const utf8* path, bool loadImages); @@ -31,4 +31,4 @@ namespace ObjectFactory [[nodiscard]] std::unique_ptr CreateObjectFromJsonFile( IObjectRepository& objectRepository, const std::string& path, bool loadImages); -} // namespace ObjectFactory +} // namespace OpenRCT2::ObjectFactory diff --git a/src/openrct2/object/ObjectRepository.h b/src/openrct2/object/ObjectRepository.h index f55b98ac7c..d92685379f 100644 --- a/src/openrct2/object/ObjectRepository.h +++ b/src/openrct2/object/ObjectRepository.h @@ -18,13 +18,10 @@ namespace OpenRCT2 { struct IStream; -} + struct IPlatformEnvironment; +} // namespace OpenRCT2 class Object; -namespace OpenRCT2 -{ - struct IPlatformEnvironment; -} namespace OpenRCT2::Localisation { @@ -55,8 +52,8 @@ struct ObjectRepositoryItem struct { uint8_t RideFlags; - uint8_t RideCategory[RCT2::ObjectLimits::MaxCategoriesPerRide]; - ride_type_t RideType[RCT2::ObjectLimits::MaxRideTypesPerRideEntry]; + uint8_t RideCategory[OpenRCT2::RCT2::ObjectLimits::MaxCategoriesPerRide]; + ride_type_t RideType[OpenRCT2::RCT2::ObjectLimits::MaxRideTypesPerRideEntry]; } RideInfo; struct { diff --git a/src/openrct2/object/PathAdditionObject.cpp b/src/openrct2/object/PathAdditionObject.cpp index 3119a4f270..59f225b6d3 100644 --- a/src/openrct2/object/PathAdditionObject.cpp +++ b/src/openrct2/object/PathAdditionObject.cpp @@ -19,6 +19,8 @@ #include +using namespace OpenRCT2; + void PathAdditionObject::ReadLegacy(IReadObjectContext* context, OpenRCT2::IStream* stream) { stream->Seek(6, OpenRCT2::STREAM_SEEK_CURRENT); diff --git a/src/openrct2/object/RideObject.h b/src/openrct2/object/RideObject.h index 1fa9c307b4..aa8b0afbd4 100644 --- a/src/openrct2/object/RideObject.h +++ b/src/openrct2/object/RideObject.h @@ -22,8 +22,8 @@ class RideObject final : public Object private: RideObjectEntry _legacyType = {}; VehicleColourPresetList _presetColours = {}; - std::vector _peepLoadingPositions[RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; - std::vector> _peepLoadingWaypoints[RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; + std::vector _peepLoadingPositions[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; + std::vector> _peepLoadingWaypoints[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; public: void* GetLegacyData() override diff --git a/src/openrct2/object/SmallSceneryObject.cpp b/src/openrct2/object/SmallSceneryObject.cpp index 7c07041125..0aeadbc9c1 100644 --- a/src/openrct2/object/SmallSceneryObject.cpp +++ b/src/openrct2/object/SmallSceneryObject.cpp @@ -20,6 +20,8 @@ #include "../localisation/Language.h" #include "../world/Scenery.h" +using namespace OpenRCT2; + void SmallSceneryObject::ReadLegacy(IReadObjectContext* context, OpenRCT2::IStream* stream) { stream->Seek(6, OpenRCT2::STREAM_SEEK_CURRENT); diff --git a/src/openrct2/object/StationObject.cpp b/src/openrct2/object/StationObject.cpp index 2f78a181a6..c2cde52a1b 100644 --- a/src/openrct2/object/StationObject.cpp +++ b/src/openrct2/object/StationObject.cpp @@ -15,6 +15,8 @@ #include "../drawing/Drawing.h" #include "../world/Banner.h" +using namespace OpenRCT2; + void StationObject::Load() { GetStringTable().Sort(); diff --git a/src/openrct2/object/StationObject.h b/src/openrct2/object/StationObject.h index c456eca6af..372204e18d 100644 --- a/src/openrct2/object/StationObject.h +++ b/src/openrct2/object/StationObject.h @@ -12,14 +12,14 @@ #include "../drawing/ImageId.hpp" #include "Object.h" -namespace STATION_OBJECT_FLAGS +namespace OpenRCT2::STATION_OBJECT_FLAGS { const uint32_t HAS_PRIMARY_COLOUR = 1 << 0; const uint32_t HAS_SECONDARY_COLOUR = 1 << 1; const uint32_t IS_TRANSPARENT = 1 << 2; const uint32_t NO_PLATFORMS = 1 << 3; const uint32_t HAS_SHELTER = (1 << 4); -} // namespace STATION_OBJECT_FLAGS +} // namespace OpenRCT2::STATION_OBJECT_FLAGS class StationObject final : public Object { diff --git a/src/openrct2/object/StringTable.cpp b/src/openrct2/object/StringTable.cpp index bbc3f64398..66d3e3a5ca 100644 --- a/src/openrct2/object/StringTable.cpp +++ b/src/openrct2/object/StringTable.cpp @@ -17,6 +17,8 @@ #include "../rct12/CSStringConverter.h" #include "Object.h" +using namespace OpenRCT2; + static constexpr uint8_t RCT2ToOpenRCT2LanguageId[] = { LANGUAGE_ENGLISH_UK, LANGUAGE_ENGLISH_US, diff --git a/src/openrct2/object/TerrainEdgeObject.cpp b/src/openrct2/object/TerrainEdgeObject.cpp index 9f35f804b5..5f34ad5849 100644 --- a/src/openrct2/object/TerrainEdgeObject.cpp +++ b/src/openrct2/object/TerrainEdgeObject.cpp @@ -16,6 +16,8 @@ #include "../drawing/Drawing.h" #include "ObjectManager.h" +using namespace OpenRCT2; + void TerrainEdgeObject::Load() { GetStringTable().Sort(); diff --git a/src/openrct2/object/TerrainSurfaceObject.cpp b/src/openrct2/object/TerrainSurfaceObject.cpp index 1f114d94d0..8a4750eb00 100644 --- a/src/openrct2/object/TerrainSurfaceObject.cpp +++ b/src/openrct2/object/TerrainSurfaceObject.cpp @@ -18,6 +18,8 @@ #include "../world/Location.hpp" #include "ObjectManager.h" +using namespace OpenRCT2; + void TerrainSurfaceObject::Load() { GetStringTable().Sort(); diff --git a/src/openrct2/object/WallObject.cpp b/src/openrct2/object/WallObject.cpp index 33aa78e7cb..16a0f8a790 100644 --- a/src/openrct2/object/WallObject.cpp +++ b/src/openrct2/object/WallObject.cpp @@ -17,6 +17,8 @@ #include "../localisation/Language.h" #include "../world/Banner.h" +using namespace OpenRCT2; + void WallObject::ReadLegacy(IReadObjectContext* context, OpenRCT2::IStream* stream) { stream->Seek(6, OpenRCT2::STREAM_SEEK_CURRENT); diff --git a/src/openrct2/object/WaterObject.cpp b/src/openrct2/object/WaterObject.cpp index f34f0a204f..bb80ffbf1f 100644 --- a/src/openrct2/object/WaterObject.cpp +++ b/src/openrct2/object/WaterObject.cpp @@ -23,6 +23,8 @@ #include #include +using namespace OpenRCT2; + void WaterObject::ReadLegacy(IReadObjectContext* context, OpenRCT2::IStream* stream) { stream->Seek(14, OpenRCT2::STREAM_SEEK_CURRENT); diff --git a/src/openrct2/paint/Paint.SessionFlags.h b/src/openrct2/paint/Paint.SessionFlags.h index 15c3d343c7..89b4ee8e61 100644 --- a/src/openrct2/paint/Paint.SessionFlags.h +++ b/src/openrct2/paint/Paint.SessionFlags.h @@ -11,8 +11,8 @@ #include -namespace PaintSessionFlags +namespace OpenRCT2::PaintSessionFlags { constexpr uint8_t PassedSurface = 1u << 0; constexpr uint8_t IsTrackPiecePreview = 1u << 1; -} // namespace PaintSessionFlags +} // namespace OpenRCT2::PaintSessionFlags diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 8daf6dbf7d..f3497c9a4a 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -300,13 +300,13 @@ static bool CheckBoundingBox(const PaintStructBoundBox& initialBBox, const Paint return false; } -namespace PaintSortFlags +namespace OpenRCT2::PaintSortFlags { static constexpr uint8_t None = 0; static constexpr uint8_t PendingVisit = (1u << 0); static constexpr uint8_t Neighbour = (1u << 1); static constexpr uint8_t OutsideQuadrant = (1u << 7); -} // namespace PaintSortFlags +} // namespace OpenRCT2::PaintSortFlags static PaintStruct* PaintStructsFirstInQuadrant(PaintStruct* psNext, uint16_t quadrantIndex) { diff --git a/src/openrct2/paint/support/MetalSupports.cpp b/src/openrct2/paint/support/MetalSupports.cpp index c181cd161a..ae146b5cf9 100644 --- a/src/openrct2/paint/support/MetalSupports.cpp +++ b/src/openrct2/paint/support/MetalSupports.cpp @@ -17,6 +17,8 @@ #include "../Paint.SessionFlags.h" #include "../Paint.h" +using namespace OpenRCT2; + constexpr auto kMetalSupportSkip = 9 * 4 * 2; /** rct2: 0x0097AF20, 0x0097AF21 */ diff --git a/src/openrct2/paint/support/WoodenSupports.cpp b/src/openrct2/paint/support/WoodenSupports.cpp index 73aebb070b..c8ea84d8f3 100644 --- a/src/openrct2/paint/support/WoodenSupports.cpp +++ b/src/openrct2/paint/support/WoodenSupports.cpp @@ -19,6 +19,8 @@ #include +using namespace OpenRCT2; + constexpr auto kNumWoodenSupportTypes = 2; constexpr auto kNumWoodenSupportSubTypes = 6; diff --git a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp index 344412c353..df7c17b37c 100644 --- a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp +++ b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp @@ -15,6 +15,8 @@ #include "../../profiling/Profiling.h" #include "Paint.TileElement.h" +using namespace OpenRCT2; + static ImageIndex GetEdgeImageOffset(edge_t edge) { switch (edge) diff --git a/src/openrct2/paint/track/Segment.h b/src/openrct2/paint/track/Segment.h index 6d093eb5ab..33e9ed121e 100644 --- a/src/openrct2/paint/track/Segment.h +++ b/src/openrct2/paint/track/Segment.h @@ -13,7 +13,7 @@ #include -namespace BlockedSegments +namespace OpenRCT2::BlockedSegments { constexpr uint16_t kStraightFlat = EnumsToFlags( PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide); @@ -25,4 +25,4 @@ namespace BlockedSegments PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomCorner, PaintSegment::bottomRightSide), EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::leftCorner, PaintSegment::topLeftSide), }; -} // namespace BlockedSegments +} // namespace OpenRCT2::BlockedSegments diff --git a/src/openrct2/paint/track/Support.h b/src/openrct2/paint/track/Support.h index 3e8a2cbe74..913200bce6 100644 --- a/src/openrct2/paint/track/Support.h +++ b/src/openrct2/paint/track/Support.h @@ -13,7 +13,7 @@ constexpr int8_t kDefaultGeneralSupportHeight = 32; -namespace SupportedSequences +namespace OpenRCT2::SupportedSequences { constexpr MetalSupportPlace kDiagStraightFlat[] = { MetalSupportPlace::None, MetalSupportPlace::None, MetalSupportPlace::None, MetalSupportPlace::LeftCorner }; diff --git a/src/openrct2/park/Legacy.cpp b/src/openrct2/park/Legacy.cpp index 38707cb75a..a914f6d29e 100644 --- a/src/openrct2/park/Legacy.cpp +++ b/src/openrct2/park/Legacy.cpp @@ -14,6 +14,8 @@ #include +using namespace OpenRCT2; + static std::map oldObjectIds = { { "official.scgpanda", "rct2dlc.scenery_group.scgpanda" }, { "official.wtrpink", "rct2dlc.water.wtrpink" }, diff --git a/src/openrct2/park/Legacy.h b/src/openrct2/park/Legacy.h index 5adc1c59a4..b077bae558 100644 --- a/src/openrct2/park/Legacy.h +++ b/src/openrct2/park/Legacy.h @@ -6,13 +6,15 @@ * * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ + #pragma once + #include "../object/Object.h" #include #include -namespace RCT2 +namespace OpenRCT2::RCT2 { struct FootpathMapping; } @@ -21,8 +23,8 @@ class ObjectList; std::string_view MapToNewObjectIdentifier(std::string_view s); std::optional GetDATPathName(std::string_view newPathName); -const RCT2::FootpathMapping* GetFootpathMapping(const ObjectEntryDescriptor& desc); +const OpenRCT2::RCT2::FootpathMapping* GetFootpathMapping(const ObjectEntryDescriptor& desc); void UpdateFootpathsFromMapping( ObjectEntryIndex* pathToSurfaceMap, ObjectEntryIndex* pathToQueueSurfaceMap, ObjectEntryIndex* pathToRailingsMap, ObjectList& requiredObjects, ObjectEntryIndex& surfaceCount, ObjectEntryIndex& railingCount, ObjectEntryIndex entryIndex, - const RCT2::FootpathMapping* footpathMapping); + const OpenRCT2::RCT2::FootpathMapping* footpathMapping); diff --git a/src/openrct2/platform/Platform.Android.cpp b/src/openrct2/platform/Platform.Android.cpp index 678f91ae27..59effb1f70 100644 --- a/src/openrct2/platform/Platform.Android.cpp +++ b/src/openrct2/platform/Platform.Android.cpp @@ -32,7 +32,7 @@ jmethodID AndroidClassLoader::_findClassMethod; // available until after JNI_OnLoad is called. static std::shared_ptr acl; -namespace Platform +namespace OpenRCT2::Platform { std::string GetFolderPath(SPECIAL_FOLDER folder) { @@ -192,7 +192,7 @@ namespace Platform AndroidClassLoader::_classLoader, AndroidClassLoader::_findClassMethod, env->NewStringUTF(std::string(name).c_str()))); } -} // namespace Platform +} // namespace OpenRCT2::Platform JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* pjvm, void* reserved) { diff --git a/src/openrct2/platform/Platform.Common.cpp b/src/openrct2/platform/Platform.Common.cpp index 2183f02044..8c14c5d8fe 100644 --- a/src/openrct2/platform/Platform.Common.cpp +++ b/src/openrct2/platform/Platform.Common.cpp @@ -45,7 +45,7 @@ static constexpr std::array _prohibitedCharacters = { '<', '>', '*', '\\', ':', static constexpr std::array _prohibitedCharacters = { '/' }; #endif -namespace Platform +namespace OpenRCT2::Platform { CurrencyType GetCurrencyValue(const char* currCode) { @@ -202,4 +202,4 @@ namespace Platform return false; } -} // namespace Platform +} // namespace OpenRCT2::Platform diff --git a/src/openrct2/platform/Platform.Linux.cpp b/src/openrct2/platform/Platform.Linux.cpp index 5a159cbade..120260a8a6 100644 --- a/src/openrct2/platform/Platform.Linux.cpp +++ b/src/openrct2/platform/Platform.Linux.cpp @@ -37,7 +37,7 @@ # include "../localisation/Language.h" # include "Platform.h" -namespace Platform +namespace OpenRCT2::Platform { std::string GetFolderPath(SPECIAL_FOLDER folder) { @@ -391,6 +391,6 @@ namespace Platform return path; } # endif // NO_TTF -} // namespace Platform +} // namespace OpenRCT2::Platform #endif diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp index 01443a2b10..5ca8d697ee 100644 --- a/src/openrct2/platform/Platform.Posix.cpp +++ b/src/openrct2/platform/Platform.Posix.cpp @@ -34,7 +34,7 @@ // The name of the mutex used to prevent multiple instances of the game from running static constexpr const utf8* SINGLE_INSTANCE_MUTEX_NAME = u8"openrct2.lock"; -namespace Platform +namespace OpenRCT2::Platform { std::string GetEnvironmentVariable(std::string_view name) { @@ -369,6 +369,6 @@ namespace Platform datetime64 utcNow = epochAsTicks + utcEpochTicks; return utcNow; } -} // namespace Platform +} // namespace OpenRCT2::Platform #endif diff --git a/src/openrct2/platform/Platform.Win32.cpp b/src/openrct2/platform/Platform.Win32.cpp index 846c9ee693..0a7b7c92f0 100644 --- a/src/openrct2/platform/Platform.Win32.cpp +++ b/src/openrct2/platform/Platform.Win32.cpp @@ -52,7 +52,7 @@ static constexpr wchar_t SINGLE_INSTANCE_MUTEX_NAME[] = L"RollerCoaster Tycoon 2 # define SOFTWARE_CLASSES L"Software\\Classes" # define MUI_CACHE L"Local Settings\\Software\\Microsoft\\Windows\\Shell\\MuiCache" -namespace Platform +namespace OpenRCT2::Platform { static std::string WIN32_GetKnownFolderPath(REFKNOWNFOLDERID rfid); static std::string WIN32_GetModuleFileNameW(HMODULE hModule); @@ -888,6 +888,6 @@ namespace Platform return false; } -} // namespace Platform +} // namespace OpenRCT2::Platform #endif diff --git a/src/openrct2/platform/Platform.h b/src/openrct2/platform/Platform.h index 55248a2db3..c263c8cb72 100644 --- a/src/openrct2/platform/Platform.h +++ b/src/openrct2/platform/Platform.h @@ -45,7 +45,7 @@ struct RealWorldDate; struct RealWorldTime; struct TTFFontDescriptor; -namespace Platform +namespace OpenRCT2::Platform { std::string GetEnvironmentVariable(std::string_view name); std::string GetFolderPath(SPECIAL_FOLDER folder); @@ -127,7 +127,7 @@ namespace Platform bool SSE41Available(); bool AVX2Available(); -} // namespace Platform +} // namespace OpenRCT2::Platform #ifdef __ANDROID__ class AndroidClassLoader diff --git a/src/openrct2/platform/Platform.macOS.mm b/src/openrct2/platform/Platform.macOS.mm index 3f7789bcaa..a3ff1ebb09 100644 --- a/src/openrct2/platform/Platform.macOS.mm +++ b/src/openrct2/platform/Platform.macOS.mm @@ -28,7 +28,7 @@ # include # include -namespace Platform +namespace OpenRCT2::Platform { std::string GetFolderPath(SPECIAL_FOLDER folder) { diff --git a/src/openrct2/rct1/Limits.h b/src/openrct2/rct1/Limits.h index e431f43c8a..00e3d7b320 100644 --- a/src/openrct2/rct1/Limits.h +++ b/src/openrct2/rct1/Limits.h @@ -10,7 +10,7 @@ #pragma once #include "../rct12/Limits.h" -namespace RCT1::Limits +namespace OpenRCT2::RCT1::Limits { using namespace RCT12::Limits; constexpr uint16_t kMaxTileElements = 0xC000; @@ -25,4 +25,4 @@ namespace RCT1::Limits constexpr uint32_t kLLCsg1DatFileSize = 41402869; constexpr uint32_t kNumTerrainSurfaces = 16; constexpr uint32_t kNumTerrainEdges = 15; -} // namespace RCT1::Limits +} // namespace OpenRCT2::RCT1::Limits diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index e4cb2cc1ac..b1b6df3510 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -18,7 +18,7 @@ enum class VehicleColourSettings : uint8_t; -namespace RCT1 +namespace OpenRCT2::RCT1 { constexpr uint8_t RCT1ResearchFlagsSeparator = 0xFF; @@ -1293,4 +1293,4 @@ namespace RCT1 }; track_type_t RCT1TrackTypeToOpenRCT2(RCT12TrackType origTrackType, ride_type_t rideType); -} // namespace RCT1 +} // namespace OpenRCT2::RCT1 diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index dd87c66a24..47c8dceff1 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -82,7 +82,7 @@ using namespace OpenRCT2; static constexpr ObjectEntryIndex ObjectEntryIndexIgnore = 254; -namespace RCT1 +namespace OpenRCT2::RCT1 { class S4Importer final : public IParkImporter { @@ -3223,7 +3223,7 @@ namespace RCT1 break; } } -} // namespace RCT1 +} // namespace OpenRCT2::RCT1 std::unique_ptr ParkImporter::CreateS4() { diff --git a/src/openrct2/rct1/T4Importer.cpp b/src/openrct2/rct1/T4Importer.cpp index abd286a930..d6602afa3e 100644 --- a/src/openrct2/rct1/T4Importer.cpp +++ b/src/openrct2/rct1/T4Importer.cpp @@ -23,7 +23,9 @@ #include -namespace RCT1 +using namespace OpenRCT2; + +namespace OpenRCT2::RCT1 { /** * Class to import RollerCoaster Tycoon 1 track designs (*.TD4). @@ -264,7 +266,7 @@ namespace RCT1 return td; } }; -} // namespace RCT1 +} // namespace OpenRCT2::RCT1 std::unique_ptr TrackImporter::CreateTD4() { diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index 73ceed76f1..078234035f 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -21,7 +21,7 @@ #include // clang-format off -namespace RCT1 +namespace OpenRCT2::RCT1 { colour_t GetColour(colour_t colour) { @@ -68,7 +68,7 @@ namespace RCT1 return map[colour]; } - ::PeepSpriteType GetPeepSpriteType(::RCT1::PeepSpriteType rct1SpriteType) + ::PeepSpriteType GetPeepSpriteType(RCT1::PeepSpriteType rct1SpriteType) { static constexpr ::PeepSpriteType map[] = { @@ -1517,4 +1517,4 @@ namespace RCT1 return false; } } -} // namespace RCT1 +} // namespace OpenRCT2::RCT1 diff --git a/src/openrct2/rct1/Tables.h b/src/openrct2/rct1/Tables.h index bf4cc70674..e5a6a1d05f 100644 --- a/src/openrct2/rct1/Tables.h +++ b/src/openrct2/rct1/Tables.h @@ -14,7 +14,7 @@ #include -namespace RCT1 +namespace OpenRCT2::RCT1 { struct VehicleColourSchemeCopyDescriptor { @@ -55,4 +55,4 @@ namespace RCT1 const std::vector GetSceneryObjects(uint8_t sceneryType); bool VehicleTypeIsReversed(const VehicleType vehicleType); -} // namespace RCT1 +} // namespace OpenRCT2::RCT1 diff --git a/src/openrct2/rct12/CSChar.h b/src/openrct2/rct12/CSChar.h index 763ace841c..bdc31e852f 100644 --- a/src/openrct2/rct12/CSChar.h +++ b/src/openrct2/rct12/CSChar.h @@ -11,7 +11,7 @@ #include -namespace CSChar +namespace OpenRCT2::CSChar { constexpr char32_t quote_close = 0x22; @@ -52,4 +52,4 @@ namespace CSChar constexpr char32_t z_acute = 0xFE; constexpr char32_t z_dot = 0xFD; -} // namespace CSChar +} // namespace OpenRCT2::CSChar diff --git a/src/openrct2/rct12/CSStringConverter.cpp b/src/openrct2/rct12/CSStringConverter.cpp index a17239ad3c..5b739e249b 100644 --- a/src/openrct2/rct12/CSStringConverter.cpp +++ b/src/openrct2/rct12/CSStringConverter.cpp @@ -20,6 +20,8 @@ #include #include +using namespace OpenRCT2; + struct EncodingConvertEntry { uint16_t code; diff --git a/src/openrct2/rct12/EntryList.h b/src/openrct2/rct12/EntryList.h index 8250afccfc..31479e92e1 100644 --- a/src/openrct2/rct12/EntryList.h +++ b/src/openrct2/rct12/EntryList.h @@ -16,7 +16,7 @@ using ObjectEntryIndex = uint16_t; -namespace RCT12 +namespace OpenRCT2::RCT12 { class EntryList { @@ -63,4 +63,4 @@ namespace RCT12 } } }; -} // namespace RCT12 +} // namespace OpenRCT2::RCT12 diff --git a/src/openrct2/rct12/Limits.h b/src/openrct2/rct12/Limits.h index 218b1635fa..e1a9d69009 100644 --- a/src/openrct2/rct12/Limits.h +++ b/src/openrct2/rct12/Limits.h @@ -10,7 +10,7 @@ #pragma once #include -namespace RCT12::Limits +namespace OpenRCT2::RCT12::Limits { constexpr uint8_t MaxRideObjects = 128; @@ -46,4 +46,4 @@ namespace RCT12::Limits constexpr uint8_t kCustomerHistorySize = 10; constexpr uint8_t kMaxWaitingTime = 250; -} // namespace RCT12::Limits +} // namespace OpenRCT2::RCT12::Limits diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index da95ad54be..f72aaa8f96 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -574,7 +574,7 @@ std::string RCT12RemoveFormattingUTF8(std::string_view s) return result; } -namespace RCT12FormatCode +namespace OpenRCT2::RCT12FormatCode { constexpr codepoint_t Newline = 5; constexpr codepoint_t NewlineSmall = 6; @@ -592,7 +592,7 @@ namespace RCT12FormatCode constexpr codepoint_t ColourLightPink = 153; constexpr codepoint_t ColourPearlAqua = 154; constexpr codepoint_t ColourPaleSilver = 155; -} // namespace RCT12FormatCode +} // namespace OpenRCT2::RCT12FormatCode static FormatToken GetFormatTokenFromRCT12Code(codepoint_t codepoint) { @@ -943,7 +943,7 @@ void ImportMazeElement(TrackDesign& td, const TD46MazeElement& td46MazeElement) } } -namespace RCT12 +namespace OpenRCT2::RCT12 { size_t GetRCTStringBufferLen(const char* buffer, size_t maxBufferLen) { @@ -973,4 +973,4 @@ namespace RCT12 } return len; } -} // namespace RCT12 +} // namespace OpenRCT2::RCT12 diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index f26cb808f7..140048ce08 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -25,7 +25,7 @@ class ObjectList; using track_type_t = uint16_t; using RCT12TrackType = uint8_t; -namespace RCT12 +namespace OpenRCT2::RCT12 { class EntryList; } @@ -830,17 +830,17 @@ static_assert(sizeof(RCT12PeepThought) == 4); struct RCT12RideMeasurement { - 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 + 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[OpenRCT2::RCT12::Limits::RideMeasurementMaxItems]; // 0x000C + int8_t Lateral[OpenRCT2::RCT12::Limits::RideMeasurementMaxItems]; // 0x12CC + uint8_t Velocity[OpenRCT2::RCT12::Limits::RideMeasurementMaxItems]; // 0x258C + uint8_t Altitude[OpenRCT2::RCT12::Limits::RideMeasurementMaxItems]; // 0x384C }; static_assert(sizeof(RCT12RideMeasurement) == 0x4B0C); @@ -913,7 +913,7 @@ std::string_view GetStationIdentifierFromStyle(uint8_t style); uint8_t GetStationStyleFromIdentifier(u8string_view identifier); std::optional GetStyleFromMusicIdentifier(std::string_view identifier); void RCT12AddDefaultObjects(ObjectList& objectList); -void AppendRequiredObjects(ObjectList& objectList, ObjectType objectType, const RCT12::EntryList& entryList); +void AppendRequiredObjects(ObjectList& objectList, ObjectType objectType, const OpenRCT2::RCT12::EntryList& entryList); bool IsUserStringID(StringId stringId); static constexpr money32 RCT12_COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x80000001; @@ -923,7 +923,7 @@ money64 RCT12CompletedCompanyValueToOpenRCT2(money32 origValue); template std::vector RCT12GetRideTypesBeenOn(T* srcPeep) { std::vector ridesTypesBeenOn; - for (uint16_t i = 0; i < RCT12::Limits::MaxRideObjects; i++) + for (uint16_t i = 0; i < OpenRCT2::RCT12::Limits::MaxRideObjects; i++) { if (srcPeep->RideTypesBeenOn[i / 8] & (1 << (i % 8))) { @@ -935,7 +935,7 @@ template std::vector RCT12GetRideTypesBeenOn(T* srcPeep) template std::vector RCT12GetRidesBeenOn(T* srcPeep) { std::vector ridesBeenOn; - for (uint16_t i = 0; i < RCT12::Limits::kMaxRidesInPark; i++) + for (uint16_t i = 0; i < OpenRCT2::RCT12::Limits::kMaxRidesInPark; i++) { if (srcPeep->RidesBeenOn[i / 8] & (1 << (i % 8))) { @@ -958,11 +958,11 @@ void ConvertFromTD46Flags(TrackDesignTrackElement& target, uint8_t flags); uint8_t ConvertToTD46Flags(const TrackDesignTrackElement& source); void ImportMazeElement(TrackDesign& td, const TD46MazeElement& td46MazeElement); -namespace RCT12 +namespace OpenRCT2::RCT12 { /** * Iterates an RCT string buffer and returns the length of the string in bytes. * Handles single and multi-byte strings. */ size_t GetRCTStringBufferLen(const char* buffer, size_t maxBufferLen); -} // namespace RCT12 +} // namespace OpenRCT2::RCT12 diff --git a/src/openrct2/rct12/SawyerChunkReader.cpp b/src/openrct2/rct12/SawyerChunkReader.cpp index df1e38b95f..1a2e815ca8 100644 --- a/src/openrct2/rct12/SawyerChunkReader.cpp +++ b/src/openrct2/rct12/SawyerChunkReader.cpp @@ -12,10 +12,15 @@ #include "../core/IStream.hpp" #include "../core/Numerics.hpp" +using namespace OpenRCT2; + // malloc is very slow for large allocations in MSVC debug builds as it allocates // memory on a special debug heap and then initialises all the memory to 0xCC. #if defined(_WIN32) && defined(DEBUG) # define __USE_HEAP_ALLOC__ +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # include #endif diff --git a/src/openrct2/rct12/SawyerChunkWriter.cpp b/src/openrct2/rct12/SawyerChunkWriter.cpp index 74c63529b9..765319666a 100644 --- a/src/openrct2/rct12/SawyerChunkWriter.cpp +++ b/src/openrct2/rct12/SawyerChunkWriter.cpp @@ -13,6 +13,8 @@ #include "../core/Numerics.hpp" #include "../util/SawyerCoding.h" +using namespace OpenRCT2; + // Maximum buffer size to store compressed data, maximum of 16 MiB constexpr size_t MAX_COMPRESSED_CHUNK_SIZE = 16 * 1024 * 1024; diff --git a/src/openrct2/rct2/DATLimits.h b/src/openrct2/rct2/DATLimits.h index 273160025a..586eedca91 100644 --- a/src/openrct2/rct2/DATLimits.h +++ b/src/openrct2/rct2/DATLimits.h @@ -10,7 +10,7 @@ #pragma once #include -namespace RCT2::ObjectLimits +namespace OpenRCT2::RCT2::ObjectLimits { constexpr uint8_t MaxCategoriesPerRide = 2; constexpr uint8_t MaxRideTypesPerRideEntry = 3; @@ -18,4 +18,4 @@ namespace RCT2::ObjectLimits // Examples of cars here are the locomotive, tender and carriage of the Miniature Railway. constexpr uint8_t MaxCarTypesPerRideEntry = 4; constexpr uint8_t MaxShopItemsPerRideEntry = 2; -} // namespace RCT2::ObjectLimits +} // namespace OpenRCT2::RCT2::ObjectLimits diff --git a/src/openrct2/rct2/Limits.h b/src/openrct2/rct2/Limits.h index 6f425051a5..c085b402d5 100644 --- a/src/openrct2/rct2/Limits.h +++ b/src/openrct2/rct2/Limits.h @@ -10,7 +10,7 @@ #pragma once #include "../rct12/Limits.h" -namespace RCT2::Limits +namespace OpenRCT2::RCT2::Limits { using namespace RCT12::Limits; constexpr uint8_t kMaxStaff = 200; @@ -45,4 +45,4 @@ namespace RCT2::Limits constexpr uint8_t kMaxWaterObjects = 1; constexpr uint8_t kMaxScenarioTextObjects = 1; constexpr uint16_t kMaxMapSize = 256; -} // namespace RCT2::Limits +} // namespace OpenRCT2::RCT2::Limits diff --git a/src/openrct2/rct2/RCT2.cpp b/src/openrct2/rct2/RCT2.cpp index 2d80c32106..660cd04215 100644 --- a/src/openrct2/rct2/RCT2.cpp +++ b/src/openrct2/rct2/RCT2.cpp @@ -19,7 +19,7 @@ #include -namespace RCT2 +namespace OpenRCT2::RCT2 { ObjectEntryIndex RCT2RideTypeToOpenRCT2RideType(uint8_t rct2RideType, const RideObjectEntry& rideEntry) { @@ -268,4 +268,4 @@ namespace RCT2 { return (Flags & 0xFC) >> 2; } -} // namespace RCT2 +} // namespace OpenRCT2::RCT2 diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index ddec8d53eb..220186ea87 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -24,7 +24,7 @@ class ObjectList; enum class EditorStep : uint8_t; enum class VehicleColourSettings : uint8_t; -namespace RCT2 +namespace OpenRCT2::RCT2 { constexpr StringId RCT2_RIDE_STRING_START = 2; @@ -1062,6 +1062,6 @@ namespace RCT2 "rct1ll.terrain_edge.green", "rct1ll.terrain_edge.stone_brown", "rct1ll.terrain_edge.stone_grey", "rct1ll.terrain_edge.skyscraper_a", "rct1ll.terrain_edge.skyscraper_b", }; -} // namespace RCT2 +} // namespace OpenRCT2::RCT2 std::vector DecryptSea(const fs::path& path); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 8b43059a21..982edd97f0 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -79,7 +79,7 @@ using namespace OpenRCT2; -namespace RCT2 +namespace OpenRCT2::RCT2 { #define DECRYPT_MONEY(money) (static_cast(Numerics::rol32((money) ^ 0xF4EC9621, 13))) @@ -2865,7 +2865,7 @@ namespace RCT2 break; } } -} // namespace RCT2 +} // namespace OpenRCT2::RCT2 std::unique_ptr ParkImporter::CreateS6(IObjectRepository& objectRepository) { diff --git a/src/openrct2/rct2/SeaDecrypt.cpp b/src/openrct2/rct2/SeaDecrypt.cpp index 263efe3832..b091ddb469 100644 --- a/src/openrct2/rct2/SeaDecrypt.cpp +++ b/src/openrct2/rct2/SeaDecrypt.cpp @@ -17,6 +17,8 @@ #include #include +using namespace OpenRCT2; + constexpr int32_t MASK_SIZE = 0x1000; struct EncryptionKey diff --git a/src/openrct2/rct2/T6Exporter.cpp b/src/openrct2/rct2/T6Exporter.cpp index 3879cbebb2..d6b1ef057a 100644 --- a/src/openrct2/rct2/T6Exporter.cpp +++ b/src/openrct2/rct2/T6Exporter.cpp @@ -28,7 +28,7 @@ #include -namespace RCT2 +namespace OpenRCT2::RCT2 { T6Exporter::T6Exporter(const TrackDesign& trackDesign) : _trackDesign(trackDesign) @@ -189,4 +189,4 @@ namespace RCT2 sawyerCoding.WriteChunkTrack(tempStream.GetData(), tempStream.GetLength()); return true; } -} // namespace RCT2 +} // namespace OpenRCT2::RCT2 diff --git a/src/openrct2/rct2/T6Exporter.h b/src/openrct2/rct2/T6Exporter.h index 19dde280e3..77bfbdd6e2 100644 --- a/src/openrct2/rct2/T6Exporter.h +++ b/src/openrct2/rct2/T6Exporter.h @@ -18,7 +18,7 @@ namespace OpenRCT2 struct IStream; } -namespace RCT2 +namespace OpenRCT2::RCT2 { /** * Class to export RollerCoaster Tycoon 2 track designs (*.TD6). @@ -34,4 +34,4 @@ namespace RCT2 private: const TrackDesign& _trackDesign; }; -} // namespace RCT2 +} // namespace OpenRCT2::RCT2 diff --git a/src/openrct2/rct2/T6Importer.cpp b/src/openrct2/rct2/T6Importer.cpp index fbc8e582e0..280e047408 100644 --- a/src/openrct2/rct2/T6Importer.cpp +++ b/src/openrct2/rct2/T6Importer.cpp @@ -24,7 +24,9 @@ #include -namespace RCT2 +using namespace OpenRCT2; + +namespace OpenRCT2::RCT2 { static std::mutex _objectLookupMutex; @@ -221,7 +223,7 @@ namespace RCT2 } } }; -} // namespace RCT2 +} // namespace OpenRCT2::RCT2 std::unique_ptr TrackImporter::CreateTD6() { diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 6063a03225..1009616a17 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -19,6 +19,8 @@ #include "Vehicle.h" #include "VehicleData.h" +using namespace OpenRCT2; + Vehicle* CableLiftSegmentCreate( Ride& ride, int32_t x, int32_t y, int32_t z, int32_t direction, uint16_t var_44, int32_t remaining_distance, bool head) { diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index ad5ed634cc..17ccb73e2d 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -103,12 +103,12 @@ enum class RideClassification KioskOrFacility }; -namespace ShelteredSectionsBits +namespace OpenRCT2::ShelteredSectionsBits { constexpr uint8_t NumShelteredSectionsMask = 0b00011111; constexpr uint8_t RotatingWhileSheltered = 0b00100000; constexpr uint8_t BankingWhileSheltered = 0b01000000; -}; // namespace ShelteredSectionsBits +}; // namespace OpenRCT2::ShelteredSectionsBits struct TrackDesign; struct TrackDesignState; @@ -198,7 +198,7 @@ struct Ride uint16_t num_customers_timeout{}; // Customer count in the last 10 * 960 game ticks (sliding window) uint16_t num_customers[OpenRCT2::Limits::kCustomerHistorySize]{}; - money64 price[RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{}; + money64 price[OpenRCT2::RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{}; TileCoordsXYZ ChairliftBullwheelLocation[2]; RatingTuple ratings{}; money64 value{}; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 9ff342c402..d9af3cdcd3 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -50,6 +50,7 @@ #include +using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; money64 _currentTrackPrice; diff --git a/src/openrct2/ride/RideConstruction.h b/src/openrct2/ride/RideConstruction.h index d802c4bea6..4df813136c 100644 --- a/src/openrct2/ride/RideConstruction.h +++ b/src/openrct2/ride/RideConstruction.h @@ -25,23 +25,26 @@ struct RideTypeDescriptor; struct TrackDrawerDescriptor; struct TrackDrawerEntry; -enum class RideConstructionState : uint8_t +namespace OpenRCT2 { - State0, - Front, - Back, - Selected, - Place, - EntranceExit, - MazeBuild, - MazeMove, - MazeFill -}; + enum class RideConstructionState : uint8_t + { + State0, + Front, + Back, + Selected, + Place, + EntranceExit, + MazeBuild, + MazeMove, + MazeFill + }; +} extern money64 _currentTrackPrice; extern uint32_t _currentTrackCurve; -extern RideConstructionState _rideConstructionState; +extern OpenRCT2::RideConstructionState _rideConstructionState; extern RideId _currentRideIndex; extern CoordsXYZ _currentTrackBegin; @@ -69,7 +72,7 @@ extern CoordsXYZD _unkF440C5; extern uint8_t gRideEntranceExitPlaceType; extern RideId gRideEntranceExitPlaceRideIndex; extern StationIndex gRideEntranceExitPlaceStationIndex; -extern RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; +extern OpenRCT2::RideConstructionState gRideEntranceExitPlacePreviousRideConstructionState; extern uint8_t gRideEntranceExitPlaceDirection; void RideEntranceExitPlaceProvisionalGhost(); diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index 04d79e825f..89ab0723ae 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -352,7 +352,7 @@ struct RideTypeDescriptor UpkeepCostsDescriptor UpkeepCosts{}; // rct2: 0x0097DD78 RideBuildCost BuildCosts{}; - money64 DefaultPrices[RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{}; + money64 DefaultPrices[OpenRCT2::RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{}; std::string_view DefaultMusic{}; /** rct2: 0x0097D7CB */ ShopItemIndex PhotoItem{}; @@ -555,7 +555,7 @@ extern const StringId RideModeNames[EnumValue(RideMode::Count)]; constexpr RideTypeDescriptor DummyRTD = { .Category = RIDE_CATEGORY_NONE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = {}, .InvertedTrackPaintFunctions = {}, .Flags = 0, diff --git a/src/openrct2/ride/RideEntry.h b/src/openrct2/ride/RideEntry.h index 589d15fae8..4e442365ce 100644 --- a/src/openrct2/ride/RideEntry.h +++ b/src/openrct2/ride/RideEntry.h @@ -49,7 +49,7 @@ struct RideObjectEntry // The first three images are previews. They correspond to the ride_type[] array. uint32_t images_offset; uint32_t flags; - ride_type_t ride_type[RCT2::ObjectLimits::MaxRideTypesPerRideEntry]; + ride_type_t ride_type[OpenRCT2::RCT2::ObjectLimits::MaxRideTypesPerRideEntry]; uint8_t min_cars_in_train; uint8_t max_cars_in_train; uint8_t cars_per_flat_ride; @@ -64,13 +64,13 @@ struct RideObjectEntry uint8_t RearCar; uint8_t ThirdCar; uint8_t BuildMenuPriority; - CarEntry Cars[RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; + CarEntry Cars[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry]; VehicleColourPresetList* vehicle_preset_list; int8_t excitement_multiplier; int8_t intensity_multiplier; int8_t nausea_multiplier; uint8_t max_height; - ShopItem shop_item[RCT2::ObjectLimits::MaxShopItemsPerRideEntry]; + ShopItem shop_item[OpenRCT2::RCT2::ObjectLimits::MaxShopItemsPerRideEntry]; StringId capacity; void* obj; uint8_t Clearance; diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index b0da909979..f143667dc5 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -263,7 +263,7 @@ enum TRACK_ELEM_FLAG_CAN_BE_PARTLY_UNDERGROUND = (1 << 16), }; -namespace TrackElemType +namespace OpenRCT2::TrackElemType { constexpr track_type_t Flat = 0; constexpr track_type_t EndStation = 1; @@ -634,7 +634,7 @@ namespace TrackElemType constexpr track_type_t Count = 339; constexpr track_type_t None = 65535; -}; // namespace TrackElemType +}; // namespace OpenRCT2::TrackElemType enum { diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index b37108a215..f1d899dd61 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -16,6 +16,8 @@ #include #include +using namespace OpenRCT2; + // clang-format off static constexpr TrackCoordinates _trackCoordinates[] = { { 0, 0, 0, 0, 0, 0 }, // ELEM_FLAT diff --git a/src/openrct2/ride/TrackData.h b/src/openrct2/ride/TrackData.h index 8d1306b1d5..cad37f9db2 100644 --- a/src/openrct2/ride/TrackData.h +++ b/src/openrct2/ride/TrackData.h @@ -61,11 +61,11 @@ struct DodgemsTrackSize constexpr DodgemsTrackSize GetDodgemsTrackSize(track_type_t type) { - if (type == TrackElemType::FlatTrack2x2) + if (type == OpenRCT2::TrackElemType::FlatTrack2x2) return { 4, 4, 59, 59 }; - if (type == TrackElemType::FlatTrack4x4) + if (type == OpenRCT2::TrackElemType::FlatTrack4x4) return { 4, 4, 123, 123 }; - if (type == TrackElemType::FlatTrack2x4) + if (type == OpenRCT2::TrackElemType::FlatTrack2x4) return { 4, 4, 59, 123 }; return { 0, 0, 0, 0 }; } diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 42ac7b7b88..9c435bb4de 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -70,7 +70,9 @@ #include #include -namespace TrackDesignSceneryElementFlags +using namespace OpenRCT2; + +namespace OpenRCT2::TrackDesignSceneryElementFlags { static constexpr uint8_t kRotationMask = 0b00000011; @@ -80,7 +82,7 @@ namespace TrackDesignSceneryElementFlags static constexpr uint8_t kHasSlopeMask = 0b00010000; static constexpr uint8_t kSlopeDirectionMask = 0b01100000; static constexpr uint8_t kIsQueueMask = 0b10000000; -} // namespace TrackDesignSceneryElementFlags +} // namespace OpenRCT2::TrackDesignSceneryElementFlags using namespace TrackDesignSceneryElementFlags; diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index d020c2f31e..7edb5cb2c3 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -235,7 +235,7 @@ extern RideId gTrackDesignSaveRideIndex; void TrackDesignMirror(TrackDesign& td); -GameActions::Result TrackDesignPlace( +OpenRCT2::GameActions::Result TrackDesignPlace( const TrackDesign& td, uint32_t flags, bool placeScenery, Ride& ride, const CoordsXYZD& coords); void TrackDesignPreviewRemoveGhosts(const TrackDesign& td, Ride& ride, const CoordsXYZD& coords); void TrackDesignPreviewDrawOutlines(TrackDesignState& tds, const TrackDesign& td, Ride& ride, const CoordsXYZD& coords); diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index 10a78af93d..31bc2daef1 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -35,6 +35,8 @@ #include +using namespace OpenRCT2; + constexpr size_t TRACK_MAX_SAVED_TILE_ELEMENTS = 1500; constexpr int32_t TRACK_NEARBY_SCENERY_DISTANCE = 1; diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 9e8c0b2028..c229f758b6 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -602,15 +602,15 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionInvertedImpulseRC(int32_t trackType); TRACK_PAINT_FUNCTION GetTrackPaintFunctionMiniRC(int32_t trackType); TRACK_PAINT_FUNCTION GetTrackPaintFunctionMineRide(int32_t trackType); TRACK_PAINT_FUNCTION GetTrackPaintFunctionLimLaunchedRC(int32_t trackType); -namespace HybridRC +namespace OpenRCT2::HybridRC { TRACK_PAINT_FUNCTION GetTrackPaintFunction(int32_t trackType); } -namespace SingleRailRC +namespace OpenRCT2::SingleRailRC { TRACK_PAINT_FUNCTION GetTrackPaintFunction(int32_t trackType); } -namespace AlpineRC +namespace OpenRCT2::AlpineRC { TRACK_PAINT_FUNCTION GetTrackPaintFunction(int32_t trackType); } diff --git a/src/openrct2/ride/TrainManager.cpp b/src/openrct2/ride/TrainManager.cpp index 97185bb23b..78b11c9552 100644 --- a/src/openrct2/ride/TrainManager.cpp +++ b/src/openrct2/ride/TrainManager.cpp @@ -13,7 +13,7 @@ #include "../entity/EntityRegistry.h" #include "Vehicle.h" -namespace TrainManager +namespace OpenRCT2::TrainManager { View::Iterator& View::Iterator::operator++() { @@ -34,4 +34,4 @@ namespace TrainManager { vec = &GetEntityList(EntityType::Vehicle); } -} // namespace TrainManager +} // namespace OpenRCT2::TrainManager diff --git a/src/openrct2/ride/TrainManager.h b/src/openrct2/ride/TrainManager.h index be733aee27..c611735f38 100644 --- a/src/openrct2/ride/TrainManager.h +++ b/src/openrct2/ride/TrainManager.h @@ -15,7 +15,7 @@ struct Vehicle; -namespace TrainManager +namespace OpenRCT2::TrainManager { // Iteration of heads of trains class View @@ -77,4 +77,4 @@ namespace TrainManager return Iterator(std::cend(*vec), std::cend(*vec)); } }; -} // namespace TrainManager +} // namespace OpenRCT2::TrainManager diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index d1b2aa21c7..fe62ce1555 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -390,7 +390,7 @@ struct TrainReference Vehicle* tail; }; -namespace MiniGolfFlag +namespace OpenRCT2::MiniGolfFlag { constexpr uint8_t Flag0 = (1 << 0); constexpr uint8_t Flag1 = (1 << 1); @@ -398,7 +398,7 @@ namespace MiniGolfFlag constexpr uint8_t Flag3 = (1 << 3); constexpr uint8_t Flag4 = (1 << 4); constexpr uint8_t Flag5 = (1 << 5); // transitioning between hole -} // namespace MiniGolfFlag +} // namespace OpenRCT2::MiniGolfFlag enum class MiniGolfState : int16_t { @@ -430,7 +430,7 @@ enum BoatHireSubState : uint8_t EnteringReturnPosition, }; -namespace VehicleFlags +namespace OpenRCT2::VehicleFlags { constexpr uint32_t OnLiftHill = (1 << 0); constexpr uint32_t CollisionDisabled = (1 << 1); @@ -453,7 +453,7 @@ namespace VehicleFlags // an individual car on a train constexpr uint32_t Crashed = (1 << 15); // Car displays as smoke plume constexpr uint32_t CarIsReversed = (1 << 16); // Car is displayed running backwards -} // namespace VehicleFlags +} // namespace OpenRCT2::VehicleFlags enum { diff --git a/src/openrct2/ride/VehicleRiderControl.cpp b/src/openrct2/ride/VehicleRiderControl.cpp index 4423e01588..b6990daa6a 100644 --- a/src/openrct2/ride/VehicleRiderControl.cpp +++ b/src/openrct2/ride/VehicleRiderControl.cpp @@ -11,6 +11,8 @@ #include "../entity/EntityRegistry.h" #include "Vehicle.h" +using namespace OpenRCT2; + constexpr int operator"" _MPH(unsigned long long x) noexcept { return x * 29127; diff --git a/src/openrct2/ride/VehicleSubpositionData.cpp b/src/openrct2/ride/VehicleSubpositionData.cpp index 8d48ed0b99..2198632a23 100644 --- a/src/openrct2/ride/VehicleSubpositionData.cpp +++ b/src/openrct2/ride/VehicleSubpositionData.cpp @@ -11,6 +11,8 @@ #include "Vehicle.h" +using namespace OpenRCT2; + #define CREATE_VEHICLE_INFO(VAR, ...) \ static constexpr VehicleInfo VAR##_data[] = __VA_ARGS__; \ static constexpr VehicleInfoList VAR = { static_cast(std::size(VAR##_data)), VAR##_data }; @@ -27270,7 +27272,7 @@ CREATE_VEHICLE_INFO(TrackVehicleInfoRightEighthBankToOrthogonalDown253, { -namespace LeftLane +namespace OpenRCT2::LeftLane { CREATE_VEHICLE_INFO(TrackVehicleInfoLeftQuarterTurn5Tiles0, { { 31, 9, 0, 0, 0, 0 }, { 30, 9, 0, 31, 0, 0 }, { 29, 9, 0, 31, 0, 0 }, { 28, 9, 0, 31, 0, 0 }, { 27, 9, 0, 31, 0, 0 }, @@ -28502,7 +28504,7 @@ namespace LeftLane } -namespace RightLane +namespace OpenRCT2::RightLane { CREATE_VEHICLE_INFO(TrackVehicleInfoLeftQuarterTurn5Tiles0, { { 31, 23, 0, 0, 0, 0 }, { 30, 23, 0, 31, 0, 0 }, { 29, 23, 0, 31, 0, 0 }, { 28, 23, 0, 31, 0, 0 }, { 27, 23, 0, 31, 0, 0 }, diff --git a/src/openrct2/ride/VehicleSubpositionData.h b/src/openrct2/ride/VehicleSubpositionData.h index f9d6feaa4c..9c0e0e1e2f 100644 --- a/src/openrct2/ride/VehicleSubpositionData.h +++ b/src/openrct2/ride/VehicleSubpositionData.h @@ -13,7 +13,7 @@ #include -constexpr const size_t VehicleTrackSubpositionSizeDefault = TrackElemType::Count * kNumOrthogonalDirections; +constexpr const size_t VehicleTrackSubpositionSizeDefault = OpenRCT2::TrackElemType::Count * kNumOrthogonalDirections; struct VehicleInfo; diff --git a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index f6fcc86a5a..c2bd15ad99 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; enum diff --git a/src/openrct2/ride/coaster/AlpineCoaster.cpp b/src/openrct2/ride/coaster/AlpineCoaster.cpp index 79f1d23336..0f7a55725c 100644 --- a/src/openrct2/ride/coaster/AlpineCoaster.cpp +++ b/src/openrct2/ride/coaster/AlpineCoaster.cpp @@ -20,9 +20,11 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Fork; -namespace AlpineRC +namespace OpenRCT2::AlpineRC { static void TrackFlat( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, @@ -7823,4 +7825,4 @@ namespace AlpineRC return nullptr; } -} // namespace AlpineRC +} // namespace OpenRCT2::AlpineRC diff --git a/src/openrct2/ride/coaster/BobsleighCoaster.cpp b/src/openrct2/ride/coaster/BobsleighCoaster.cpp index 086900427a..2b0d19af44 100644 --- a/src/openrct2/ride/coaster/BobsleighCoaster.cpp +++ b/src/openrct2/ride/coaster/BobsleighCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; static constexpr uint32_t BOBSLEIGH_BLOCK_BRAKE_SW_NE_OPEN = 14586; diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp b/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp index d6b539b666..4030013544 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp @@ -23,6 +23,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr uint32_t BM_BLOCK_BRAKE_SW_NE_OPEN = 17150; static constexpr uint32_t BM_BLOCK_BRAKE_NW_SE_OPEN = 17151; static constexpr uint32_t BM_BLOCK_BRAKE_SW_NE_CLOSED = 17152; diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index ab520e5f20..2b52213388 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -16,6 +16,8 @@ #include +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; static constexpr ImageIndex kClassicStandUpRcFlatToRightBank0 = SPR_CSG_BEGIN + 67009; diff --git a/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp index 4f71375323..eaeb28d847 100644 --- a/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp @@ -22,6 +22,8 @@ #include "../TrackPaint.h" #include "WoodenRollerCoaster.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; enum diff --git a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp index f788ba22c6..20573f28ff 100644 --- a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp +++ b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::TubesInverted; static constexpr ImageIndex kCompactInvertedDiagFlatImages[2][kNumOrthogonalDirections] = { diff --git a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.hpp b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.hpp index 351a90320e..d0a6a5f5dc 100644 --- a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.hpp +++ b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.hpp @@ -23,6 +23,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr uint32_t kCorkscrewRcBlockBrakeSwNeOpen = 16232; static constexpr uint32_t kCorkscrewRcBlockBrakeNwSeOpen = 16233; static constexpr uint32_t kCorkscrewRcBlockBrakeSwNeClosed = 16234; diff --git a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp index ce49693290..00f3855fc7 100644 --- a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp @@ -22,6 +22,8 @@ #include "../TrackPaint.h" #include "BolligerMabillardTrack.hpp" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::TubesInverted; static constexpr const uint32_t InvertedRCDiagBrakeImages[kNumOrthogonalDirections] = { diff --git a/src/openrct2/ride/coaster/GigaCoaster.cpp b/src/openrct2/ride/coaster/GigaCoaster.cpp index da428b9044..855dddc3c5 100644 --- a/src/openrct2/ride/coaster/GigaCoaster.cpp +++ b/src/openrct2/ride/coaster/GigaCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; // Closed block brakes and regular brakes use the same images diff --git a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp index dd581ac7f4..66723f16dd 100644 --- a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp +++ b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Mine; /** rct2: 0x0087694C */ diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index 05f2f5c74d..722b4c3d9f 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -22,7 +22,7 @@ static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; -namespace HybridRC +namespace OpenRCT2::HybridRC { static ImageId GetTrackColour(PaintSession& session) { @@ -14752,4 +14752,4 @@ namespace HybridRC } return nullptr; } -} // namespace HybridRC +} // namespace OpenRCT2::HybridRC diff --git a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp index 4bfadaaf3a..ce967be3c4 100644 --- a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::TubesInverted; /** rct2: 0x00890CB4 */ diff --git a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp index 2044fe334e..6456a32412 100644 --- a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::TubesInverted; /** rct2: 0x008B0460 */ diff --git a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp index 4d92f977af..34e337385e 100644 --- a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp @@ -20,6 +20,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Boxed; static constexpr ImageIndex kInvertedRCDiagFlatImages[2][kNumOrthogonalDirections] = { diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 5926a4f323..fdd9852d76 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -23,6 +23,8 @@ #include +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Fork; enum class JuniorRCSubType : uint8_t diff --git a/src/openrct2/ride/coaster/LayDownRollerCoasterInverted.cpp b/src/openrct2/ride/coaster/LayDownRollerCoasterInverted.cpp index 031b5cd9a9..dc99ea9218 100644 --- a/src/openrct2/ride/coaster/LayDownRollerCoasterInverted.cpp +++ b/src/openrct2/ride/coaster/LayDownRollerCoasterInverted.cpp @@ -22,6 +22,8 @@ #include "../TrackPaint.h" #include "CorkscrewRollerCoaster.hpp" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::TubesInverted; static constexpr ImageIndex kLaydownDiagFlatImages[2][kNumOrthogonalDirections] = { diff --git a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp index e521bc60e6..691e262d4f 100644 --- a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; static constexpr uint32_t LIM_LAUNCHED_RC_BLOCK_BRAKE_SW_NE_OPEN = 15020; diff --git a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp index b7da1e4a20..aff4e7fe69 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; static constexpr auto SPR_LOOPING_RC_BOOSTER_NE_SW = 15010; diff --git a/src/openrct2/ride/coaster/MineRide.cpp b/src/openrct2/ride/coaster/MineRide.cpp index 32db36a387..5fcb29c704 100644 --- a/src/openrct2/ride/coaster/MineRide.cpp +++ b/src/openrct2/ride/coaster/MineRide.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Fork; /** rct2: 0x008B08D0 */ diff --git a/src/openrct2/ride/coaster/MineTrainCoaster.cpp b/src/openrct2/ride/coaster/MineTrainCoaster.cpp index c876df0cc0..50d4512e02 100644 --- a/src/openrct2/ride/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/ride/coaster/MineTrainCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Mine; static constexpr uint32_t MINE_TRAIN_BLOCK_BRAKE_SW_NE_OPEN = 20060; diff --git a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp index bef2ddeebb..f5be8632b8 100644 --- a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Fork; static constexpr uint32_t MINI_RC_BLOCK_BRAKE_SW_NE_OPEN = 18742; diff --git a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp index 0f56de3a48..6272578a1a 100644 --- a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Fork; static constexpr ImageIndex kMiniSuspendedRCFlatImages[2][kNumOrthogonalDirections] = { diff --git a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp index 016c8368b7..b377ccace9 100644 --- a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::TubesInverted; static constexpr uint32_t MULTI_DIM_STATION_BLOCK_BRAKE_SW_NE_OPEN = 15812; diff --git a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp index 5458e858ed..2318f7c464 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; enum diff --git a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp index 1792d4abef..270d5fa6ff 100644 --- a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp @@ -24,6 +24,8 @@ #include "../Vehicle.h" #include "../VehiclePaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; #ifndef NO_VEHICLES diff --git a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp index 251b0e4971..beafc00027 100644 --- a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; constexpr int32_t SPR_SIDE_FRICTION_60_DEG_UP_DIR_0_B = 21658; diff --git a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp index 544d998df4..9b32950c91 100644 --- a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp @@ -20,9 +20,11 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; -namespace SingleRailRC +namespace OpenRCT2::SingleRailRC { static void TrackFlat( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, @@ -18874,4 +18876,4 @@ namespace SingleRailRC return nullptr; } -} // namespace SingleRailRC +} // namespace OpenRCT2::SingleRailRC diff --git a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp index 1e0072ceee..c71d178059 100644 --- a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; static constexpr uint32_t STAND_UP_BLOCK_BRAKE_SW_NE_OPEN = 25571; diff --git a/src/openrct2/ride/coaster/Steeplechase.cpp b/src/openrct2/ride/coaster/Steeplechase.cpp index 00df573585..e91c420272 100644 --- a/src/openrct2/ride/coaster/Steeplechase.cpp +++ b/src/openrct2/ride/coaster/Steeplechase.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Stick; static constexpr const uint32_t SteeplechaseRCDiagBrakeImages[kNumOrthogonalDirections] = { diff --git a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp index 98976e87e5..7c934f84b9 100644 --- a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp +++ b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp @@ -20,6 +20,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; static constexpr ImageIndex kSuspendedSwingingRCDiagFlatImages[2][kNumOrthogonalDirections] = { diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index eead2ce601..df9d796a1a 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -20,6 +20,8 @@ #include +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; // 0x009927E6: diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 9846cecf99..f502f1c25b 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; enum diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index 99b4c8cf92..51edae8307 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -26,6 +26,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; using namespace OpenRCT2; diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index ce63671ecd..f4ad963145 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; enum diff --git a/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h b/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h index 759ab51693..d528fd1286 100644 --- a/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h +++ b/src/openrct2/ride/coaster/meta/AirPoweredVerticalCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor AirPoweredVerticalCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionAirPoweredVerticalRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL_STEEP, TRACK_LIFT_HILL_CURVE, TRACK_FLAT_ROLL_BANKING, TRACK_CURVE, TRACK_BRAKES, TRACK_REVERSE_FREEFALL, TRACK_SLOPE_TO_FLAT, TRACK_ON_RIDE_PHOTO}, diff --git a/src/openrct2/ride/coaster/meta/AlpineCoaster.h b/src/openrct2/ride/coaster/meta/AlpineCoaster.h index 26bbb3499d..701e793935 100644 --- a/src/openrct2/ride/coaster/meta/AlpineCoaster.h +++ b/src/openrct2/ride/coaster/meta/AlpineCoaster.h @@ -16,9 +16,9 @@ constexpr RideTypeDescriptor AlpineCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ - .Drawer = AlpineRC::GetTrackPaintFunction, + .Drawer = OpenRCT2::AlpineRC::GetTrackPaintFunction, .EnabledTrackPieces = { TRACK_FLAT, TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_LONG, TRACK_SLOPE_CURVE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF}, .ExtraTrackPieces = {TRACK_HELIX_UP_BANKED_HALF}, }), diff --git a/src/openrct2/ride/coaster/meta/BobsleighCoaster.h b/src/openrct2/ride/coaster/meta/BobsleighCoaster.h index 1a837dba9f..26ccfb4291 100644 --- a/src/openrct2/ride/coaster/meta/BobsleighCoaster.h +++ b/src/openrct2/ride/coaster/meta/BobsleighCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor BobsleighCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionBobsleighRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE,TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES,TRACK_BLOCK_BRAKES, TRACK_ON_RIDE_PHOTO}, diff --git a/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h b/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h index d33ff7f3cd..25e70f5c25 100644 --- a/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/ClassicMiniRollerCoaster.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor ClassicMiniRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionJuniorRC, .EnabledTrackPieces = { TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_LIFT_HILL_CURVE, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_LONG, TRACK_SLOPE_CURVE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_BLOCK_BRAKES, TRACK_BOOSTER, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h b/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h index c5c2db8cc6..77602c6420 100644 --- a/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor ClassicStandUpRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionClassicStandUpRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/ClassicWoodenRollerCoaster.h b/src/openrct2/ride/coaster/meta/ClassicWoodenRollerCoaster.h index 78b7924ea2..2cde0d3063 100644 --- a/src/openrct2/ride/coaster/meta/ClassicWoodenRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/ClassicWoodenRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor ClassicWoodenRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionClassicWoodenRC, .EnabledTrackPieces = {TRACK_FLAT, TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_WATER_SPLASH, TRACK_BLOCK_BRAKES, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h b/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h index 31155c34b5..f7d8d1ec96 100644 --- a/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h +++ b/src/openrct2/ride/coaster/meta/CompactInvertedCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor CompactInvertedCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionCompactInvertedRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_TWIST, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_HELIX_DOWN_BANKED_QUARTER, TRACK_HELIX_UP_BANKED_QUARTER, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_VERTICAL, TRACK_BLOCK_BRAKES, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h b/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h index 5942ee7228..fff52a0850 100644 --- a/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/CorkscrewRollerCoaster.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor CorkscrewRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionCorkscrewRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES,TRACK_BOOSTER, TRACK_SLOPE_STEEP_LONG, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h b/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h index a36641479d..bf4cb21b1f 100644 --- a/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/FlyingRollerCoaster.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor FlyingRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionFlyingRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_INLINE_TWIST_UNINVERTED, TRACK_FLYING_HALF_LOOP_UNINVERTED_UP, TRACK_QUARTER_LOOP_UNINVERTED_UP, TRACK_FLYING_LARGE_HALF_LOOP_UNINVERTED_UP, TRACK_SLOPE_VERTICAL, TRACK_SLOPE_CURVE_BANKED, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, @@ -97,7 +97,7 @@ constexpr RideTypeDescriptor FlyingRollerCoasterRTD = constexpr RideTypeDescriptor FlyingRollerCoasterAltRTD = { .Category = RIDE_CATEGORY_NONE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = nullptr, .EnabledTrackPieces = { }, diff --git a/src/openrct2/ride/coaster/meta/GigaCoaster.h b/src/openrct2/ride/coaster/meta/GigaCoaster.h index 8e12913668..a3f4e9cda8 100644 --- a/src/openrct2/ride/coaster/meta/GigaCoaster.h +++ b/src/openrct2/ride/coaster/meta/GigaCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor GigaCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionGigaRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_SLOPE_STEEP_LONG, TRACK_LIFT_HILL_CABLE, TRACK_BOOSTER, TRACK_POWERED_LIFT, TRACK_SLOPE_CURVE_BANKED, TRACK_SLOPE_CURVE_LARGE, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES, TRACK_SLOPE_VERTICAL, TRACK_CURVE_VERTICAL}, diff --git a/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h b/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h index 46177f2907..45b16674f3 100644 --- a/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h +++ b/src/openrct2/ride/coaster/meta/HeartlineTwisterCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor HeartlineTwisterCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionHeartlineTwisterRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_LIFT_HILL_STEEP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_HEARTLINE_ROLL, TRACK_HEARTLINE_TRANSFER}, diff --git a/src/openrct2/ride/coaster/meta/HybridCoaster.h b/src/openrct2/ride/coaster/meta/HybridCoaster.h index 4d40d04e54..d983981320 100644 --- a/src/openrct2/ride/coaster/meta/HybridCoaster.h +++ b/src/openrct2/ride/coaster/meta/HybridCoaster.h @@ -16,9 +16,9 @@ constexpr RideTypeDescriptor HybridCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ - .Drawer = HybridRC::GetTrackPaintFunction, + .Drawer = OpenRCT2::HybridRC::GetTrackPaintFunction, .EnabledTrackPieces = {TRACK_FLAT, TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_LIFT_HILL_STEEP, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_VERTICAL, TRACK_BARREL_ROLL, TRACK_POWERED_LIFT, TRACK_SLOPE_CURVE_BANKED, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_SLOPE_STEEP_LONG, TRACK_CURVE_VERTICAL, TRACK_QUARTER_LOOP, TRACK_ZERO_G_ROLL, TRACK_ZERO_G_ROLL_LARGE, TRACK_SLOPE_CURVE_LARGE, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, .ExtraTrackPieces = {TRACK_BOOSTER}, }), diff --git a/src/openrct2/ride/coaster/meta/HyperTwister.h b/src/openrct2/ride/coaster/meta/HyperTwister.h index 7b1590ec51..dbdb10bebc 100644 --- a/src/openrct2/ride/coaster/meta/HyperTwister.h +++ b/src/openrct2/ride/coaster/meta/HyperTwister.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor HyperTwisterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionBolligerMabillard, .EnabledTrackPieces = { TRACK_FLAT, TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_CURVE_BANKED, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_SLOPE_STEEP_LONG, TRACK_SLOPE_VERTICAL, TRACK_CURVE_VERTICAL, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/Hypercoaster.h b/src/openrct2/ride/coaster/meta/Hypercoaster.h index c6ccfd8d4c..446b175305 100644 --- a/src/openrct2/ride/coaster/meta/Hypercoaster.h +++ b/src/openrct2/ride/coaster/meta/Hypercoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor HypercoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionCorkscrewRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_STEEP_LONG, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h b/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h index 320cde8cf7..29841ba31d 100644 --- a/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedHairpinCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor InvertedHairpinCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionInvertedHairpinRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_LIFT_HILL_STEEP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_LONG, TRACK_SLOPE_CURVE, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL, TRACK_BRAKES, TRACK_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h b/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h index 764fef7384..50b14f7acf 100644 --- a/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedImpulseCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor InvertedImpulseCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionInvertedImpulseRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_VERTICAL, TRACK_CURVE_VERTICAL}, diff --git a/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h b/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h index c2401e0673..5dc08c19c2 100644 --- a/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/InvertedRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor InvertedRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionInvertedRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_TWIST, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_HELIX_DOWN_BANKED_QUARTER, TRACK_HELIX_UP_BANKED_QUARTER, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_HALF_LOOP_LARGE, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h b/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h index 96bb85f731..5072d5ba3a 100644 --- a/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/JuniorRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor JuniorRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionJuniorRC, .EnabledTrackPieces = { TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL,TRACK_LIFT_HILL_CURVE, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_LONG, TRACK_SLOPE_CURVE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_BLOCK_BRAKES, TRACK_BOOSTER, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h b/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h index 7ed4d12858..85dd00dba2 100644 --- a/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/LIMLaunchedRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor LIMLaunchedRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionLimLaunchedRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_TWIST, TRACK_CORKSCREW, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_VERTICAL, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_CURVE_VERTICAL, TRACK_QUARTER_LOOP, TRACK_BARREL_ROLL, TRACK_SLOPE_CURVE_BANKED, TRACK_SLOPE_STEEP_LONG, TRACK_HALF_LOOP, TRACK_HALF_LOOP_MEDIUM, TRACK_HALF_LOOP_LARGE, TRACK_CORKSCREW_LARGE}, diff --git a/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h b/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h index 8765c9155b..2beb13e5f6 100644 --- a/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/LayDownRollerCoaster.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor LayDownRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor( { .Drawer = GetTrackPaintFunctionCorkscrewRC, @@ -96,7 +96,7 @@ constexpr RideTypeDescriptor LayDownRollerCoasterRTD = constexpr RideTypeDescriptor LayDownRollerCoasterAltRTD = { .Category = RIDE_CATEGORY_NONE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = nullptr, .EnabledTrackPieces = { }, diff --git a/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h b/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h index b5ba67081b..633e886584 100644 --- a/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/LoopingRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor LoopingRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionLoopingRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_BOOSTER, TRACK_SLOPE_CURVE_BANKED, TRACK_SLOPE_STEEP_LONG, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/MineRide.h b/src/openrct2/ride/coaster/meta/MineRide.h index 2788f22e85..441cefb27a 100644 --- a/src/openrct2/ride/coaster/meta/MineRide.h +++ b/src/openrct2/ride/coaster/meta/MineRide.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor MineRideRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMineRide, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_ON_RIDE_PHOTO}, diff --git a/src/openrct2/ride/coaster/meta/MineTrainCoaster.h b/src/openrct2/ride/coaster/meta/MineTrainCoaster.h index 85668ac310..089904288e 100644 --- a/src/openrct2/ride/coaster/meta/MineTrainCoaster.h +++ b/src/openrct2/ride/coaster/meta/MineTrainCoaster.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor MineTrainCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMineTrainRC, .EnabledTrackPieces = { TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h b/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h index 84144ec2a5..00e765959d 100644 --- a/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/MiniRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor MiniRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMiniRC, .EnabledTrackPieces = { TRACK_STRAIGHT, TRACK_STATION_END, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_LIFT_HILL}, diff --git a/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h b/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h index 3302df9ae6..2ec6556faa 100644 --- a/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h +++ b/src/openrct2/ride/coaster/meta/MiniSuspendedCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor MiniSuspendedCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMiniSuspendedRC, .EnabledTrackPieces = { TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE}, diff --git a/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h b/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h index 124b2c78f2..6787e7f69d 100644 --- a/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/MultiDimensionRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor MultiDimensionRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMultiDimensionRC, .EnabledTrackPieces = { TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_VERTICAL, TRACK_BLOCK_BRAKES, TRACK_INLINE_TWIST_UNINVERTED,TRACK_QUARTER_LOOP_UNINVERTED_UP, TRACK_QUARTER_LOOP_UNINVERTED_DOWN, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, @@ -96,7 +96,7 @@ constexpr RideTypeDescriptor MultiDimensionRollerCoasterRTD = constexpr RideTypeDescriptor MultiDimensionRollerCoasterAltRTD = { .Category = RIDE_CATEGORY_NONE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = nullptr, .EnabledTrackPieces = { }, diff --git a/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h b/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h index b6c0a15937..cd9eb8822a 100644 --- a/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h +++ b/src/openrct2/ride/coaster/meta/ReverseFreefallCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor ReverseFreefallCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionReverseFreefallRC, .EnabledTrackPieces = { TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL_STEEP, TRACK_REVERSE_FREEFALL, TRACK_ON_RIDE_PHOTO}, diff --git a/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h b/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h index 6b3e81ec4a..e3f9a9ebb6 100644 --- a/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/ReverserRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor ReverserRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionReverserRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_BRAKES, TRACK_REVERSER}, diff --git a/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h b/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h index bf5489d507..5e35493ab4 100644 --- a/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/SideFrictionRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SideFrictionRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSideFrictionRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_BRAKES, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN}, diff --git a/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h b/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h index 820f0390a3..bd7a6c7bb7 100644 --- a/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/SingleRailRollerCoaster.h @@ -16,9 +16,9 @@ constexpr RideTypeDescriptor SingleRailRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ - .Drawer = SingleRailRC::GetTrackPaintFunction, + .Drawer = OpenRCT2::SingleRailRC::GetTrackPaintFunction, .EnabledTrackPieces = { TRACK_FLAT, TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_LIFT_HILL_STEEP, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_LONG, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_CORKSCREW, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_VERTICAL, TRACK_BARREL_ROLL, TRACK_SLOPE_CURVE_BANKED, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_CURVE_VERTICAL, TRACK_QUARTER_LOOP, TRACK_HALF_LOOP, TRACK_HALF_LOOP_MEDIUM, TRACK_CORKSCREW_LARGE, TRACK_ZERO_G_ROLL, TRACK_ZERO_G_ROLL_LARGE, TRACK_SLOPE_CURVE_LARGE, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, .ExtraTrackPieces = {TRACK_SLOPE_STEEP_LONG, TRACK_HALF_LOOP_LARGE}, }), diff --git a/src/openrct2/ride/coaster/meta/SpinningWildMouse.h b/src/openrct2/ride/coaster/meta/SpinningWildMouse.h index 94b4463e71..bad2e9cea4 100644 --- a/src/openrct2/ride/coaster/meta/SpinningWildMouse.h +++ b/src/openrct2/ride/coaster/meta/SpinningWildMouse.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor SpinningWildMouseRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionWildMouse, .EnabledTrackPieces = {TRACK_STRAIGHT,TRACK_STATION_END,TRACK_LIFT_HILL, TRACK_SLOPE,TRACK_SLOPE_LONG,TRACK_CURVE_VERY_SMALL,TRACK_CURVE_SMALL, TRACK_BRAKES,TRACK_BLOCK_BRAKES,TRACK_ROTATION_CONTROL_TOGGLE}, diff --git a/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h b/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h index 0e89507ddb..cacc7ea8ce 100644 --- a/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/SpiralRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SpiralRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMiniRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_FLAT_ROLL_BANKING, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_LIFT_HILL_CURVED}, diff --git a/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h b/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h index f6d3241d0e..bed55e3be8 100644 --- a/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor StandUpRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionStandUpRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/SteelWildMouse.h b/src/openrct2/ride/coaster/meta/SteelWildMouse.h index 624b9bcdc9..f09412f15f 100644 --- a/src/openrct2/ride/coaster/meta/SteelWildMouse.h +++ b/src/openrct2/ride/coaster/meta/SteelWildMouse.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SteelWildMouseRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionWildMouse, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_LIFT_HILL_STEEP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_LONG, TRACK_SLOPE_CURVE, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL, TRACK_BRAKES, TRACK_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/Steeplechase.h b/src/openrct2/ride/coaster/meta/Steeplechase.h index 51a1ccf91f..d3bc8995b8 100644 --- a/src/openrct2/ride/coaster/meta/Steeplechase.h +++ b/src/openrct2/ride/coaster/meta/Steeplechase.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SteeplechaseRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSteeplechase, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_BRAKES, TRACK_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h b/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h index 2fdc2a4bcd..96e47d0865 100644 --- a/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h +++ b/src/openrct2/ride/coaster/meta/SuspendedSwingingCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SuspendedSwingingCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSuspendedSwingingRC, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_UNBANKED_QUARTER, TRACK_HELIX_UP_UNBANKED_QUARTER, TRACK_BRAKES, TRACK_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h b/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h index 8607b5d8d1..1b9b1d7642 100644 --- a/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/TwisterRollerCoaster.h @@ -20,7 +20,7 @@ constexpr RideTypeDescriptor TwisterRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionBolligerMabillard, .EnabledTrackPieces = {TRACK_FLAT, TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_VERTICAL, TRACK_BARREL_ROLL, TRACK_POWERED_LIFT, TRACK_HALF_LOOP_LARGE, TRACK_SLOPE_CURVE_BANKED, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_SLOPE_STEEP_LONG, TRACK_CURVE_VERTICAL, TRACK_QUARTER_LOOP, TRACK_BOOSTER, TRACK_TWIST, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h b/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h index 0d88fe2b71..23b830d08b 100644 --- a/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h +++ b/src/openrct2/ride/coaster/meta/VerticalDropCoaster.h @@ -20,7 +20,7 @@ constexpr RideTypeDescriptor VerticalDropCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionBolligerMabillard, .EnabledTrackPieces = {TRACK_FLAT, TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_LIFT_HILL_STEEP, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_LONG, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_SLOPE_VERTICAL, TRACK_SLOPE_CURVE_BANKED, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_CURVE_VERTICAL, TRACK_HALF_LOOP_LARGE, TRACK_BRAKE_FOR_DROP, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/VirginiaReel.h b/src/openrct2/ride/coaster/meta/VirginiaReel.h index 09b0d321fe..fbf67f223b 100644 --- a/src/openrct2/ride/coaster/meta/VirginiaReel.h +++ b/src/openrct2/ride/coaster/meta/VirginiaReel.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor VirginiaReelRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionVirginiaReel, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_SLOPE, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL}, diff --git a/src/openrct2/ride/coaster/meta/WaterCoaster.h b/src/openrct2/ride/coaster/meta/WaterCoaster.h index b2421031e0..5bf30db870 100644 --- a/src/openrct2/ride/coaster/meta/WaterCoaster.h +++ b/src/openrct2/ride/coaster/meta/WaterCoaster.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor WaterCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor( { .Drawer = GetTrackPaintFunctionWaterRC, @@ -28,7 +28,7 @@ constexpr RideTypeDescriptor WaterCoasterRTD = }, { .Drawer = GetTrackPaintFunctionSplashBoats, - .EnabledTrackPieces = {TrackElemType::Flat, TrackElemType::LeftQuarterTurn5Tiles, TrackElemType::RightQuarterTurn5Tiles, TrackElemType::SBendLeft, TrackElemType::SBendRight}, + .EnabledTrackPieces = {OpenRCT2::TrackElemType::Flat, OpenRCT2::TrackElemType::LeftQuarterTurn5Tiles, OpenRCT2::TrackElemType::RightQuarterTurn5Tiles, OpenRCT2::TrackElemType::SBendLeft, OpenRCT2::TrackElemType::SBendRight}, .ExtraTrackPieces = {}, } ), diff --git a/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h b/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h index 645a360811..d4065455fe 100644 --- a/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/WoodenRollerCoaster.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor WoodenRollerCoasterRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionWoodenRC, .EnabledTrackPieces = {TRACK_FLAT, TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_SLOPE_CURVE_STEEP, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HELIX_DOWN_BANKED_HALF, TRACK_HELIX_UP_BANKED_HALF, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_WATER_SPLASH, TRACK_SLOPE_CURVE_BANKED, TRACK_BLOCK_BRAKES, TRACK_SLOPE_ROLL_BANKING, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, diff --git a/src/openrct2/ride/coaster/meta/WoodenWildMouse.h b/src/openrct2/ride/coaster/meta/WoodenWildMouse.h index 3abc606a84..9fcd74fbfb 100644 --- a/src/openrct2/ride/coaster/meta/WoodenWildMouse.h +++ b/src/openrct2/ride/coaster/meta/WoodenWildMouse.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor WoodenWildMouseRTD = { .Category = RIDE_CATEGORY_ROLLERCOASTER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionWoodenWildMouse, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_LIFT_HILL_STEEP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_LONG, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL}, diff --git a/src/openrct2/ride/gentle/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index 8aad741081..503b91305c 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -20,6 +20,8 @@ #include "../TrackPaint.h" #include "../VehiclePaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Boxed; enum diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index 91e0490252..8ad9213e3a 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -19,6 +19,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static void PaintCircusTent( PaintSession& session, const Ride& ride, uint8_t direction, int8_t al, int8_t cl, uint16_t height, ImageId stationColour) { diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index 0f3ef705c7..a95cac5895 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -20,6 +20,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr BoundBoxXY CrookedHouseData[] = { { { 6, 0 }, diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index 13f714e1c3..0bcbc3cbbd 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -18,6 +18,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + enum { SprDodgemsFloor = 21925, diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index 17113016ba..898267e7c1 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -21,6 +21,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + static constexpr uint8_t Edges1X4NeSw[] = { EDGE_NW | EDGE_SE, EDGE_NW | EDGE_SE | EDGE_NE, diff --git a/src/openrct2/ride/gentle/FlyingSaucers.cpp b/src/openrct2/ride/gentle/FlyingSaucers.cpp index de890e5535..9c04a335f6 100644 --- a/src/openrct2/ride/gentle/FlyingSaucers.cpp +++ b/src/openrct2/ride/gentle/FlyingSaucers.cpp @@ -17,6 +17,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + enum { SprFlyingSaucersFloor = 21920, diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index f4612af0ba..1d731d1a0b 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -20,6 +20,8 @@ #include "../TrackPaint.h" #include "../VehiclePaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Boxed; enum diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index bae93427c0..4985092779 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -20,6 +20,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + static constexpr BoundBoxXY HauntedHouseData[] = { { { 6, 0 }, { 42, 24 } }, { { 0, 0 }, { 0, 0 } }, { { -16, -16 }, { 32, 32 } }, { { 0, 0 }, { 0, 0 } }, { { 0, 6 }, { 24, 42 } }, { { 0, 0 }, { 0, 0 } }, diff --git a/src/openrct2/ride/gentle/Maze.cpp b/src/openrct2/ride/gentle/Maze.cpp index 9ad5c60281..08f9378f83 100644 --- a/src/openrct2/ride/gentle/Maze.cpp +++ b/src/openrct2/ride/gentle/Maze.cpp @@ -25,6 +25,7 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; enum diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index 079b63a606..c60fffbea7 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -19,6 +19,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + static constexpr uint32_t MerryGoRoundRiderOffsets[] = { 0, 32, 64, 96, 16, 48, 80, 112, }; diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 756483a32c..1e90b8392d 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -28,6 +28,8 @@ #include +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Boxed; enum diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index 2b5b58e58a..670e639ce1 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -20,6 +20,8 @@ #include "../TrackPaint.h" #include "../VehiclePaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Stick; /** rct2: 0x */ diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index 266cbcff23..d395456aa7 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -18,6 +18,8 @@ #include "../TrackPaint.h" #include "../VehiclePaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Stick; enum diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index d0f8b4e30b..4f2fa929f1 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -22,6 +22,8 @@ #include +using namespace OpenRCT2; + enum { SprObservationTowerSegmentBase = 14986, diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 5dfaac3257..0ee31b8201 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -18,6 +18,9 @@ #include "../Track.h" #include "../TrackPaint.h" #include "../Vehicle.h" + +using namespace OpenRCT2; + enum { SprSpaceRingsFenceNe = 22146, diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 647adb0142..a953120100 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -18,6 +18,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + enum { SpiralSlideLeftR0 = 0, diff --git a/src/openrct2/ride/gentle/meta/CarRide.h b/src/openrct2/ride/gentle/meta/CarRide.h index 9e28523e60..7c04cdc549 100644 --- a/src/openrct2/ride/gentle/meta/CarRide.h +++ b/src/openrct2/ride/gentle/meta/CarRide.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor CarRideRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionCarRide, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL, TRACK_SPINNING_TUNNEL}, diff --git a/src/openrct2/ride/gentle/meta/Circus.h b/src/openrct2/ride/gentle/meta/Circus.h index a62516cf40..c3d505297b 100644 --- a/src/openrct2/ride/gentle/meta/Circus.h +++ b/src/openrct2/ride/gentle/meta/Circus.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor CircusRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::FlatTrack3x3, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack3x3, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionCircus, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/gentle/meta/CrookedHouse.h b/src/openrct2/ride/gentle/meta/CrookedHouse.h index 0e8c4cda6f..c3f2a72bcc 100644 --- a/src/openrct2/ride/gentle/meta/CrookedHouse.h +++ b/src/openrct2/ride/gentle/meta/CrookedHouse.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor CrookedHouseRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::FlatTrack3x3, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack3x3, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionCrookedHouse, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/gentle/meta/Dodgems.h b/src/openrct2/ride/gentle/meta/Dodgems.h index 2d768416f1..fc4bcaa1e5 100644 --- a/src/openrct2/ride/gentle/meta/Dodgems.h +++ b/src/openrct2/ride/gentle/meta/Dodgems.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor DodgemsRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::FlatTrack4x4, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack4x4, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionDodgems, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/gentle/meta/FerrisWheel.h b/src/openrct2/ride/gentle/meta/FerrisWheel.h index f99f023ae5..f819133de5 100644 --- a/src/openrct2/ride/gentle/meta/FerrisWheel.h +++ b/src/openrct2/ride/gentle/meta/FerrisWheel.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor FerrisWheelRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::FlatTrack1x4C, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x4C, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionFerrisWheel, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/gentle/meta/FlyingSaucers.h b/src/openrct2/ride/gentle/meta/FlyingSaucers.h index 642d924d03..ab80e07d48 100644 --- a/src/openrct2/ride/gentle/meta/FlyingSaucers.h +++ b/src/openrct2/ride/gentle/meta/FlyingSaucers.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor FlyingSaucersRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::FlatTrack4x4, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack4x4, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionFlyingSaucers, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/gentle/meta/GhostTrain.h b/src/openrct2/ride/gentle/meta/GhostTrain.h index 5d58202eeb..0d46dce151 100644 --- a/src/openrct2/ride/gentle/meta/GhostTrain.h +++ b/src/openrct2/ride/gentle/meta/GhostTrain.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor GhostTrainRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionGhostTrain, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL, TRACK_BRAKES, TRACK_SPINNING_TUNNEL}, diff --git a/src/openrct2/ride/gentle/meta/HauntedHouse.h b/src/openrct2/ride/gentle/meta/HauntedHouse.h index e41c937570..39bffc5c15 100644 --- a/src/openrct2/ride/gentle/meta/HauntedHouse.h +++ b/src/openrct2/ride/gentle/meta/HauntedHouse.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor HauntedHouseRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::FlatTrack3x3, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack3x3, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionHauntedHouse, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/gentle/meta/Maze.h b/src/openrct2/ride/gentle/meta/Maze.h index a913015776..5c9ed1a42d 100644 --- a/src/openrct2/ride/gentle/meta/Maze.h +++ b/src/openrct2/ride/gentle/meta/Maze.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor MazeRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::Maze, + .StartTrackPiece = OpenRCT2::TrackElemType::Maze, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMaze, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/gentle/meta/MerryGoRound.h b/src/openrct2/ride/gentle/meta/MerryGoRound.h index f6b13a6e15..ad03de63cb 100644 --- a/src/openrct2/ride/gentle/meta/MerryGoRound.h +++ b/src/openrct2/ride/gentle/meta/MerryGoRound.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor MerryGoRoundRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::FlatTrack3x3, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack3x3, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMerryGoRound, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/gentle/meta/MiniGolf.h b/src/openrct2/ride/gentle/meta/MiniGolf.h index 190d5f0dae..9b1c0d2ba8 100644 --- a/src/openrct2/ride/gentle/meta/MiniGolf.h +++ b/src/openrct2/ride/gentle/meta/MiniGolf.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor MiniGolfRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMiniGolf, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_CURVE_VERY_SMALL, TRACK_MINI_GOLF_HOLE}, diff --git a/src/openrct2/ride/gentle/meta/MiniHelicopters.h b/src/openrct2/ride/gentle/meta/MiniHelicopters.h index 742bbc211b..181dee785f 100644 --- a/src/openrct2/ride/gentle/meta/MiniHelicopters.h +++ b/src/openrct2/ride/gentle/meta/MiniHelicopters.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor MiniHelicoptersRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMiniHelicopters, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL}, diff --git a/src/openrct2/ride/gentle/meta/MonorailCycles.h b/src/openrct2/ride/gentle/meta/MonorailCycles.h index 54e6c43106..0ef3811b4d 100644 --- a/src/openrct2/ride/gentle/meta/MonorailCycles.h +++ b/src/openrct2/ride/gentle/meta/MonorailCycles.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor MonorailCyclesRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMonorailCycles, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE}, diff --git a/src/openrct2/ride/gentle/meta/MonsterTrucks.h b/src/openrct2/ride/gentle/meta/MonsterTrucks.h index 960226f1d3..3eb19e9832 100644 --- a/src/openrct2/ride/gentle/meta/MonsterTrucks.h +++ b/src/openrct2/ride/gentle/meta/MonsterTrucks.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor MonsterTrucksRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionCarRide, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL, TRACK_RAPIDS}, diff --git a/src/openrct2/ride/gentle/meta/ObservationTower.h b/src/openrct2/ride/gentle/meta/ObservationTower.h index 944adb7791..98b9144e7d 100644 --- a/src/openrct2/ride/gentle/meta/ObservationTower.h +++ b/src/openrct2/ride/gentle/meta/ObservationTower.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor ObservationTowerRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::TowerBase, + .StartTrackPiece = OpenRCT2::TrackElemType::TowerBase, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionObservationTower, .EnabledTrackPieces = {TRACK_TOWER_BASE}, diff --git a/src/openrct2/ride/gentle/meta/SpaceRings.h b/src/openrct2/ride/gentle/meta/SpaceRings.h index b4ce4342d0..d9406eac3b 100644 --- a/src/openrct2/ride/gentle/meta/SpaceRings.h +++ b/src/openrct2/ride/gentle/meta/SpaceRings.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SpaceRingsRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::FlatTrack3x3, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack3x3, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSpaceRings, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/gentle/meta/SpiralSlide.h b/src/openrct2/ride/gentle/meta/SpiralSlide.h index 32e8d330a5..c686318507 100644 --- a/src/openrct2/ride/gentle/meta/SpiralSlide.h +++ b/src/openrct2/ride/gentle/meta/SpiralSlide.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SpiralSlideRTD = { .Category = RIDE_CATEGORY_GENTLE, - .StartTrackPiece = TrackElemType::FlatTrack2x2, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack2x2, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSpiralSlide, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/shops/Facility.cpp b/src/openrct2/ride/shops/Facility.cpp index 37d4eb3e0d..ed5913b6d4 100644 --- a/src/openrct2/ride/shops/Facility.cpp +++ b/src/openrct2/ride/shops/Facility.cpp @@ -21,6 +21,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static void PaintFacility( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) diff --git a/src/openrct2/ride/shops/Shop.cpp b/src/openrct2/ride/shops/Shop.cpp index 441618caa9..eb86ca9a6b 100644 --- a/src/openrct2/ride/shops/Shop.cpp +++ b/src/openrct2/ride/shops/Shop.cpp @@ -20,6 +20,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static void PaintShop( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) diff --git a/src/openrct2/ride/shops/meta/CashMachine.h b/src/openrct2/ride/shops/meta/CashMachine.h index 5598b70b02..7f1bd2c25a 100644 --- a/src/openrct2/ride/shops/meta/CashMachine.h +++ b/src/openrct2/ride/shops/meta/CashMachine.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor CashMachineRTD = { .Category = RIDE_CATEGORY_SHOP, - .StartTrackPiece = TrackElemType::FlatTrack1x1A, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x1A, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionShop, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/shops/meta/DrinkStall.h b/src/openrct2/ride/shops/meta/DrinkStall.h index c2e5af706c..78c05ed7b3 100644 --- a/src/openrct2/ride/shops/meta/DrinkStall.h +++ b/src/openrct2/ride/shops/meta/DrinkStall.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor DrinkStallRTD = { .Category = RIDE_CATEGORY_SHOP, - .StartTrackPiece = TrackElemType::FlatTrack1x1A, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x1A, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionShop, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/shops/meta/FirstAid.h b/src/openrct2/ride/shops/meta/FirstAid.h index 57fe47b211..6a5d86e9b0 100644 --- a/src/openrct2/ride/shops/meta/FirstAid.h +++ b/src/openrct2/ride/shops/meta/FirstAid.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor FirstAidRTD = { .Category = RIDE_CATEGORY_SHOP, - .StartTrackPiece = TrackElemType::FlatTrack1x1A, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x1A, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionFacility, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/shops/meta/FoodStall.h b/src/openrct2/ride/shops/meta/FoodStall.h index 3a11a433e4..f73681d3f7 100644 --- a/src/openrct2/ride/shops/meta/FoodStall.h +++ b/src/openrct2/ride/shops/meta/FoodStall.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor FoodStallRTD = { .Category = RIDE_CATEGORY_SHOP, - .StartTrackPiece = TrackElemType::FlatTrack1x1A, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x1A, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionShop, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/shops/meta/InformationKiosk.h b/src/openrct2/ride/shops/meta/InformationKiosk.h index 6785fc7150..990da36253 100644 --- a/src/openrct2/ride/shops/meta/InformationKiosk.h +++ b/src/openrct2/ride/shops/meta/InformationKiosk.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor InformationKioskRTD = { .Category = RIDE_CATEGORY_SHOP, - .StartTrackPiece = TrackElemType::FlatTrack1x1B, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x1B, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionShop, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/shops/meta/Shop.h b/src/openrct2/ride/shops/meta/Shop.h index 425fb73a8c..c83701de30 100644 --- a/src/openrct2/ride/shops/meta/Shop.h +++ b/src/openrct2/ride/shops/meta/Shop.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor ShopRTD = { .Category = RIDE_CATEGORY_SHOP, - .StartTrackPiece = TrackElemType::FlatTrack1x1A, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x1A, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionShop, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/shops/meta/Toilets.h b/src/openrct2/ride/shops/meta/Toilets.h index 5d64e8946f..07e8a3db28 100644 --- a/src/openrct2/ride/shops/meta/Toilets.h +++ b/src/openrct2/ride/shops/meta/Toilets.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor ToiletsRTD = { .Category = RIDE_CATEGORY_SHOP, - .StartTrackPiece = TrackElemType::FlatTrack1x1A, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x1A, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionFacility, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index 085a5217fb..b033b4709b 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -19,6 +19,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + static void Paint3dCinemaDome( PaintSession& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height, ImageId stationColour) diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index acc8eab691..23d694ddea 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -20,6 +20,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + static void PaintEnterpriseRiders( PaintSession& session, const RideObjectEntry& rideEntry, Vehicle& vehicle, uint32_t imageOffset, const CoordsXYZ& offset, const BoundBoxXYZ& bb) diff --git a/src/openrct2/ride/thrill/GoKarts.cpp b/src/openrct2/ride/thrill/GoKarts.cpp index 9735781f05..eec3949bcd 100644 --- a/src/openrct2/ride/thrill/GoKarts.cpp +++ b/src/openrct2/ride/thrill/GoKarts.cpp @@ -19,6 +19,8 @@ #include "../TrackPaint.h" #include "../VehiclePaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; enum diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 050a313843..632e71ad34 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -21,6 +21,8 @@ #include +using namespace OpenRCT2; + enum { SPR_LAUNCHED_FREEFALL_TOWER_BASE = 14564, diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 8b6c71b4da..50350b5c47 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -21,6 +21,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + enum class Plane { Back, diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index f61f617be5..2d39f846df 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -20,6 +20,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + enum { SPR_MOTION_SIMULATOR_STAIRS_R0 = 22154, diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index 2258418c0f..77b5f3ccaf 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -22,6 +22,8 @@ #include #include +using namespace OpenRCT2; + enum { SPR_ROTO_DROP_TOWER_SEGMENT = 14558, diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index 45286f0f0f..a5cf30bfcd 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -21,6 +21,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + /** rct2: 0x01428010 */ static constexpr uint32_t SwingingInverterShipBaseSpriteOffset[] = { 0, diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index 6e14dd7f31..fc445305b2 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -21,6 +21,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + // 1 2 0 3 4 static constexpr uint8_t track_map_1x5[][5] = { { 0, 1, 2, 3, 4 }, diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 55918459c1..c13b8ab0e3 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -21,6 +21,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + static int16_t TopSpinSeatHeightOffset[] = { -10, -10, -9, -7, -4, -1, 2, 6, 11, 16, 21, 26, 31, 37, 42, 47, 52, 57, 61, 64, 67, 70, 72, 73, 73, 73, 72, 70, 67, 64, 61, 57, 52, 47, 42, 37, 31, 26, 21, 16, 11, 6, 2, -1, -4, -7, -9, -10, diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index e3497b9d5f..d8657c8cf0 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -20,6 +20,8 @@ #include "../TrackPaint.h" #include "../Vehicle.h" +using namespace OpenRCT2; + /** rct2: 0x0076E5C9 */ static void PaintTwistStructure( PaintSession& session, const Ride& ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height, diff --git a/src/openrct2/ride/thrill/meta/3DCinema.h b/src/openrct2/ride/thrill/meta/3DCinema.h index 57b330c774..f2c696fbdf 100644 --- a/src/openrct2/ride/thrill/meta/3DCinema.h +++ b/src/openrct2/ride/thrill/meta/3DCinema.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor CinemaRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::FlatTrack3x3, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack3x3, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunction3dCinema, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/thrill/meta/Enterprise.h b/src/openrct2/ride/thrill/meta/Enterprise.h index 5d507aef3e..edcf7e4194 100644 --- a/src/openrct2/ride/thrill/meta/Enterprise.h +++ b/src/openrct2/ride/thrill/meta/Enterprise.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor EnterpriseRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::FlatTrack4x4, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack4x4, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionEnterprise, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/thrill/meta/GoKarts.h b/src/openrct2/ride/thrill/meta/GoKarts.h index 8ff2aa5067..91eaaad304 100644 --- a/src/openrct2/ride/thrill/meta/GoKarts.h +++ b/src/openrct2/ride/thrill/meta/GoKarts.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor GoKartsRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionGoKarts, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_CURVE_VERY_SMALL}, diff --git a/src/openrct2/ride/thrill/meta/LaunchedFreefall.h b/src/openrct2/ride/thrill/meta/LaunchedFreefall.h index 8e18c4b83c..921b934750 100644 --- a/src/openrct2/ride/thrill/meta/LaunchedFreefall.h +++ b/src/openrct2/ride/thrill/meta/LaunchedFreefall.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor LaunchedFreefallRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::TowerBase, + .StartTrackPiece = OpenRCT2::TrackElemType::TowerBase, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionLaunchedFreefall, .EnabledTrackPieces = {TRACK_TOWER_BASE}, diff --git a/src/openrct2/ride/thrill/meta/MagicCarpet.h b/src/openrct2/ride/thrill/meta/MagicCarpet.h index cc97af0287..eac9f0be42 100644 --- a/src/openrct2/ride/thrill/meta/MagicCarpet.h +++ b/src/openrct2/ride/thrill/meta/MagicCarpet.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor MagicCarpetRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::FlatTrack1x4A, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x4A, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMagicCarpet, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/thrill/meta/MotionSimulator.h b/src/openrct2/ride/thrill/meta/MotionSimulator.h index 17079e1531..0c5825a7b0 100644 --- a/src/openrct2/ride/thrill/meta/MotionSimulator.h +++ b/src/openrct2/ride/thrill/meta/MotionSimulator.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor MotionSimulatorRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::FlatTrack2x2, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack2x2, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMotionsimulator, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/thrill/meta/RotoDrop.h b/src/openrct2/ride/thrill/meta/RotoDrop.h index da4b0d0065..1b27194d89 100644 --- a/src/openrct2/ride/thrill/meta/RotoDrop.h +++ b/src/openrct2/ride/thrill/meta/RotoDrop.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor RotoDropRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::TowerBase, + .StartTrackPiece = OpenRCT2::TrackElemType::TowerBase, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionRotoDrop, .EnabledTrackPieces = {TRACK_TOWER_BASE}, diff --git a/src/openrct2/ride/thrill/meta/SwingingInverterShip.h b/src/openrct2/ride/thrill/meta/SwingingInverterShip.h index cdabad63be..d4c936b997 100644 --- a/src/openrct2/ride/thrill/meta/SwingingInverterShip.h +++ b/src/openrct2/ride/thrill/meta/SwingingInverterShip.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SwingingInverterShipRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::FlatTrack1x4B, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x4B, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSwingingInverterShip, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/thrill/meta/SwingingShip.h b/src/openrct2/ride/thrill/meta/SwingingShip.h index beef48de3a..1ce045c719 100644 --- a/src/openrct2/ride/thrill/meta/SwingingShip.h +++ b/src/openrct2/ride/thrill/meta/SwingingShip.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SwingingShipRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::FlatTrack1x5, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack1x5, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSwingingShip, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/thrill/meta/TopSpin.h b/src/openrct2/ride/thrill/meta/TopSpin.h index 9e65fabc9d..3a115b4a12 100644 --- a/src/openrct2/ride/thrill/meta/TopSpin.h +++ b/src/openrct2/ride/thrill/meta/TopSpin.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor TopSpinRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::FlatTrack3x3, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack3x3, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionTopspin, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/thrill/meta/Twist.h b/src/openrct2/ride/thrill/meta/Twist.h index d9399378ca..9c18d5b309 100644 --- a/src/openrct2/ride/thrill/meta/Twist.h +++ b/src/openrct2/ride/thrill/meta/Twist.h @@ -17,7 +17,7 @@ constexpr RideTypeDescriptor TwistRTD = { .Category = RIDE_CATEGORY_THRILL, - .StartTrackPiece = TrackElemType::FlatTrack3x3, + .StartTrackPiece = OpenRCT2::TrackElemType::FlatTrack3x3, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionTwist, .EnabledTrackPieces = {}, diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index 9dd5f2eb57..1db9ebb362 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -22,6 +22,8 @@ #include +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Truss; enum diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index c31a19d584..af5d693b21 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -16,6 +16,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + enum { SPR_LIFT_CAGE_BACK = 14994, diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index deca87636b..1bde8c558b 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -20,6 +20,8 @@ #include "../TrackPaint.h" #include "../VehiclePaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; enum diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index 917501d43b..f92ec8d2ff 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -21,6 +21,8 @@ #include "../TrackPaint.h" #include "../VehiclePaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Boxed; enum diff --git a/src/openrct2/ride/transport/SuspendedMonorail.cpp b/src/openrct2/ride/transport/SuspendedMonorail.cpp index 8a2158e31f..77123d4de6 100644 --- a/src/openrct2/ride/transport/SuspendedMonorail.cpp +++ b/src/openrct2/ride/transport/SuspendedMonorail.cpp @@ -21,6 +21,8 @@ #include "../TrackData.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Boxed; static constexpr ImageIndex kSuspendedMonorailDiagFlatImages[kNumOrthogonalDirections] = { 25935, 25936, 25935, 25936 }; diff --git a/src/openrct2/ride/transport/meta/Chairlift.h b/src/openrct2/ride/transport/meta/Chairlift.h index f875c513ca..63bfd3acdc 100644 --- a/src/openrct2/ride/transport/meta/Chairlift.h +++ b/src/openrct2/ride/transport/meta/Chairlift.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor ChairliftRTD = { .Category = RIDE_CATEGORY_TRANSPORT, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionChairlift, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_CURVE_VERY_SMALL}, diff --git a/src/openrct2/ride/transport/meta/Lift.h b/src/openrct2/ride/transport/meta/Lift.h index dab645a7e5..33e561ec0a 100644 --- a/src/openrct2/ride/transport/meta/Lift.h +++ b/src/openrct2/ride/transport/meta/Lift.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor LiftRTD = { .Category = RIDE_CATEGORY_TRANSPORT, - .StartTrackPiece = TrackElemType::TowerBase, + .StartTrackPiece = OpenRCT2::TrackElemType::TowerBase, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionLift, .EnabledTrackPieces = {TRACK_TOWER_BASE}, diff --git a/src/openrct2/ride/transport/meta/MiniatureRailway.h b/src/openrct2/ride/transport/meta/MiniatureRailway.h index 837bf86811..b950788da4 100644 --- a/src/openrct2/ride/transport/meta/MiniatureRailway.h +++ b/src/openrct2/ride/transport/meta/MiniatureRailway.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor MiniatureRailwayRTD = { .Category = RIDE_CATEGORY_TRANSPORT, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMiniatureRailway, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE}, diff --git a/src/openrct2/ride/transport/meta/Monorail.h b/src/openrct2/ride/transport/meta/Monorail.h index fe67581590..11338a278b 100644 --- a/src/openrct2/ride/transport/meta/Monorail.h +++ b/src/openrct2/ride/transport/meta/Monorail.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor MonorailRTD = { .Category = RIDE_CATEGORY_TRANSPORT, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionMonorail, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE}, diff --git a/src/openrct2/ride/transport/meta/SuspendedMonorail.h b/src/openrct2/ride/transport/meta/SuspendedMonorail.h index db067e8512..99e0163f4e 100644 --- a/src/openrct2/ride/transport/meta/SuspendedMonorail.h +++ b/src/openrct2/ride/transport/meta/SuspendedMonorail.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor SuspendedMonorailRTD = { .Category = RIDE_CATEGORY_TRANSPORT, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSuspendedMonorail, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE}, diff --git a/src/openrct2/ride/water/BoatHire.cpp b/src/openrct2/ride/water/BoatHire.cpp index 2783597755..20a604d27c 100644 --- a/src/openrct2/ride/water/BoatHire.cpp +++ b/src/openrct2/ride/water/BoatHire.cpp @@ -17,6 +17,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + enum { SPR_BOAT_HIRE_FLAT_BACK_SW_NE = 28523, diff --git a/src/openrct2/ride/water/DinghySlide.cpp b/src/openrct2/ride/water/DinghySlide.cpp index af9f784e08..3bb2838d5a 100644 --- a/src/openrct2/ride/water/DinghySlide.cpp +++ b/src/openrct2/ride/water/DinghySlide.cpp @@ -16,6 +16,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; enum diff --git a/src/openrct2/ride/water/DinghySlideCovered.cpp b/src/openrct2/ride/water/DinghySlideCovered.cpp index b05e9dacea..91c54a84f5 100644 --- a/src/openrct2/ride/water/DinghySlideCovered.cpp +++ b/src/openrct2/ride/water/DinghySlideCovered.cpp @@ -16,6 +16,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Tubes; enum diff --git a/src/openrct2/ride/water/LogFlume.cpp b/src/openrct2/ride/water/LogFlume.cpp index cd8d679329..e5e80693b3 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -17,6 +17,8 @@ #include "../Track.h" #include "../TrackPaint.h" +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Boxed; enum diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index 2e1beb6832..8899df2e56 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -19,6 +19,8 @@ #include "../Vehicle.h" #include "../VehiclePaint.h" +using namespace OpenRCT2; + static constexpr WoodenSupportType kSupportType = WoodenSupportType::Truss; enum diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index 1e422e2c51..8b78ca0c3d 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -21,6 +21,8 @@ #include +using namespace OpenRCT2; + static constexpr MetalSupportType kSupportType = MetalSupportType::Stick; static uint32_t SubmarineVehicleGetBaseImageId(const Vehicle* vehicle, const CarEntry* carEntry, int32_t imageDirection) diff --git a/src/openrct2/ride/water/meta/BoatHire.h b/src/openrct2/ride/water/meta/BoatHire.h index e12c9084a3..038d869dea 100644 --- a/src/openrct2/ride/water/meta/BoatHire.h +++ b/src/openrct2/ride/water/meta/BoatHire.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor BoatHireRTD = { .Category = RIDE_CATEGORY_WATER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionBoatHire, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_CURVE_VERY_SMALL}, diff --git a/src/openrct2/ride/water/meta/DinghySlide.h b/src/openrct2/ride/water/meta/DinghySlide.h index 9fb28e97fe..625916b436 100644 --- a/src/openrct2/ride/water/meta/DinghySlide.h +++ b/src/openrct2/ride/water/meta/DinghySlide.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor DinghySlideRTD = { .Category = RIDE_CATEGORY_WATER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor( { .Drawer = GetTrackPaintFunctionDinghySlide, @@ -27,7 +27,7 @@ constexpr RideTypeDescriptor DinghySlideRTD = }, { .Drawer = GetTrackPaintFunctionDinghySlideCovered, - .EnabledTrackPieces = {TrackElemType::Flat, TrackElemType::Up25, TrackElemType::Up60, TrackElemType::FlatToUp25, TrackElemType::Up25ToUp60, TrackElemType::Up60ToUp25, TrackElemType::Up25ToFlat, TrackElemType::Down25, TrackElemType::Down60, TrackElemType::FlatToDown25, TrackElemType::Down25ToDown60, TrackElemType::Down60ToDown25, TrackElemType::Down25ToFlat, TrackElemType::LeftQuarterTurn5Tiles, TrackElemType::RightQuarterTurn5Tiles, TrackElemType::SBendLeft, TrackElemType::SBendRight, TrackElemType::LeftQuarterTurn3Tiles,TrackElemType::RightQuarterTurn3Tiles}, + .EnabledTrackPieces = {OpenRCT2::TrackElemType::Flat, OpenRCT2::TrackElemType::Up25, OpenRCT2::TrackElemType::Up60, OpenRCT2::TrackElemType::FlatToUp25, OpenRCT2::TrackElemType::Up25ToUp60, OpenRCT2::TrackElemType::Up60ToUp25, OpenRCT2::TrackElemType::Up25ToFlat, OpenRCT2::TrackElemType::Down25, OpenRCT2::TrackElemType::Down60, OpenRCT2::TrackElemType::FlatToDown25, OpenRCT2::TrackElemType::Down25ToDown60, OpenRCT2::TrackElemType::Down60ToDown25, OpenRCT2::TrackElemType::Down25ToFlat, OpenRCT2::TrackElemType::LeftQuarterTurn5Tiles, OpenRCT2::TrackElemType::RightQuarterTurn5Tiles, OpenRCT2::TrackElemType::SBendLeft, OpenRCT2::TrackElemType::SBendRight, OpenRCT2::TrackElemType::LeftQuarterTurn3Tiles,OpenRCT2::TrackElemType::RightQuarterTurn3Tiles}, .ExtraTrackPieces = {}, } ), diff --git a/src/openrct2/ride/water/meta/LogFlume.h b/src/openrct2/ride/water/meta/LogFlume.h index a33bafc499..d18689b38a 100644 --- a/src/openrct2/ride/water/meta/LogFlume.h +++ b/src/openrct2/ride/water/meta/LogFlume.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor LogFlumeRTD = { .Category = RIDE_CATEGORY_WATER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionLogFlume, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_ON_RIDE_PHOTO, TRACK_LOG_FLUME_REVERSER, TRACK_SLOPE_STEEP_DOWN}, diff --git a/src/openrct2/ride/water/meta/RiverRafts.h b/src/openrct2/ride/water/meta/RiverRafts.h index be1cb35adf..d286607aa9 100644 --- a/src/openrct2/ride/water/meta/RiverRafts.h +++ b/src/openrct2/ride/water/meta/RiverRafts.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor RiverRaftsRTD = { .Category = RIDE_CATEGORY_WATER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSplashBoats, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_S_BEND, TRACK_CURVE}, diff --git a/src/openrct2/ride/water/meta/RiverRapids.h b/src/openrct2/ride/water/meta/RiverRapids.h index 2f25320496..c364fe2400 100644 --- a/src/openrct2/ride/water/meta/RiverRapids.h +++ b/src/openrct2/ride/water/meta/RiverRapids.h @@ -18,7 +18,7 @@ constexpr RideTypeDescriptor RiverRapidsRTD = { .Category = RIDE_CATEGORY_WATER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionRiverRapids, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_CURVE_VERY_SMALL, TRACK_ON_RIDE_PHOTO, TRACK_RAPIDS, TRACK_WATERFALL, TRACK_WHIRLPOOL}, diff --git a/src/openrct2/ride/water/meta/SplashBoats.h b/src/openrct2/ride/water/meta/SplashBoats.h index 091def0f4f..43884f1cbd 100644 --- a/src/openrct2/ride/water/meta/SplashBoats.h +++ b/src/openrct2/ride/water/meta/SplashBoats.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor SplashBoatsRTD = { .Category = RIDE_CATEGORY_WATER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSplashBoats, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_SLOPE, TRACK_SLOPE_STEEP_DOWN, TRACK_S_BEND, TRACK_CURVE, TRACK_ON_RIDE_PHOTO}, diff --git a/src/openrct2/ride/water/meta/SubmarineRide.h b/src/openrct2/ride/water/meta/SubmarineRide.h index a8076e2aca..48ba84bd37 100644 --- a/src/openrct2/ride/water/meta/SubmarineRide.h +++ b/src/openrct2/ride/water/meta/SubmarineRide.h @@ -19,7 +19,7 @@ constexpr RideTypeDescriptor SubmarineRideRTD = { .Category = RIDE_CATEGORY_WATER, - .StartTrackPiece = TrackElemType::EndStation, + .StartTrackPiece = OpenRCT2::TrackElemType::EndStation, .TrackPaintFunctions = TrackDrawerDescriptor({ .Drawer = GetTrackPaintFunctionSubmarineRide, .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_CURVE_VERY_SMALL, TRACK_CURVE_SMALL}, diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index 2f500e1d69..fd2faecaf5 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -22,7 +22,7 @@ struct ResultWithMessage; -using random_engine_t = Random::RCT2::Engine; +using random_engine_t = OpenRCT2::Random::RCT2::Engine; namespace OpenRCT2 { diff --git a/src/openrct2/scenario/ScenarioSources.cpp b/src/openrct2/scenario/ScenarioSources.cpp index b5e319bc68..13e2d1b229 100644 --- a/src/openrct2/scenario/ScenarioSources.cpp +++ b/src/openrct2/scenario/ScenarioSources.cpp @@ -17,7 +17,7 @@ #include -namespace ScenarioSources +namespace OpenRCT2::ScenarioSources { struct ScenarioAlias { @@ -453,4 +453,4 @@ namespace ScenarioSources } } } -} // namespace ScenarioSources +} // namespace OpenRCT2::ScenarioSources diff --git a/src/openrct2/scenario/ScenarioSources.h b/src/openrct2/scenario/ScenarioSources.h index deabfa28d1..402d96500f 100644 --- a/src/openrct2/scenario/ScenarioSources.h +++ b/src/openrct2/scenario/ScenarioSources.h @@ -20,12 +20,12 @@ struct SourceDescriptor uint8_t category; }; -namespace ScenarioSources +namespace OpenRCT2::ScenarioSources { bool TryGetByName(const utf8* name, SourceDescriptor* outDesc); bool TryGetById(uint8_t id, SourceDescriptor* outDesc); void NormaliseName(utf8* buffer, size_t bufferSize, const utf8* name); -} // namespace ScenarioSources +} // namespace OpenRCT2::ScenarioSources // RCT1 scenario index map enum diff --git a/src/openrct2/scenes/title/TitleScene.cpp b/src/openrct2/scenes/title/TitleScene.cpp index dcdc31ded9..c2bf692cbf 100644 --- a/src/openrct2/scenes/title/TitleScene.cpp +++ b/src/openrct2/scenes/title/TitleScene.cpp @@ -179,7 +179,7 @@ void TitleScene::ChangePresetSequence(size_t preset) return; } - const utf8* configId = TitleSequenceManagerGetConfigID(preset); + const utf8* configId = TitleSequenceManager::GetConfigID(preset); Config::Get().interface.CurrentTitleSequencePreset = configId; if (!_previewingSequence) @@ -248,7 +248,7 @@ void TitleScene::TitleInitialise() while (!safeSequence) { random = UtilRand() % static_cast(total); - const utf8* scName = TitleSequenceManagerGetName(random); + const utf8* scName = TitleSequenceManager::GetName(random); if (scName == RCT1String) { safeSequence = RCT1Installed; @@ -272,7 +272,7 @@ void TitleScene::TitleInitialise() size_t seqId = TitleGetConfigSequence(); if (seqId == SIZE_MAX) { - seqId = TitleSequenceManagerGetIndexForConfigID("*OPENRCT2"); + seqId = TitleSequenceManager::GetIndexForConfigID("*OPENRCT2"); if (seqId == SIZE_MAX) { seqId = 0; @@ -302,7 +302,7 @@ bool TitleScene::TryLoadSequence(bool loadPreview) if (targetSequence != _currentSequence && !loadPreview) { // Forcefully change the preset to a preset that works. - const utf8* configId = TitleSequenceManagerGetConfigID(targetSequence); + const utf8* configId = TitleSequenceManager::GetConfigID(targetSequence); Config::Get().interface.CurrentTitleSequencePreset = configId; } _currentSequence = targetSequence; @@ -359,7 +359,7 @@ void TitleSequenceChangePreset(size_t preset) size_t TitleGetConfigSequence() { - return TitleSequenceManagerGetIndexForConfigID(Config::Get().interface.CurrentTitleSequencePreset.c_str()); + return TitleSequenceManager::GetIndexForConfigID(Config::Get().interface.CurrentTitleSequencePreset.c_str()); } size_t TitleGetCurrentSequence() diff --git a/src/openrct2/scenes/title/TitleSequenceManager.cpp b/src/openrct2/scenes/title/TitleSequenceManager.cpp index abce274104..4252028403 100644 --- a/src/openrct2/scenes/title/TitleSequenceManager.cpp +++ b/src/openrct2/scenes/title/TitleSequenceManager.cpp @@ -26,7 +26,7 @@ #include #include -namespace TitleSequenceManager +namespace OpenRCT2::TitleSequenceManager { struct PredefinedSequence { @@ -43,7 +43,7 @@ namespace TitleSequenceManager { "*OPENRCT2", "openrct2.parkseq", STR_TITLE_SEQUENCE_OPENRCT2 }, }; - static std::vector _items; + static std::vector _items; static std::string GetNewTitleSequencePath(const std::string& name, bool isZip); static size_t FindItemIndexByPath(const std::string& path); @@ -60,7 +60,7 @@ namespace TitleSequenceManager return _items.size(); } - const TitleSequenceManagerItem* GetItem(size_t i) + const Item* GetItem(size_t i) { if (i >= _items.size()) { @@ -71,8 +71,7 @@ namespace TitleSequenceManager static size_t FindItemIndexByPath(const std::string& path) { - size_t index = Collections::IndexOf( - _items, [path](const TitleSequenceManagerItem& item) -> bool { return path == item.Path; }); + size_t index = Collections::IndexOf(_items, [path](const Item& item) -> bool { return path == item.Path; }); return index; } @@ -103,7 +102,7 @@ namespace TitleSequenceManager auto newPath = Path::Combine(Path::GetDirectory(oldPath), newName); if (item->IsZip) { - newPath += OpenRCT2::Title::TITLE_SEQUENCE_EXTENSION; + newPath += Title::TITLE_SEQUENCE_EXTENSION; File::Move(oldPath, newPath); } else @@ -138,7 +137,7 @@ namespace TitleSequenceManager size_t CreateItem(const utf8* name) { - auto seq = OpenRCT2::Title::CreateTitleSequence(); + auto seq = Title::CreateTitleSequence(); seq->Name = name; seq->Path = GetNewTitleSequencePath(seq->Name, true); seq->IsZip = true; @@ -159,7 +158,7 @@ namespace TitleSequenceManager auto path = Path::Combine(GetUserSequencesPath(), name); if (isZip) { - path += OpenRCT2::Title::TITLE_SEQUENCE_EXTENSION; + path += Title::TITLE_SEQUENCE_EXTENSION; } return path; } @@ -174,20 +173,19 @@ namespace TitleSequenceManager return i; } } - return PREDEFINED_INDEX_CUSTOM; + return kPredefinedIndexCustom; } static void SortSequences() { // Sort sequences by predefined index and then name - std::sort( - _items.begin(), _items.end(), [](const TitleSequenceManagerItem& a, const TitleSequenceManagerItem& b) -> bool { - if (a.PredefinedIndex != b.PredefinedIndex) - { - return a.PredefinedIndex < b.PredefinedIndex; - } - return String::Compare(a.Name, b.Name, true) < 0; - }); + std::sort(_items.begin(), _items.end(), [](const Item& a, const Item& b) -> bool { + if (a.PredefinedIndex != b.PredefinedIndex) + { + return a.PredefinedIndex < b.PredefinedIndex; + } + return String::Compare(a.Name, b.Name, true) < 0; + }); } void Scan() @@ -215,7 +213,7 @@ namespace TitleSequenceManager static void AddSequence(const std::string& scanPath) { - TitleSequenceManagerItem item{}; + Item item{}; if (String::IEquals(Path::GetExtension(scanPath), u8".txt")) { @@ -233,7 +231,7 @@ namespace TitleSequenceManager item.PredefinedIndex = GetPredefinedIndex(item.Path); - if (item.PredefinedIndex != PREDEFINED_INDEX_CUSTOM) + if (item.PredefinedIndex != kPredefinedIndexCustom) { StringId stringId = PredefinedSequences[item.PredefinedIndex].StringId; item.Name = LanguageGetString(stringId); @@ -256,14 +254,14 @@ namespace TitleSequenceManager static std::string GetDataSequencesPath() { - auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); - return env->GetDirectoryPath(OpenRCT2::DIRBASE::OPENRCT2, OpenRCT2::DIRID::SEQUENCE); + auto env = GetContext()->GetPlatformEnvironment(); + return env->GetDirectoryPath(DIRBASE::OPENRCT2, DIRID::SEQUENCE); } static std::string GetUserSequencesPath() { - auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); - return env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::SEQUENCE); + auto env = GetContext()->GetPlatformEnvironment(); + return env->GetDirectoryPath(DIRBASE::USER, DIRID::SEQUENCE); } static bool IsNameReserved(const std::string& name) @@ -277,112 +275,82 @@ namespace TitleSequenceManager } return false; } -} // namespace TitleSequenceManager -size_t TitleSequenceManagerGetCount() -{ - return TitleSequenceManager::GetCount(); -} - -const utf8* TitleSequenceManagerGetName(size_t index) -{ - auto item = TitleSequenceManager::GetItem(index); - if (item == nullptr) + const utf8* GetName(size_t index) { - return nullptr; - } - return item->Name.c_str(); -} - -const utf8* TitleSequenceManagerGetPath(size_t index) -{ - auto item = TitleSequenceManager::GetItem(index); - if (item == nullptr) - { - return nullptr; - } - return item->Path.c_str(); -} - -const utf8* TitleSequenceManagerGetConfigID(size_t index) -{ - auto item = TitleSequenceManager::GetItem(index); - if (item == nullptr) - { - return nullptr; - } - const auto& name = item->Name; - const auto filename = Path::GetFileName(item->Path); - for (const auto& pseq : TitleSequenceManager::PredefinedSequences) - { - if (String::IEquals(filename, pseq.Filename)) + auto item = GetItem(index); + if (item == nullptr) { - return pseq.ConfigId; + return nullptr; } + return item->Name.c_str(); } - return name.c_str(); -} -size_t TitleSequenceManagerGetPredefinedIndex(size_t index) -{ - auto item = TitleSequenceManager::GetItem(index); - if (item == nullptr) + const utf8* GetPath(size_t index) { - return 0; - } - size_t predefinedIndex = item->PredefinedIndex; - return predefinedIndex; -} - -size_t TitleSequenceManagerGetIndexForConfigID(const utf8* configId) -{ - size_t count = TitleSequenceManager::GetCount(); - for (size_t i = 0; i < count; i++) - { - const utf8* cid = TitleSequenceManagerGetConfigID(i); - if (String::Equals(cid, configId)) + auto item = GetItem(index); + if (item == nullptr) { - return i; + return nullptr; } + return item->Path.c_str(); } - return SIZE_MAX; -} -size_t TitleSequenceManagerGetIndexForName(const utf8* name) -{ - size_t count = TitleSequenceManager::GetCount(); - for (size_t i = 0; i < count; i++) + const utf8* GetConfigID(size_t index) { - const utf8* tn = TitleSequenceManagerGetName(i); - if (String::Equals(tn, name)) + auto item = GetItem(index); + if (item == nullptr) { - return i; + return nullptr; } + const auto& name = item->Name; + const auto filename = Path::GetFileName(item->Path); + for (const auto& pseq : PredefinedSequences) + { + if (String::IEquals(filename, pseq.Filename)) + { + return pseq.ConfigId; + } + } + return name.c_str(); } - return SIZE_MAX; -} -void TitleSequenceManagerScan() -{ - TitleSequenceManager::Scan(); -} + size_t GetPredefinedIndex(size_t index) + { + auto item = GetItem(index); + if (item == nullptr) + { + return 0; + } + size_t predefinedIndex = item->PredefinedIndex; + return predefinedIndex; + } -void TitleSequenceManagerDelete(size_t i) -{ - TitleSequenceManager::DeleteItem(i); -} + size_t GetIndexForConfigID(const utf8* configId) + { + size_t count = GetCount(); + for (size_t i = 0; i < count; i++) + { + const utf8* cid = GetConfigID(i); + if (String::Equals(cid, configId)) + { + return i; + } + } + return SIZE_MAX; + } -size_t TitleSequenceManagerRename(size_t i, const utf8* name) -{ - return TitleSequenceManager::RenameItem(i, name); -} - -size_t TitleSequenceManagerDuplicate(size_t i, const utf8* name) -{ - return TitleSequenceManager::DuplicateItem(i, name); -} - -size_t TitleSequenceManagerCreate(const utf8* name) -{ - return TitleSequenceManager::CreateItem(name); -} + size_t GetIndexForName(const utf8* name) + { + size_t count = GetCount(); + for (size_t i = 0; i < count; i++) + { + const utf8* tn = GetName(i); + if (String::Equals(tn, name)) + { + return i; + } + } + return SIZE_MAX; + } +} // namespace OpenRCT2::TitleSequenceManager diff --git a/src/openrct2/scenes/title/TitleSequenceManager.h b/src/openrct2/scenes/title/TitleSequenceManager.h index fa72615a19..35ed2b273b 100644 --- a/src/openrct2/scenes/title/TitleSequenceManager.h +++ b/src/openrct2/scenes/title/TitleSequenceManager.h @@ -14,36 +14,30 @@ #include #include -struct TitleSequenceManagerItem +namespace OpenRCT2::TitleSequenceManager { - std::string Name; - std::string Path; - size_t PredefinedIndex; - bool IsZip; -}; + struct Item + { + std::string Name; + std::string Path; + size_t PredefinedIndex; + bool IsZip; + }; + + constexpr size_t kPredefinedIndexCustom = std::numeric_limits::max(); -namespace TitleSequenceManager -{ size_t GetCount(); - const TitleSequenceManagerItem* GetItem(size_t i); + const Item* GetItem(size_t i); void DeleteItem(size_t i); size_t RenameItem(size_t i, const utf8* name); size_t DuplicateItem(size_t i, const utf8* name); size_t CreateItem(const utf8* name); void Scan(); -} // namespace TitleSequenceManager -constexpr size_t PREDEFINED_INDEX_CUSTOM = std::numeric_limits::max(); - -size_t TitleSequenceManagerGetCount(); -const utf8* TitleSequenceManagerGetName(size_t index); -const utf8* TitleSequenceManagerGetPath(size_t index); -const utf8* TitleSequenceManagerGetConfigID(size_t index); -size_t TitleSequenceManagerGetPredefinedIndex(size_t index); -size_t TitleSequenceManagerGetIndexForConfigID(const utf8* configId); -size_t TitleSequenceManagerGetIndexForName(const utf8* name); -void TitleSequenceManagerScan(); -void TitleSequenceManagerDelete(size_t i); -size_t TitleSequenceManagerRename(size_t i, const utf8* name); -size_t TitleSequenceManagerDuplicate(size_t i, const utf8* name); -size_t TitleSequenceManagerCreate(const utf8* name); + const utf8* GetName(size_t index); + const utf8* GetPath(size_t index); + const utf8* GetConfigID(size_t index); + size_t GetPredefinedIndex(size_t index); + size_t GetIndexForConfigID(const utf8* configId); + size_t GetIndexForName(const utf8* name); +} // namespace OpenRCT2::TitleSequenceManager diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index 0fe438d3c6..3ff8e4747a 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -32,7 +32,7 @@ struct duk_hthread; typedef struct duk_hthread duk_context; class GameAction; -namespace GameActions +namespace OpenRCT2::GameActions { class Result; } diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 5573eb803c..919e91c97d 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -1517,7 +1517,7 @@ enum SPR_G2_END, SPR_CSG_BEGIN = SPR_G2_END, - SPR_CSG_END = SPR_CSG_BEGIN + RCT1::Limits::kNumLLCsgEntries, + SPR_CSG_END = SPR_CSG_BEGIN + OpenRCT2::RCT1::Limits::kNumLLCsgEntries, G2_SPRITE_COUNT = SPR_G2_END - SPR_G2_BEGIN, diff --git a/src/openrct2/util/SawyerCoding.cpp b/src/openrct2/util/SawyerCoding.cpp index c4e222d9ef..76de8d4b0c 100644 --- a/src/openrct2/util/SawyerCoding.cpp +++ b/src/openrct2/util/SawyerCoding.cpp @@ -18,6 +18,8 @@ #include #include +using namespace OpenRCT2; + static size_t DecodeChunkRLE(const uint8_t* src_buffer, uint8_t* dst_buffer, size_t length); static size_t DecodeChunkRLEWithSize(const uint8_t* src_buffer, uint8_t* dst_buffer, size_t length, size_t dstSize); diff --git a/src/openrct2/windows/Intent.cpp b/src/openrct2/windows/Intent.cpp index fd62d54e94..04d38a6f21 100644 --- a/src/openrct2/windows/Intent.cpp +++ b/src/openrct2/windows/Intent.cpp @@ -13,6 +13,8 @@ #include +using namespace OpenRCT2; + Intent::Intent(WindowClass windowClass) : _Class(windowClass) { diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 57c78cd18d..68b100b1c3 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -33,6 +33,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; + bool gDisableErrorWindowSound = false; RideConstructionState _rideConstructionState2; diff --git a/src/openrct2/world/ConstructionClearance.h b/src/openrct2/world/ConstructionClearance.h index a9ab2da454..618592c8d0 100644 --- a/src/openrct2/world/ConstructionClearance.h +++ b/src/openrct2/world/ConstructionClearance.h @@ -39,10 +39,10 @@ struct ConstructClearResult uint8_t GroundFlags{ 0 }; }; -[[nodiscard]] GameActions::Result MapCanConstructWithClearAt( +[[nodiscard]] OpenRCT2::GameActions::Result MapCanConstructWithClearAt( const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, CreateCrossingMode crossingMode = CreateCrossingMode::none, bool isTree = false); -[[nodiscard]] GameActions::Result MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl); +[[nodiscard]] OpenRCT2::GameActions::Result MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl); -void MapGetObstructionErrorText(TileElement* tileElement, GameActions::Result& res); +void MapGetObstructionErrorText(TileElement* tileElement, OpenRCT2::GameActions::Result& res); diff --git a/src/openrct2/world/Entrance.h b/src/openrct2/world/Entrance.h index 9b475642d9..8ff01578a1 100644 --- a/src/openrct2/world/Entrance.h +++ b/src/openrct2/world/Entrance.h @@ -20,12 +20,12 @@ enum ENTRANCE_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY = (1 << 0), }; -namespace EntranceSequence +namespace OpenRCT2::EntranceSequence { constexpr uint8_t Centre = 0; constexpr uint8_t Left = 1; constexpr uint8_t Right = 2; -}; // namespace EntranceSequence +}; // namespace OpenRCT2::EntranceSequence constexpr const uint8_t ParkEntranceHeight = 12 * COORDS_Z_STEP; constexpr const uint8_t RideEntranceHeight = 7 * COORDS_Z_STEP; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index a9781cbf65..2c548f8f9c 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -48,6 +48,7 @@ #include #include +using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; void FootpathUpdateQueueEntranceBanner(const CoordsXY& footpathPos, TileElement* tileElement); diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 6368edb347..fadb0d24d6 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -58,11 +58,11 @@ struct PathRailingsDescriptor }; using PathConstructFlags = uint8_t; -namespace PathConstructFlag +namespace OpenRCT2::PathConstructFlag { constexpr PathConstructFlags IsQueue = 1 << 0; constexpr PathConstructFlags IsLegacyPathObject = 1 << 1; -} // namespace PathConstructFlag +} // namespace OpenRCT2::PathConstructFlag struct FootpathSelection { diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index 939097e530..f0f27cc9e5 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -36,6 +36,8 @@ #include #include +using namespace OpenRCT2; + #pragma region Height map struct static struct diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 13dc2cbabe..ad8595efdb 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -20,6 +20,8 @@ #include "Scenery.h" #include "tile_element/Slope.h" +using namespace OpenRCT2; + bool TileElementIsUnderground(TileElement* tileElement) { do diff --git a/src/openrct2/world/TileInspector.h b/src/openrct2/world/TileInspector.h index 421beeb3e1..777f03899a 100644 --- a/src/openrct2/world/TileInspector.h +++ b/src/openrct2/world/TileInspector.h @@ -11,7 +11,7 @@ #include "Map.h" -namespace GameActions +namespace OpenRCT2::GameActions { class Result; } diff --git a/test/tests/CLITests.cpp b/test/tests/CLITests.cpp index 4081718466..e305aaacd1 100644 --- a/test/tests/CLITests.cpp +++ b/test/tests/CLITests.cpp @@ -8,6 +8,8 @@ #include #include +using namespace OpenRCT2; + class CommandLineTests : public testing::Test { public: diff --git a/test/tests/CryptTests.cpp b/test/tests/CryptTests.cpp index c7d021d2fc..fdfb5ca28a 100644 --- a/test/tests/CryptTests.cpp +++ b/test/tests/CryptTests.cpp @@ -17,6 +17,8 @@ #include #include +using namespace OpenRCT2; + class CryptTests : public testing::Test { public: diff --git a/test/tests/ImageImporterTests.cpp b/test/tests/ImageImporterTests.cpp index ec5d232f87..56aca7dccc 100644 --- a/test/tests/ImageImporterTests.cpp +++ b/test/tests/ImageImporterTests.cpp @@ -14,6 +14,7 @@ #include #include +using namespace OpenRCT2; using namespace OpenRCT2::Drawing; class ImageImporterTests : public testing::Test diff --git a/test/tests/IniWriterTest.cpp b/test/tests/IniWriterTest.cpp index 29a25f5a89..3bc732f2ed 100644 --- a/test/tests/IniWriterTest.cpp +++ b/test/tests/IniWriterTest.cpp @@ -16,6 +16,8 @@ #include #include +using namespace OpenRCT2; + class IniWriterTest : public testing::Test { }; diff --git a/test/tests/LanguagePackTest.cpp b/test/tests/LanguagePackTest.cpp index 7003e50359..4ed9d9153a 100644 --- a/test/tests/LanguagePackTest.cpp +++ b/test/tests/LanguagePackTest.cpp @@ -14,6 +14,8 @@ #include +using namespace OpenRCT2; + class LanguagePackTest : public testing::Test { protected: diff --git a/test/tests/Platform.cpp b/test/tests/Platform.cpp index dfead4fca4..2b3e1cc1d9 100644 --- a/test/tests/Platform.cpp +++ b/test/tests/Platform.cpp @@ -10,6 +10,8 @@ #include #include +using namespace OpenRCT2; + TEST(platform, sanitise_filename) { ASSERT_EQ("normal-filename.png", Platform::SanitiseFilename("normal-filename.png")); diff --git a/test/tests/StringTest.cpp b/test/tests/StringTest.cpp index a8a353fcd8..49e9bb74e6 100644 --- a/test/tests/StringTest.cpp +++ b/test/tests/StringTest.cpp @@ -17,6 +17,8 @@ #include #include +using namespace OpenRCT2; + using TCase = std::tuple; class StringTest : public testing::TestWithParam diff --git a/test/tests/TestData.cpp b/test/tests/TestData.cpp index c494a55a18..ff1dcd8310 100644 --- a/test/tests/TestData.cpp +++ b/test/tests/TestData.cpp @@ -20,7 +20,7 @@ namespace TestData std::string GetParkPath(std::string name) { - std::string path = Path::Combine(GetBasePath(), u8"parks", name); + std::string path = OpenRCT2::Path::Combine(GetBasePath(), u8"parks", name); return path; } } // namespace TestData diff --git a/test/tests/tests.cpp b/test/tests/tests.cpp index 19b4fdb716..4293d589fe 100644 --- a/test/tests/tests.cpp +++ b/test/tests/tests.cpp @@ -17,7 +17,7 @@ int main(int argc, char** argv) { // Abort on an assertions so the tests do not hang - Guard::SetAssertBehaviour(ASSERT_BEHAVIOUR::ABORT); + OpenRCT2::Guard::SetAssertBehaviour(ASSERT_BEHAVIOUR::ABORT); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS();