From 71ce725a2ab00906065f29673df6cc294b9b22c6 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek <1478678+Gymnasiast@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:26:10 +0200 Subject: [PATCH] Split off BannerElement and TrackElement (#22955) --- .../interface/ViewportInteraction.cpp | 2 + src/openrct2-ui/ride/Construction.cpp | 1 + src/openrct2-ui/windows/Banner.cpp | 1 + src/openrct2-ui/windows/Map.cpp | 1 + src/openrct2-ui/windows/Ride.cpp | 1 + src/openrct2-ui/windows/RideConstruction.cpp | 1 + src/openrct2-ui/windows/Scenery.cpp | 1 + src/openrct2-ui/windows/TileInspector.cpp | 2 + src/openrct2/EditorObjectSelectionSession.cpp | 1 + src/openrct2/actions/BannerPlaceAction.cpp | 1 + src/openrct2/actions/BannerRemoveAction.cpp | 1 + .../actions/BannerSetColourAction.cpp | 1 + src/openrct2/actions/BannerSetNameAction.cpp | 1 + src/openrct2/actions/BannerSetStyleAction.cpp | 1 + src/openrct2/actions/FootpathRemoveAction.cpp | 1 + src/openrct2/actions/LandSetHeightAction.cpp | 1 + src/openrct2/actions/MazePlaceTrackAction.cpp | 1 + src/openrct2/actions/MazeSetTrackAction.cpp | 1 + src/openrct2/actions/RideDemolishAction.cpp | 1 + src/openrct2/actions/TrackPlaceAction.cpp | 1 + src/openrct2/actions/TrackRemoveAction.cpp | 1 + .../actions/TrackSetBrakeSpeedAction.cpp | 1 + src/openrct2/actions/WallPlaceAction.cpp | 1 + src/openrct2/core/DataSerialiserTraits.h | 1 + src/openrct2/entity/Balloon.cpp | 1 + src/openrct2/entity/Guest.cpp | 1 + src/openrct2/entity/Peep.cpp | 1 + src/openrct2/entity/Staff.cpp | 1 + src/openrct2/libopenrct2.vcxproj | 16 +- .../paint/tile_element/Paint.Banner.cpp | 1 + .../paint/tile_element/Paint.Path.cpp | 1 + .../coaster/AirPoweredVerticalCoaster.cpp | 1 + .../paint/track/coaster/AlpineCoaster.cpp | 1 + .../paint/track/coaster/BobsleighCoaster.cpp | 1 + .../coaster/ClassicStandUpRollerCoaster.cpp | 1 + .../coaster/ClassicWoodenRollerCoaster.cpp | 1 + .../track/coaster/CompactInvertedCoaster.cpp | 1 + .../track/coaster/CorkscrewRollerCoaster.cpp | 1 + .../track/coaster/FlyingRollerCoaster.cpp | 1 + .../coaster/FlyingRollerCoasterInverted.cpp | 1 + .../track/coaster/HeartlineTwisterCoaster.cpp | 1 + .../paint/track/coaster/HybridCoaster.cpp | 1 + .../track/coaster/InvertedHairpinCoaster.cpp | 1 + .../track/coaster/InvertedImpulseCoaster.cpp | 1 + .../track/coaster/InvertedRollerCoaster.cpp | 1 + .../track/coaster/JuniorRollerCoaster.cpp | 1 + .../track/coaster/LatticeTriangleTrack.cpp | 1 + .../coaster/LayDownRollerCoasterInverted.cpp | 1 + .../coaster/LimLaunchedRollerCoaster.cpp | 1 + .../track/coaster/LoopingRollerCoaster.cpp | 1 + src/openrct2/paint/track/coaster/MineRide.cpp | 1 + .../paint/track/coaster/MineTrainCoaster.cpp | 1 + .../paint/track/coaster/MiniRollerCoaster.cpp | 1 + .../track/coaster/MiniSuspendedCoaster.cpp | 1 + .../coaster/MultiDimensionRollerCoaster.cpp | 1 + .../track/coaster/ReverseFreefallCoaster.cpp | 1 + .../track/coaster/ReverserRollerCoaster.cpp | 1 + .../coaster/SideFrictionRollerCoaster.cpp | 1 + .../track/coaster/SingleRailRollerCoaster.cpp | 1 + .../track/coaster/StandUpRollerCoaster.cpp | 1 + .../paint/track/coaster/Steeplechase.cpp | 1 + .../coaster/SuspendedSwingingCoaster.cpp | 1 + .../track/coaster/TwisterRollerCoaster.cpp | 1 + .../paint/track/coaster/VirginiaReel.cpp | 1 + .../paint/track/coaster/WildMouse.cpp | 1 + .../track/coaster/WoodenRollerCoaster.cpp | 1 + .../paint/track/coaster/WoodenWildMouse.cpp | 1 + .../paint/track/gentle/CrookedHouse.cpp | 1 + .../paint/track/gentle/GhostTrain.cpp | 1 + src/openrct2/paint/track/gentle/Maze.cpp | 1 + src/openrct2/paint/track/gentle/MiniGolf.cpp | 1 + .../paint/track/gentle/ObservationTower.cpp | 1 + src/openrct2/paint/track/shops/Facility.cpp | 1 + src/openrct2/paint/track/shops/Shop.cpp | 1 + .../paint/track/thrill/Enterprise.cpp | 1 + src/openrct2/paint/track/thrill/GoKarts.cpp | 1 + .../paint/track/thrill/LaunchedFreefall.cpp | 1 + src/openrct2/paint/track/thrill/RotoDrop.cpp | 1 + .../paint/track/transport/Chairlift.cpp | 1 + .../track/transport/MiniatureRailway.cpp | 1 + .../paint/track/water/DinghySlide.cpp | 1 + src/openrct2/park/ParkFile.cpp | 1 + src/openrct2/peep/GuestPathfinding.cpp | 2 + src/openrct2/rct1/S4Importer.cpp | 2 + src/openrct2/rct12/ScenarioPatcher.cpp | 1 + src/openrct2/rct2/S6Importer.cpp | 2 + src/openrct2/ride/CableLift.cpp | 1 + src/openrct2/ride/Ride.cpp | 1 + src/openrct2/ride/RideConstruction.cpp | 1 + src/openrct2/ride/RideRatings.cpp | 1 + src/openrct2/ride/Station.cpp | 1 + src/openrct2/ride/Track.cpp | 294 +---------------- src/openrct2/ride/Track.h | 21 -- src/openrct2/ride/TrackDesign.cpp | 1 + src/openrct2/ride/TrackDesignSave.cpp | 1 + src/openrct2/ride/TrackPaint.cpp | 1 + src/openrct2/ride/Vehicle.cpp | 1 + src/openrct2/scenario/Scenario.cpp | 1 + .../bindings/ride/ScTrackIterator.cpp | 1 + .../bindings/world/ScTileElement.cpp | 2 + src/openrct2/world/Banner.cpp | 53 +-- src/openrct2/world/ConstructionClearance.cpp | 1 + src/openrct2/world/Entrance.cpp | 1 + src/openrct2/world/Footpath.cpp | 2 + src/openrct2/world/Map.cpp | 2 + src/openrct2/world/MapAnimation.cpp | 1 + src/openrct2/world/TileElement.cpp | 2 + src/openrct2/world/TileElement.h | 138 -------- src/openrct2/world/TileInspector.cpp | 2 + .../world/tile_element/BannerElement.cpp | 57 ++++ .../world/tile_element/BannerElement.h | 44 +++ .../world/tile_element/TileElementBase.cpp | 2 + .../world/tile_element/TrackElement.cpp | 304 ++++++++++++++++++ .../world/tile_element/TrackElement.h | 145 +++++++++ .../world/tile_element/WallElement.cpp | 1 + test/tests/TileElements.cpp | 1 + test/tests/TileElementsView.cpp | 2 + 117 files changed, 683 insertions(+), 509 deletions(-) create mode 100644 src/openrct2/world/tile_element/BannerElement.cpp create mode 100644 src/openrct2/world/tile_element/BannerElement.h create mode 100644 src/openrct2/world/tile_element/TrackElement.cpp create mode 100644 src/openrct2/world/tile_element/TrackElement.h diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 34be65ac1f..4327d11ef9 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -52,7 +52,9 @@ #include #include #include +#include #include +#include #include using namespace OpenRCT2; diff --git a/src/openrct2-ui/ride/Construction.cpp b/src/openrct2-ui/ride/Construction.cpp index 3ce3ff129f..35d3417c4a 100644 --- a/src/openrct2-ui/ride/Construction.cpp +++ b/src/openrct2-ui/ride/Construction.cpp @@ -18,6 +18,7 @@ #include #include #include +#include using namespace OpenRCT2::TrackMetaData; diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 5d8cab9350..7a5d104a00 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -23,6 +23,7 @@ #include #include #include +#include namespace OpenRCT2::Ui::Windows { diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index c625ff92fb..28bb1d4d9b 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index fa46041d9c..a8d1b8363c 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 52a2159c26..70da1e91b7 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -50,6 +50,7 @@ #include #include #include +#include constexpr int8_t kDefaultSpeedIncrement = 2; constexpr int8_t kDefaultMinimumSpeed = 2; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 4b0ac2cb4a..663a85ddc6 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 3c09fe15c9..6e8735f370 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -41,8 +41,10 @@ #include #include #include +#include #include #include +#include #include namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 79b41c0ebd..f860e462fd 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -30,6 +30,7 @@ #include "windows/Intent.h" #include "world/Footpath.h" #include "world/Scenery.h" +#include "world/tile_element/BannerElement.h" #include "world/tile_element/EntranceElement.h" #include "world/tile_element/WallElement.h" diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 88efacd5fa..ead853ba0d 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -17,6 +17,7 @@ #include "../world/MapAnimation.h" #include "../world/Scenery.h" #include "../world/TileElementsView.h" +#include "../world/tile_element/BannerElement.h" #include "GameAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index ab82af5784..9c40d69152 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -17,6 +17,7 @@ #include "../world/MapAnimation.h" #include "../world/Scenery.h" #include "../world/TileElementsView.h" +#include "../world/tile_element/BannerElement.h" #include "GameAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index cbb562f1a3..e7e2625752 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -14,6 +14,7 @@ #include "../management/Finance.h" #include "../windows/Intent.h" #include "../world/Banner.h" +#include "../world/tile_element/BannerElement.h" #include "GameAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/BannerSetNameAction.cpp b/src/openrct2/actions/BannerSetNameAction.cpp index 6859eb183b..639a0ff446 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -17,6 +17,7 @@ #include "../ui/UiContext.h" #include "../windows/Intent.h" #include "../world/Banner.h" +#include "../world/tile_element/BannerElement.h" #include "GameAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 18225ca1d8..eaf2c9ca8d 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -15,6 +15,7 @@ #include "../util/Util.h" #include "../windows/Intent.h" #include "../world/Banner.h" +#include "../world/tile_element/BannerElement.h" #include "GameAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index 21b5b5ec9d..8297d31899 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -19,6 +19,7 @@ #include "../world/Footpath.h" #include "../world/Location.hpp" #include "../world/Park.h" +#include "../world/tile_element/BannerElement.h" #include "BannerRemoveAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index eb7bf19262..31ec643d7c 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -25,6 +25,7 @@ #include "../world/TileElementsView.h" #include "../world/Wall.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/TrackElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 5ae8c13497..32b4495696 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -16,6 +16,7 @@ #include "../ride/TrackData.h" #include "../world/ConstructionClearance.h" #include "../world/Wall.h" +#include "../world/tile_element/TrackElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index ffae52ea7e..4e70b682b4 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -24,6 +24,7 @@ #include "../world/Footpath.h" #include "../world/Park.h" #include "../world/Wall.h" +#include "../world/tile_element/TrackElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 11eab3d14a..9ae83fbee3 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -26,6 +26,7 @@ #include "../world/Banner.h" #include "../world/Park.h" #include "../world/TileElementsView.h" +#include "../world/tile_element/TrackElement.h" #include "MazeSetTrackAction.h" #include "TrackRemoveAction.h" diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index d8f4824825..0b24eab99d 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -24,6 +24,7 @@ #include "../world/Surface.h" #include "../world/Wall.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/TrackElement.h" #include "RideSetSettingAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 65ee27bf43..a2577cd454 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -19,6 +19,7 @@ #include "../util/Util.h" #include "../world/MapAnimation.h" #include "../world/Surface.h" +#include "../world/tile_element/TrackElement.h" #include "RideSetSettingAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp index 46eca92412..08c68b199c 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp @@ -11,6 +11,7 @@ #include "../Diagnostic.h" #include "../management/Finance.h" +#include "../world/tile_element/TrackElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 7f8d74eb0e..1eae718b4b 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -25,6 +25,7 @@ #include "../world/Surface.h" #include "../world/Wall.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index 05531e8ce8..e818e276db 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -16,6 +16,7 @@ #include "../object/Object.h" #include "../ride/RideColour.h" #include "../ride/TrackDesign.h" +#include "../world/Banner.h" #include "../world/Location.hpp" #include "../world/TileElement.h" #include "DataSerialiserTag.h" diff --git a/src/openrct2/entity/Balloon.cpp b/src/openrct2/entity/Balloon.cpp index b12cd067a0..3bc32aaade 100644 --- a/src/openrct2/entity/Balloon.cpp +++ b/src/openrct2/entity/Balloon.cpp @@ -17,6 +17,7 @@ #include "../profiling/Profiling.h" #include "../scenario/Scenario.h" #include "../util/Util.h" +#include "../world/tile_element/TrackElement.h" #include "EntityRegistry.h" template<> bool EntityBase::Is() const diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 35cd3e777f..202d60954d 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -61,6 +61,7 @@ #include "../world/Surface.h" #include "../world/TileElementsView.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" #include "Peep.h" #include "Staff.h" diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 5c9f354de6..8ead7e9184 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -57,6 +57,7 @@ #include "../world/Scenery.h" #include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/TrackElement.h" #include "PatrolArea.h" #include "Staff.h" diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index b06525ac80..58b78d76ca 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -45,6 +45,7 @@ #include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/TrackElement.h" #include "PatrolArea.h" #include "Peep.h" diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 2d729f224a..bcd41886a1 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -599,9 +599,6 @@ - - - @@ -624,6 +621,11 @@ + + + + + @@ -1086,8 +1088,6 @@ - - @@ -1106,6 +1106,10 @@ + + + + @@ -1116,4 +1120,4 @@ - \ No newline at end of file + diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index 79e987d9e8..8c23b68438 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -23,6 +23,7 @@ #include "../../world/Banner.h" #include "../../world/Scenery.h" #include "../../world/TileInspector.h" +#include "../../world/tile_element/BannerElement.h" #include "Paint.TileElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index c4f8635a68..3e4975facc 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -34,6 +34,7 @@ #include "../../world/Surface.h" #include "../../world/TileInspector.h" #include "../../world/tile_element/Slope.h" +#include "../../world/tile_element/TrackElement.h" #include "../Boundbox.h" #include "../Paint.SessionFlags.h" #include "../support/MetalSupports.h" diff --git a/src/openrct2/paint/track/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/paint/track/coaster/AirPoweredVerticalCoaster.cpp index b218474a0c..558cce737e 100644 --- a/src/openrct2/paint/track/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/paint/track/coaster/AirPoweredVerticalCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../support/WoodenSupports.hpp" diff --git a/src/openrct2/paint/track/coaster/AlpineCoaster.cpp b/src/openrct2/paint/track/coaster/AlpineCoaster.cpp index e2e21cae21..d0ffec2e31 100644 --- a/src/openrct2/paint/track/coaster/AlpineCoaster.cpp +++ b/src/openrct2/paint/track/coaster/AlpineCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Segment.h" diff --git a/src/openrct2/paint/track/coaster/BobsleighCoaster.cpp b/src/openrct2/paint/track/coaster/BobsleighCoaster.cpp index dae12fe76d..393a8f6175 100644 --- a/src/openrct2/paint/track/coaster/BobsleighCoaster.cpp +++ b/src/openrct2/paint/track/coaster/BobsleighCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp index 61c6c39f26..3686d97e24 100644 --- a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp @@ -10,6 +10,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../tile_element/Segment.h" #include "../../track/Segment.h" #include "../../track/Support.h" diff --git a/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp index 87e1c72ce4..1f851fb61e 100644 --- a/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ClassicWoodenRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../support/WoodenSupports.hpp" diff --git a/src/openrct2/paint/track/coaster/CompactInvertedCoaster.cpp b/src/openrct2/paint/track/coaster/CompactInvertedCoaster.cpp index 4d128d5843..6fafc02d0f 100644 --- a/src/openrct2/paint/track/coaster/CompactInvertedCoaster.cpp +++ b/src/openrct2/paint/track/coaster/CompactInvertedCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp b/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp index d358931e57..f61f868de0 100644 --- a/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/CorkscrewRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp b/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp index 5298d82e31..e3747ac6d0 100644 --- a/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/FlyingRollerCoasterInverted.cpp b/src/openrct2/paint/track/coaster/FlyingRollerCoasterInverted.cpp index 2bc4fb98f5..e5d8f682ae 100644 --- a/src/openrct2/paint/track/coaster/FlyingRollerCoasterInverted.cpp +++ b/src/openrct2/paint/track/coaster/FlyingRollerCoasterInverted.cpp @@ -10,6 +10,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../track/Segment.h" #include diff --git a/src/openrct2/paint/track/coaster/HeartlineTwisterCoaster.cpp b/src/openrct2/paint/track/coaster/HeartlineTwisterCoaster.cpp index 99f104b6c1..a4e9e85ea4 100644 --- a/src/openrct2/paint/track/coaster/HeartlineTwisterCoaster.cpp +++ b/src/openrct2/paint/track/coaster/HeartlineTwisterCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../support/WoodenSupports.hpp" diff --git a/src/openrct2/paint/track/coaster/HybridCoaster.cpp b/src/openrct2/paint/track/coaster/HybridCoaster.cpp index 66d3249e5e..114fd90af8 100644 --- a/src/openrct2/paint/track/coaster/HybridCoaster.cpp +++ b/src/openrct2/paint/track/coaster/HybridCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../tile_element/Segment.h" diff --git a/src/openrct2/paint/track/coaster/InvertedHairpinCoaster.cpp b/src/openrct2/paint/track/coaster/InvertedHairpinCoaster.cpp index 9598850d12..6a67654674 100644 --- a/src/openrct2/paint/track/coaster/InvertedHairpinCoaster.cpp +++ b/src/openrct2/paint/track/coaster/InvertedHairpinCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/InvertedImpulseCoaster.cpp b/src/openrct2/paint/track/coaster/InvertedImpulseCoaster.cpp index 3a1647fa0f..57f45d406d 100644 --- a/src/openrct2/paint/track/coaster/InvertedImpulseCoaster.cpp +++ b/src/openrct2/paint/track/coaster/InvertedImpulseCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/InvertedRollerCoaster.cpp b/src/openrct2/paint/track/coaster/InvertedRollerCoaster.cpp index b9fdbc695b..7a057271f3 100644 --- a/src/openrct2/paint/track/coaster/InvertedRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/InvertedRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp b/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp index 6b0003f652..71ef1bb951 100644 --- a/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp @@ -15,6 +15,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Segment.h" diff --git a/src/openrct2/paint/track/coaster/LatticeTriangleTrack.cpp b/src/openrct2/paint/track/coaster/LatticeTriangleTrack.cpp index e394c064d2..2e8ecaacc3 100644 --- a/src/openrct2/paint/track/coaster/LatticeTriangleTrack.cpp +++ b/src/openrct2/paint/track/coaster/LatticeTriangleTrack.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/LayDownRollerCoasterInverted.cpp b/src/openrct2/paint/track/coaster/LayDownRollerCoasterInverted.cpp index b904d0919c..ee5970e395 100644 --- a/src/openrct2/paint/track/coaster/LayDownRollerCoasterInverted.cpp +++ b/src/openrct2/paint/track/coaster/LayDownRollerCoasterInverted.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/LimLaunchedRollerCoaster.cpp b/src/openrct2/paint/track/coaster/LimLaunchedRollerCoaster.cpp index 392c7baf45..d911783da7 100644 --- a/src/openrct2/paint/track/coaster/LimLaunchedRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/LimLaunchedRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp b/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp index f827635a65..9751e23e59 100644 --- a/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/MineRide.cpp b/src/openrct2/paint/track/coaster/MineRide.cpp index c99a7bc413..6872c900d4 100644 --- a/src/openrct2/paint/track/coaster/MineRide.cpp +++ b/src/openrct2/paint/track/coaster/MineRide.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/MineTrainCoaster.cpp b/src/openrct2/paint/track/coaster/MineTrainCoaster.cpp index f3c82cadae..b930a5a498 100644 --- a/src/openrct2/paint/track/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MineTrainCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../support/WoodenSupports.hpp" diff --git a/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp b/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp index 975b10afab..d91f643fa2 100644 --- a/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/MiniSuspendedCoaster.cpp b/src/openrct2/paint/track/coaster/MiniSuspendedCoaster.cpp index 5a01d07542..53b61de720 100644 --- a/src/openrct2/paint/track/coaster/MiniSuspendedCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MiniSuspendedCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp index c453ff36ad..a18790e874 100644 --- a/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MultiDimensionRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/paint/track/coaster/ReverseFreefallCoaster.cpp index 2d39bddadd..d8270ff88b 100644 --- a/src/openrct2/paint/track/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ReverseFreefallCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../support/WoodenSupports.hpp" diff --git a/src/openrct2/paint/track/coaster/ReverserRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ReverserRollerCoaster.cpp index 256959a84d..596a4abe41 100644 --- a/src/openrct2/paint/track/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ReverserRollerCoaster.cpp @@ -15,6 +15,7 @@ #include "../../../ride/Vehicle.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../support/WoodenSupports.hpp" diff --git a/src/openrct2/paint/track/coaster/SideFrictionRollerCoaster.cpp b/src/openrct2/paint/track/coaster/SideFrictionRollerCoaster.cpp index dac5c98c5a..95c0b2c189 100644 --- a/src/openrct2/paint/track/coaster/SideFrictionRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/SideFrictionRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../support/WoodenSupports.hpp" diff --git a/src/openrct2/paint/track/coaster/SingleRailRollerCoaster.cpp b/src/openrct2/paint/track/coaster/SingleRailRollerCoaster.cpp index b26dce9901..59fecf84b4 100644 --- a/src/openrct2/paint/track/coaster/SingleRailRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/SingleRailRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Segment.h" diff --git a/src/openrct2/paint/track/coaster/StandUpRollerCoaster.cpp b/src/openrct2/paint/track/coaster/StandUpRollerCoaster.cpp index 968cfaad13..2d6a0d4c10 100644 --- a/src/openrct2/paint/track/coaster/StandUpRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/StandUpRollerCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/Steeplechase.cpp b/src/openrct2/paint/track/coaster/Steeplechase.cpp index 59e805b47d..5e726b1dc2 100644 --- a/src/openrct2/paint/track/coaster/Steeplechase.cpp +++ b/src/openrct2/paint/track/coaster/Steeplechase.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/SuspendedSwingingCoaster.cpp b/src/openrct2/paint/track/coaster/SuspendedSwingingCoaster.cpp index 81088d5f68..5e8461943c 100644 --- a/src/openrct2/paint/track/coaster/SuspendedSwingingCoaster.cpp +++ b/src/openrct2/paint/track/coaster/SuspendedSwingingCoaster.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/TwisterRollerCoaster.cpp b/src/openrct2/paint/track/coaster/TwisterRollerCoaster.cpp index 99e89353ff..de70dc8eab 100644 --- a/src/openrct2/paint/track/coaster/TwisterRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/TwisterRollerCoaster.cpp @@ -16,6 +16,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/VirginiaReel.cpp b/src/openrct2/paint/track/coaster/VirginiaReel.cpp index 6882cbd53d..165466c7fa 100644 --- a/src/openrct2/paint/track/coaster/VirginiaReel.cpp +++ b/src/openrct2/paint/track/coaster/VirginiaReel.cpp @@ -11,6 +11,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../ride/Vehicle.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../support/WoodenSupports.hpp" diff --git a/src/openrct2/paint/track/coaster/WildMouse.cpp b/src/openrct2/paint/track/coaster/WildMouse.cpp index 831345054f..3e627e3487 100644 --- a/src/openrct2/paint/track/coaster/WildMouse.cpp +++ b/src/openrct2/paint/track/coaster/WildMouse.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp b/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp index b985f7501b..c8be2c8805 100644 --- a/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp @@ -17,6 +17,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Boundbox.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/coaster/WoodenWildMouse.cpp b/src/openrct2/paint/track/coaster/WoodenWildMouse.cpp index 22e0efb390..e1b2ca732c 100644 --- a/src/openrct2/paint/track/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/paint/track/coaster/WoodenWildMouse.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.hpp" #include "../../tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/track/gentle/CrookedHouse.cpp b/src/openrct2/paint/track/gentle/CrookedHouse.cpp index ca612b1b07..70a8199132 100644 --- a/src/openrct2/paint/track/gentle/CrookedHouse.cpp +++ b/src/openrct2/paint/track/gentle/CrookedHouse.cpp @@ -14,6 +14,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../ride/Vehicle.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Boundbox.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/gentle/GhostTrain.cpp b/src/openrct2/paint/track/gentle/GhostTrain.cpp index 8a5c793209..5a85761ae2 100644 --- a/src/openrct2/paint/track/gentle/GhostTrain.cpp +++ b/src/openrct2/paint/track/gentle/GhostTrain.cpp @@ -12,6 +12,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/gentle/Maze.cpp b/src/openrct2/paint/track/gentle/Maze.cpp index 1707fb68ba..37b4d36311 100644 --- a/src/openrct2/paint/track/gentle/Maze.cpp +++ b/src/openrct2/paint/track/gentle/Maze.cpp @@ -15,6 +15,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../tile_element/Paint.Surface.h" diff --git a/src/openrct2/paint/track/gentle/MiniGolf.cpp b/src/openrct2/paint/track/gentle/MiniGolf.cpp index 76dbc5883f..d0efbd75c5 100644 --- a/src/openrct2/paint/track/gentle/MiniGolf.cpp +++ b/src/openrct2/paint/track/gentle/MiniGolf.cpp @@ -15,6 +15,7 @@ #include "../../../world/Map.h" #include "../../../world/Surface.h" #include "../../../world/tile_element/Slope.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.SessionFlags.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" diff --git a/src/openrct2/paint/track/gentle/ObservationTower.cpp b/src/openrct2/paint/track/gentle/ObservationTower.cpp index ad1828a109..9b5682f684 100644 --- a/src/openrct2/paint/track/gentle/ObservationTower.cpp +++ b/src/openrct2/paint/track/gentle/ObservationTower.cpp @@ -13,6 +13,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../ride/Vehicle.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../tile_element/Segment.h" diff --git a/src/openrct2/paint/track/shops/Facility.cpp b/src/openrct2/paint/track/shops/Facility.cpp index 936149757c..c2c990b1b9 100644 --- a/src/openrct2/paint/track/shops/Facility.cpp +++ b/src/openrct2/paint/track/shops/Facility.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Boundbox.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/shops/Shop.cpp b/src/openrct2/paint/track/shops/Shop.cpp index 16ff2d7484..306fb2e73d 100644 --- a/src/openrct2/paint/track/shops/Shop.cpp +++ b/src/openrct2/paint/track/shops/Shop.cpp @@ -14,6 +14,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Boundbox.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/thrill/Enterprise.cpp b/src/openrct2/paint/track/thrill/Enterprise.cpp index 830248374c..f389b66080 100644 --- a/src/openrct2/paint/track/thrill/Enterprise.cpp +++ b/src/openrct2/paint/track/thrill/Enterprise.cpp @@ -14,6 +14,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../ride/Vehicle.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Boundbox.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/thrill/GoKarts.cpp b/src/openrct2/paint/track/thrill/GoKarts.cpp index 80f074d6a0..4b01c2534a 100644 --- a/src/openrct2/paint/track/thrill/GoKarts.cpp +++ b/src/openrct2/paint/track/thrill/GoKarts.cpp @@ -12,6 +12,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../support/WoodenSupports.hpp" diff --git a/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp b/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp index 754fd26a9b..841fda7e08 100644 --- a/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp @@ -12,6 +12,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../ride/Vehicle.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../tile_element/Segment.h" diff --git a/src/openrct2/paint/track/thrill/RotoDrop.cpp b/src/openrct2/paint/track/thrill/RotoDrop.cpp index b999444da3..0ffc4e5b49 100644 --- a/src/openrct2/paint/track/thrill/RotoDrop.cpp +++ b/src/openrct2/paint/track/thrill/RotoDrop.cpp @@ -12,6 +12,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../ride/Vehicle.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../tile_element/Segment.h" diff --git a/src/openrct2/paint/track/transport/Chairlift.cpp b/src/openrct2/paint/track/transport/Chairlift.cpp index 5f96579844..a091e12492 100644 --- a/src/openrct2/paint/track/transport/Chairlift.cpp +++ b/src/openrct2/paint/track/transport/Chairlift.cpp @@ -13,6 +13,7 @@ #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/transport/MiniatureRailway.cpp b/src/openrct2/paint/track/transport/MiniatureRailway.cpp index 95906b099c..64318bc93f 100644 --- a/src/openrct2/paint/track/transport/MiniatureRailway.cpp +++ b/src/openrct2/paint/track/transport/MiniatureRailway.cpp @@ -13,6 +13,7 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" #include "../../tile_element/Segment.h" diff --git a/src/openrct2/paint/track/water/DinghySlide.cpp b/src/openrct2/paint/track/water/DinghySlide.cpp index 36d560078e..8ce42c5f08 100644 --- a/src/openrct2/paint/track/water/DinghySlide.cpp +++ b/src/openrct2/paint/track/water/DinghySlide.cpp @@ -10,6 +10,7 @@ #include "../../../interface/Viewport.h" #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" +#include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" #include "../../tile_element/Segment.h" diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 9b2e1980f3..9154b81107 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -56,6 +56,7 @@ #include "../world/Map.h" #include "../world/Park.h" #include "../world/Scenery.h" +#include "../world/tile_element/TrackElement.h" #include "Legacy.h" #include diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 5a66ee54d6..22f4a8f1b9 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -22,7 +22,9 @@ #include "../util/Util.h" #include "../world/Entrance.h" #include "../world/Footpath.h" +#include "../world/tile_element/BannerElement.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/TrackElement.h" #include #include diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 4135de6c70..1756e49080 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -72,7 +72,9 @@ #include "../world/Surface.h" #include "../world/TilePointerIndex.hpp" #include "../world/Wall.h" +#include "../world/tile_element/BannerElement.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" #include "RCT1.h" #include "Tables.h" diff --git a/src/openrct2/rct12/ScenarioPatcher.cpp b/src/openrct2/rct12/ScenarioPatcher.cpp index c5b184f9d5..b621b20806 100644 --- a/src/openrct2/rct12/ScenarioPatcher.cpp +++ b/src/openrct2/rct12/ScenarioPatcher.cpp @@ -29,6 +29,7 @@ #include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" #include "../world/tile_element/TileElementType.h" +#include "../world/tile_element/TrackElement.h" #ifdef DISABLE_NETWORK # include diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 301b5d5cc1..428d3161e3 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -77,7 +77,9 @@ #include "../world/Scenery.h" #include "../world/Surface.h" #include "../world/TilePointerIndex.hpp" +#include "../world/tile_element/BannerElement.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" #include diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index 9c2fdde27e..fe27561c85 100644 --- a/src/openrct2/ride/CableLift.cpp +++ b/src/openrct2/ride/CableLift.cpp @@ -13,6 +13,7 @@ #include "../entity/EntityList.h" #include "../rct12/RCT12.h" #include "../util/Util.h" +#include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" #include "Track.h" diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index d0dab6064d..112cd79325 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -63,6 +63,7 @@ #include "../world/Scenery.h" #include "../world/TileElementsView.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/TrackElement.h" #include "CableLift.h" #include "RideAudio.h" #include "RideConstruction.h" diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 2abe555480..62e96b586b 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -41,6 +41,7 @@ #include "../world/Scenery.h" #include "../world/TileElementsView.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" #include "Track.h" diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index aeab7e76ff..256281587e 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -20,6 +20,7 @@ #include "../world/Footpath.h" #include "../world/Map.h" #include "../world/Surface.h" +#include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" #include "Station.h" diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 01d785290d..2e487b7693 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -14,6 +14,7 @@ #include "../entity/Guest.h" #include "../scenario/Scenario.h" #include "../world/Location.hpp" +#include "../world/tile_element/TrackElement.h" #include "RideEntry.h" #include "Track.h" #include "Vehicle.h" diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index d3c2b6f7d5..68efe948b4 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -29,6 +29,7 @@ #include "../world/Park.h" #include "../world/Scenery.h" #include "../world/Surface.h" +#include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" #include "RideRatings.h" @@ -523,52 +524,6 @@ void TrackGetFront(const CoordsXYE& input, CoordsXYE* output) *output = lastTrack; } -bool TrackElement::HasChain() const -{ - return Flags2 & TRACK_ELEMENT_FLAGS2_CHAIN_LIFT; -} - -void TrackElement::SetHasChain(bool on) -{ - if (on) - { - Flags2 |= TRACK_ELEMENT_FLAGS2_CHAIN_LIFT; - } - else - { - Flags2 &= ~TRACK_ELEMENT_FLAGS2_CHAIN_LIFT; - } -} - -/** - * Checks if a track element is recognised as the beginning of a block. - * A beginning of a block can be the end of a station, the end of a lift hill, - * or a block brake. - */ -bool TrackElement::IsBlockStart() const -{ - switch (GetTrackType()) - { - case TrackElemType::EndStation: - case TrackElemType::CableLiftHill: - case TrackElemType::BlockBrakes: - case TrackElemType::DiagBlockBrakes: - return true; - case TrackElemType::Up25ToFlat: - case TrackElemType::Up60ToFlat: - case TrackElemType::DiagUp25ToFlat: - case TrackElemType::DiagUp60ToFlat: - if (HasChain()) - { - return true; - } - break; - default: - break; - } - return false; -} - TrackRoll TrackGetActualBank(TileElement* tileElement, TrackRoll bank) { auto ride = GetRide(tileElement->AsTrack()->GetRideIndex()); @@ -612,11 +567,6 @@ TrackRoll TrackGetActualBank3(bool useInvertedSprites, TileElement* tileElement) return TrackGetActualBank2(ride->type, isInverted, bankStart); } -bool TrackElement::IsStation() const -{ - return TrackTypeIsStation(GetTrackType()); -} - bool TrackTypeIsStation(OpenRCT2::TrackElemType trackType) { switch (trackType) @@ -770,245 +720,3 @@ std::optional GetTrackSegmentOrigin(const CoordsXYE& posEl) return CoordsXYZD(coords, direction); } - -uint8_t TrackElement::GetSeatRotation() const -{ - const auto* ride = GetRide(GetRideIndex()); - if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasLandscapeDoors)) - return DEFAULT_SEAT_ROTATION; - - return URide.ColourScheme >> 4; -} - -void TrackElement::SetSeatRotation(uint8_t newSeatRotation) -{ - URide.ColourScheme &= ~TRACK_ELEMENT_COLOUR_SEAT_ROTATION_MASK; - URide.ColourScheme |= (newSeatRotation << 4); -} - -bool TrackElement::IsTakingPhoto() const -{ - return URide.OnridePhotoBits != 0; -} - -void TrackElement::SetPhotoTimeout() -{ - URide.OnridePhotoBits = 3; -} - -void TrackElement::SetPhotoTimeout(uint8_t value) -{ - URide.OnridePhotoBits = value; -} - -uint8_t TrackElement::GetPhotoTimeout() const -{ - return URide.OnridePhotoBits; -} - -void TrackElement::DecrementPhotoTimeout() -{ - URide.OnridePhotoBits = std::max(0, URide.OnridePhotoBits - 1); -} - -uint16_t TrackElement::GetMazeEntry() const -{ - return UMaze.MazeEntry; -} - -void TrackElement::SetMazeEntry(uint16_t newMazeEntry) -{ - UMaze.MazeEntry = newMazeEntry; -} - -void TrackElement::MazeEntryAdd(uint16_t addVal) -{ - UMaze.MazeEntry |= addVal; -} - -void TrackElement::MazeEntrySubtract(uint16_t subVal) -{ - UMaze.MazeEntry &= ~subVal; -} - -OpenRCT2::TrackElemType TrackElement::GetTrackType() const -{ - return TrackType; -} - -void TrackElement::SetTrackType(OpenRCT2::TrackElemType newType) -{ - TrackType = newType; -} - -ride_type_t TrackElement::GetRideType() const -{ - return RideType; -} - -void TrackElement::SetRideType(const ride_type_t rideType) -{ - RideType = rideType; -} - -uint8_t TrackElement::GetSequenceIndex() const -{ - return URide.Sequence; -} - -void TrackElement::SetSequenceIndex(uint8_t newSequenceIndex) -{ - URide.Sequence = newSequenceIndex; -} - -StationIndex TrackElement::GetStationIndex() const -{ - return URide.stationIndex; -} - -void TrackElement::SetStationIndex(StationIndex newStationIndex) -{ - URide.stationIndex = newStationIndex; -} - -uint8_t TrackElement::GetDoorAState() const -{ - return (URide.ColourScheme & TRACK_ELEMENT_COLOUR_DOOR_A_MASK) >> 2; -} - -uint8_t TrackElement::GetDoorBState() const -{ - return (URide.ColourScheme & TRACK_ELEMENT_COLOUR_DOOR_B_MASK) >> 5; -} - -void TrackElement::SetDoorAState(uint8_t newState) -{ - URide.ColourScheme &= ~TRACK_ELEMENT_COLOUR_DOOR_A_MASK; - URide.ColourScheme |= ((newState << 2) & TRACK_ELEMENT_COLOUR_DOOR_A_MASK); -} - -void TrackElement::SetDoorBState(uint8_t newState) -{ - URide.ColourScheme &= ~TRACK_ELEMENT_COLOUR_DOOR_B_MASK; - URide.ColourScheme |= ((newState << 5) & TRACK_ELEMENT_COLOUR_DOOR_B_MASK); -} - -RideId TrackElement::GetRideIndex() const -{ - return RideIndex; -} - -void TrackElement::SetRideIndex(RideId newRideIndex) -{ - RideIndex = newRideIndex; -} - -uint8_t TrackElement::GetColourScheme() const -{ - return URide.ColourScheme & TRACK_ELEMENT_COLOUR_SCHEME_MASK; -} - -void TrackElement::SetColourScheme(RideColourScheme newColourScheme) -{ - URide.ColourScheme &= ~TRACK_ELEMENT_COLOUR_SCHEME_MASK; - URide.ColourScheme |= (EnumValue(newColourScheme) & TRACK_ELEMENT_COLOUR_SCHEME_MASK); -} - -bool TrackElement::HasCableLift() const -{ - return Flags2 & TRACK_ELEMENT_FLAGS2_CABLE_LIFT; -} - -void TrackElement::SetHasCableLift(bool on) -{ - Flags2 &= ~TRACK_ELEMENT_FLAGS2_CABLE_LIFT; - if (on) - Flags2 |= TRACK_ELEMENT_FLAGS2_CABLE_LIFT; -} - -bool TrackElement::IsInverted() const -{ - return Flags2 & TRACK_ELEMENT_FLAGS2_INVERTED; -} - -void TrackElement::SetInverted(bool inverted) -{ - if (inverted) - { - Flags2 |= TRACK_ELEMENT_FLAGS2_INVERTED; - } - else - { - Flags2 &= ~TRACK_ELEMENT_FLAGS2_INVERTED; - } -} - -bool TrackElement::IsBrakeClosed() const -{ - return (Flags2 & TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED) != 0; -} - -void TrackElement::SetBrakeClosed(bool isClosed) -{ - if (isClosed) - { - Flags2 |= TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED; - } - else - { - Flags2 &= ~TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED; - } -} - -bool TrackElement::IsIndestructible() const -{ - return (Flags2 & TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE) != 0 && !GetGameState().Cheats.MakeAllDestructible; -} - -void TrackElement::SetIsIndestructible(bool isIndestructible) -{ - if (isIndestructible) - { - Flags2 |= TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE; - } - else - { - Flags2 &= ~TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE; - } -} - -uint8_t TrackElement::GetBrakeBoosterSpeed() const -{ - return URide.BrakeBoosterSpeed << 1; -} - -void TrackElement::SetBrakeBoosterSpeed(uint8_t speed) -{ - URide.BrakeBoosterSpeed = (speed >> 1); -} - -bool TrackElement::HasGreenLight() const -{ - return (Flags2 & TRACK_ELEMENT_FLAGS2_HAS_GREEN_LIGHT) != 0; -} - -void TrackElement::SetHasGreenLight(bool on) -{ - Flags2 &= ~TRACK_ELEMENT_FLAGS2_HAS_GREEN_LIGHT; - if (on) - { - Flags2 |= TRACK_ELEMENT_FLAGS2_HAS_GREEN_LIGHT; - } -} - -bool TrackElement::IsHighlighted() const -{ - return (Flags2 & TRACK_ELEMENT_FLAGS2_HIGHLIGHT); -} - -void TrackElement::SetHighlight(bool on) -{ - Flags2 &= ~TRACK_ELEMENT_FLAGS2_HIGHLIGHT; - if (on) - Flags2 |= TRACK_ELEMENT_FLAGS2_HIGHLIGHT; -} diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index e6f47cefe0..627a5b24c8 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -201,27 +201,6 @@ enum RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL = (1 << 2), }; -enum -{ - TRACK_ELEMENT_FLAGS2_CHAIN_LIFT = 1 << 0, - TRACK_ELEMENT_FLAGS2_INVERTED = 1 << 1, - // Used for giga coaster - TRACK_ELEMENT_FLAGS2_CABLE_LIFT = 1 << 2, - TRACK_ELEMENT_FLAGS2_HIGHLIGHT = 1 << 3, - TRACK_ELEMENT_FLAGS2_HAS_GREEN_LIGHT = 1 << 4, - TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED = 1 << 5, - TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE = 1 << 6, -}; - -enum -{ - TRACK_ELEMENT_COLOUR_SCHEME_MASK = 0b00000011, - // Not colour related, but shares the field. - TRACK_ELEMENT_COLOUR_DOOR_A_MASK = 0b00011100, - TRACK_ELEMENT_COLOUR_DOOR_B_MASK = 0b11100000, - TRACK_ELEMENT_COLOUR_SEAT_ROTATION_MASK = 0b11110000, -}; - constexpr int8_t kMaxStationPlatformLength = 32; constexpr uint16_t const MAX_TRACK_HEIGHT = 254 * kCoordsZStep; constexpr uint8_t const DEFAULT_SEAT_ROTATION = 4; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 6dda14b77e..3de439adc9 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -59,6 +59,7 @@ #include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" #include "Track.h" diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index 2ba0111554..367183ed8c 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -26,6 +26,7 @@ #include "../world/Footpath.h" #include "../world/Scenery.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" #include "RideData.h" #include "Station.h" diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 9a0ed97947..587b6ade6c 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -29,6 +29,7 @@ #include "../scenario/Scenario.h" #include "../sprites.h" #include "../world/Map.h" +#include "../world/tile_element/TrackElement.h" #include "RideData.h" #include "Station.h" #include "TrackData.h" diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 0deb3701bb..5a59047a95 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -47,6 +47,7 @@ #include "../world/Park.h" #include "../world/Scenery.h" #include "../world/Surface.h" +#include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" #include "CableLift.h" #include "Ride.h" diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index f10562b086..9820fc9e80 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -54,6 +54,7 @@ #include "../world/Map.h" #include "../world/Park.h" #include "../world/Scenery.h" +#include "../world/tile_element/TrackElement.h" #include "ScenarioRepository.h" #include "ScenarioSources.h" diff --git a/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp b/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp index fe984a3c1d..a54e151b83 100644 --- a/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp +++ b/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp @@ -14,6 +14,7 @@ # include "../../../Context.h" # include "../../../ride/Ride.h" # include "../../../ride/TrackData.h" +# include "../../../world/tile_element/TrackElement.h" # include "../../ScriptEngine.h" # include "ScTrackSegment.h" diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index bb6e0dbf8b..1760f3f52f 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -22,7 +22,9 @@ # include "../../../world/Footpath.h" # include "../../../world/Scenery.h" # include "../../../world/Surface.h" +# include "../../../world/tile_element/BannerElement.h" # include "../../../world/tile_element/EntranceElement.h" +# include "../../../world/tile_element/TrackElement.h" # include "../../../world/tile_element/WallElement.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index dc1e6dec07..6145a408c3 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -32,6 +32,8 @@ #include "Park.h" #include "Scenery.h" #include "TileElementsView.h" +#include "tile_element/BannerElement.h" +#include "tile_element/TrackElement.h" #include "tile_element/WallElement.h" #include @@ -369,57 +371,6 @@ void BannerApplyFixes() BannerDeallocateUnlinked(); } -Banner* BannerElement::GetBanner() const -{ - return ::GetBanner(GetIndex()); -} - -const BannerSceneryEntry* BannerElement::GetEntry() const -{ - auto banner = GetBanner(); - if (banner != nullptr) - { - return OpenRCT2::ObjectManager::GetObjectEntry(banner->type); - } - return nullptr; -} - -BannerIndex BannerElement::GetIndex() const -{ - return index; -} - -void BannerElement::SetIndex(BannerIndex newIndex) -{ - index = newIndex; -} - -uint8_t BannerElement::GetPosition() const -{ - return position; -} - -void BannerElement::SetPosition(uint8_t newPosition) -{ - position = newPosition; -} - -uint8_t BannerElement::GetAllowedEdges() const -{ - return AllowedEdges & 0b00001111; -} - -void BannerElement::SetAllowedEdges(uint8_t newEdges) -{ - AllowedEdges &= ~0b00001111; - AllowedEdges |= (newEdges & 0b00001111); -} - -void BannerElement::ResetAllowedEdges() -{ - AllowedEdges |= 0b00001111; -} - void UnlinkAllRideBanners() { auto& gameState = GetGameState(); diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 428deec5cf..76bc023792 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -24,6 +24,7 @@ #include "Surface.h" #include "tile_element/EntranceElement.h" #include "tile_element/Slope.h" +#include "tile_element/TrackElement.h" #include "tile_element/WallElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index fbcdb7d669..20da58468a 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -31,6 +31,7 @@ #include "MapAnimation.h" #include "Park.h" #include "tile_element/EntranceElement.h" +#include "tile_element/TrackElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 84be49f337..b97574c451 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -38,8 +38,10 @@ #include "MapAnimation.h" #include "Surface.h" #include "TileElement.h" +#include "tile_element/BannerElement.h" #include "tile_element/EntranceElement.h" #include "tile_element/Slope.h" +#include "tile_element/TrackElement.h" #include #include diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 7510ec1fef..209c025d32 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -57,8 +57,10 @@ #include "Surface.h" #include "TileElementsView.h" #include "TileInspector.h" +#include "tile_element/BannerElement.h" #include "tile_element/EntranceElement.h" #include "tile_element/Slope.h" +#include "tile_element/TrackElement.h" #include #include diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index e3741c38c5..a5762ac0b4 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -29,6 +29,7 @@ #include "Map.h" #include "Scenery.h" #include "tile_element/EntranceElement.h" +#include "tile_element/TrackElement.h" #include "tile_element/WallElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index c98f5b35ed..c5c98518de 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -18,8 +18,10 @@ #include "Banner.h" #include "Location.hpp" #include "Scenery.h" +#include "tile_element/BannerElement.h" #include "tile_element/EntranceElement.h" #include "tile_element/Slope.h" +#include "tile_element/TrackElement.h" #include "tile_element/WallElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 48bec6028f..ea7c779642 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -12,7 +12,6 @@ #include "../Identifiers.h" #include "../ride/RideTypes.h" #include "../ride/Station.h" -#include "Banner.h" #include "Footpath.h" #include "tile_element/TileElementType.h" @@ -22,7 +21,6 @@ struct LargeSceneryEntry; struct SmallSceneryEntry; struct WallSceneryEntry; struct PathAdditionEntry; -struct BannerSceneryEntry; struct FootpathEntry; class LargeSceneryObject; class TerrainSurfaceObject; @@ -283,107 +281,6 @@ public: }; static_assert(sizeof(PathElement) == 16); -struct TrackElement : TileElementBase -{ - static constexpr TileElementType ElementType = TileElementType::Track; - -private: - OpenRCT2::TrackElemType TrackType; - union - { - struct - { - uint8_t Sequence; - uint8_t ColourScheme; - union - { - // - Bits 3 and 4 are never set - // - Bits 1 and 2 are set when a vehicle triggers the on-ride photo and act like a countdown from 3. - // - If any of the bits 1-4 are set, the game counts it as a photo being taken. - uint8_t OnridePhotoBits; - // Contains the brake/booster speed, divided by 2. - uint8_t BrakeBoosterSpeed; - }; - StationIndex stationIndex; - } URide; - struct - { - uint16_t MazeEntry; // 6 - } UMaze; - }; - uint8_t Flags2; - RideId RideIndex; - ride_type_t RideType; - -public: - OpenRCT2::TrackElemType GetTrackType() const; - void SetTrackType(OpenRCT2::TrackElemType newEntryIndex); - - ride_type_t GetRideType() const; - void SetRideType(const ride_type_t rideType); - - uint8_t GetSequenceIndex() const; - void SetSequenceIndex(uint8_t newSequenceIndex); - - RideId GetRideIndex() const; - void SetRideIndex(RideId newRideIndex); - - uint8_t GetColourScheme() const; - void SetColourScheme(RideColourScheme newColourScheme); - - StationIndex GetStationIndex() const; - void SetStationIndex(StationIndex newStationIndex); - - bool HasChain() const; - void SetHasChain(bool on); - - bool HasCableLift() const; - void SetHasCableLift(bool on); - - bool IsInverted() const; - void SetInverted(bool inverted); - - bool IsBrakeClosed() const; - void SetBrakeClosed(bool isClosed); - - bool IsIndestructible() const; - void SetIsIndestructible(bool isIndestructible); - - uint8_t GetBrakeBoosterSpeed() const; - void SetBrakeBoosterSpeed(uint8_t speed); - - bool HasGreenLight() const; - void SetHasGreenLight(bool on); - - uint8_t GetSeatRotation() const; - void SetSeatRotation(uint8_t newSeatRotation); - - uint16_t GetMazeEntry() const; - void SetMazeEntry(uint16_t newMazeEntry); - void MazeEntryAdd(uint16_t addVal); - void MazeEntrySubtract(uint16_t subVal); - - bool IsTakingPhoto() const; - void SetPhotoTimeout(); - void SetPhotoTimeout(uint8_t newValue); - void DecrementPhotoTimeout(); - uint8_t GetPhotoTimeout() const; - - bool IsHighlighted() const; - void SetHighlight(bool on); - - // Used by ghost train, RCT1 feature, will be reintroduced at some point. - // (See https://github.com/OpenRCT2/OpenRCT2/issues/7059) - uint8_t GetDoorAState() const; - uint8_t GetDoorBState() const; - void SetDoorAState(uint8_t newState); - void SetDoorBState(uint8_t newState); - - bool IsStation() const; - bool IsBlockStart() const; -}; -static_assert(sizeof(TrackElement) == 16); - struct SmallSceneryElement : TileElementBase { static constexpr TileElementType ElementType = TileElementType::SmallScenery; @@ -459,34 +356,6 @@ public: }; static_assert(sizeof(LargeSceneryElement) == 16); -struct BannerElement : TileElementBase -{ - static constexpr TileElementType ElementType = TileElementType::Banner; - -private: - BannerIndex index; // 5 - uint8_t position; // 7 - uint8_t AllowedEdges; // 8 -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" - uint8_t Pad09[7]; -#pragma clang diagnostic pop -public: - Banner* GetBanner() const; - const BannerSceneryEntry* GetEntry() const; - - BannerIndex GetIndex() const; - void SetIndex(BannerIndex newIndex); - - uint8_t GetPosition() const; - void SetPosition(uint8_t newPosition); - - uint8_t GetAllowedEdges() const; - void SetAllowedEdges(uint8_t newEdges); - void ResetAllowedEdges(); -}; -static_assert(sizeof(BannerElement) == 16); - #pragma pack(pop) enum @@ -526,11 +395,4 @@ constexpr uint8_t kTileElementTypeMask = 0b00111100; constexpr uint8_t kTileElementDirectionMask = 0b00000011; constexpr uint8_t kTileElementOccupiedQuadrantsMask = 0b00001111; -enum -{ - LANDSCAPE_DOOR_CLOSED = 0, - LANDSCAPE_DOOR_HALF_OPEN = 2, - LANDSCAPE_DOOR_OPEN = 3, -}; - bool TileElementIsUnderground(TileElement* tileElement); diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index cf7445d784..996461a6b4 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -25,8 +25,10 @@ #include "Park.h" #include "Scenery.h" #include "Surface.h" +#include "tile_element/BannerElement.h" #include "tile_element/EntranceElement.h" #include "tile_element/Slope.h" +#include "tile_element/TrackElement.h" #include "tile_element/WallElement.h" #include diff --git a/src/openrct2/world/tile_element/BannerElement.cpp b/src/openrct2/world/tile_element/BannerElement.cpp new file mode 100644 index 0000000000..5f7bfbaea4 --- /dev/null +++ b/src/openrct2/world/tile_element/BannerElement.cpp @@ -0,0 +1,57 @@ +#include "BannerElement.h" + +#include "../../object/BannerSceneryEntry.h" +#include "../../object/ObjectEntryManager.h" +#include "../../object/ObjectManager.h" +#include "../Banner.h" + +Banner* BannerElement::GetBanner() const +{ + return ::GetBanner(GetIndex()); +} + +const BannerSceneryEntry* BannerElement::GetEntry() const +{ + auto banner = GetBanner(); + if (banner != nullptr) + { + return OpenRCT2::ObjectManager::GetObjectEntry(banner->type); + } + return nullptr; +} + +BannerIndex BannerElement::GetIndex() const +{ + return index; +} + +void BannerElement::SetIndex(BannerIndex newIndex) +{ + index = newIndex; +} + +uint8_t BannerElement::GetPosition() const +{ + return position; +} + +void BannerElement::SetPosition(uint8_t newPosition) +{ + position = newPosition; +} + +uint8_t BannerElement::GetAllowedEdges() const +{ + return AllowedEdges & 0b00001111; +} + +void BannerElement::SetAllowedEdges(uint8_t newEdges) +{ + AllowedEdges &= ~0b00001111; + AllowedEdges |= (newEdges & 0b00001111); +} + +void BannerElement::ResetAllowedEdges() +{ + AllowedEdges |= 0b00001111; +} diff --git a/src/openrct2/world/tile_element/BannerElement.h b/src/openrct2/world/tile_element/BannerElement.h new file mode 100644 index 0000000000..a0bfe2d01b --- /dev/null +++ b/src/openrct2/world/tile_element/BannerElement.h @@ -0,0 +1,44 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#pragma once + +#include "../TileElement.h" + +struct BannerSceneryEntry; + +#pragma pack(push, 1) +struct BannerElement : TileElementBase +{ + static constexpr TileElementType ElementType = TileElementType::Banner; + +private: + BannerIndex index; // 5 + uint8_t position; // 7 + uint8_t AllowedEdges; // 8 +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-private-field" + uint8_t Pad09[7]; +#pragma clang diagnostic pop +public: + Banner* GetBanner() const; + const BannerSceneryEntry* GetEntry() const; + + BannerIndex GetIndex() const; + void SetIndex(BannerIndex newIndex); + + uint8_t GetPosition() const; + void SetPosition(uint8_t newPosition); + + uint8_t GetAllowedEdges() const; + void SetAllowedEdges(uint8_t newEdges); + void ResetAllowedEdges(); +}; +static_assert(sizeof(BannerElement) == kTileElementSize); +#pragma pack(pop) diff --git a/src/openrct2/world/tile_element/TileElementBase.cpp b/src/openrct2/world/tile_element/TileElementBase.cpp index a8af4cacd5..9e8a1215cb 100644 --- a/src/openrct2/world/tile_element/TileElementBase.cpp +++ b/src/openrct2/world/tile_element/TileElementBase.cpp @@ -9,7 +9,9 @@ #include "../Map.h" #include "../TileElement.h" +#include "BannerElement.h" #include "EntranceElement.h" +#include "TrackElement.h" #include "WallElement.h" TileElementType TileElementBase::GetType() const diff --git a/src/openrct2/world/tile_element/TrackElement.cpp b/src/openrct2/world/tile_element/TrackElement.cpp new file mode 100644 index 0000000000..0e96088da3 --- /dev/null +++ b/src/openrct2/world/tile_element/TrackElement.cpp @@ -0,0 +1,304 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#include "TrackElement.h" + +#include "../../GameState.h" +#include "../../ride/RideData.h" +#include "../../ride/Track.h" + +using namespace OpenRCT2; + +bool TrackElement::HasChain() const +{ + return Flags2 & TRACK_ELEMENT_FLAGS2_CHAIN_LIFT; +} + +void TrackElement::SetHasChain(bool on) +{ + if (on) + { + Flags2 |= TRACK_ELEMENT_FLAGS2_CHAIN_LIFT; + } + else + { + Flags2 &= ~TRACK_ELEMENT_FLAGS2_CHAIN_LIFT; + } +} + +/** + * Checks if a track element is recognised as the beginning of a block. + * A beginning of a block can be the end of a station, the end of a lift hill, + * or a block brake. + */ +bool TrackElement::IsBlockStart() const +{ + switch (GetTrackType()) + { + case TrackElemType::EndStation: + case TrackElemType::CableLiftHill: + case TrackElemType::BlockBrakes: + case TrackElemType::DiagBlockBrakes: + return true; + case TrackElemType::Up25ToFlat: + case TrackElemType::Up60ToFlat: + case TrackElemType::DiagUp25ToFlat: + case TrackElemType::DiagUp60ToFlat: + return HasChain(); + default: + return false; + } +} + +bool TrackElement::IsStation() const +{ + return TrackTypeIsStation(GetTrackType()); +} + +uint8_t TrackElement::GetSeatRotation() const +{ + const auto* ride = GetRide(GetRideIndex()); + if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RtdFlag::hasLandscapeDoors)) + return DEFAULT_SEAT_ROTATION; + + return URide.ColourScheme >> 4; +} + +void TrackElement::SetSeatRotation(uint8_t newSeatRotation) +{ + URide.ColourScheme &= ~TRACK_ELEMENT_COLOUR_SEAT_ROTATION_MASK; + URide.ColourScheme |= (newSeatRotation << 4); +} + +bool TrackElement::IsTakingPhoto() const +{ + return URide.OnridePhotoBits != 0; +} + +void TrackElement::SetPhotoTimeout() +{ + URide.OnridePhotoBits = 3; +} + +void TrackElement::SetPhotoTimeout(uint8_t value) +{ + URide.OnridePhotoBits = value; +} + +uint8_t TrackElement::GetPhotoTimeout() const +{ + return URide.OnridePhotoBits; +} + +void TrackElement::DecrementPhotoTimeout() +{ + URide.OnridePhotoBits = std::max(0, URide.OnridePhotoBits - 1); +} + +uint16_t TrackElement::GetMazeEntry() const +{ + return UMaze.MazeEntry; +} + +void TrackElement::SetMazeEntry(uint16_t newMazeEntry) +{ + UMaze.MazeEntry = newMazeEntry; +} + +void TrackElement::MazeEntryAdd(uint16_t addVal) +{ + UMaze.MazeEntry |= addVal; +} + +void TrackElement::MazeEntrySubtract(uint16_t subVal) +{ + UMaze.MazeEntry &= ~subVal; +} + +OpenRCT2::TrackElemType TrackElement::GetTrackType() const +{ + return TrackType; +} + +void TrackElement::SetTrackType(OpenRCT2::TrackElemType newType) +{ + TrackType = newType; +} + +ride_type_t TrackElement::GetRideType() const +{ + return RideType; +} + +void TrackElement::SetRideType(const ride_type_t rideType) +{ + RideType = rideType; +} + +uint8_t TrackElement::GetSequenceIndex() const +{ + return URide.Sequence; +} + +void TrackElement::SetSequenceIndex(uint8_t newSequenceIndex) +{ + URide.Sequence = newSequenceIndex; +} + +StationIndex TrackElement::GetStationIndex() const +{ + return URide.stationIndex; +} + +void TrackElement::SetStationIndex(StationIndex newStationIndex) +{ + URide.stationIndex = newStationIndex; +} + +uint8_t TrackElement::GetDoorAState() const +{ + return (URide.ColourScheme & TRACK_ELEMENT_COLOUR_DOOR_A_MASK) >> 2; +} + +uint8_t TrackElement::GetDoorBState() const +{ + return (URide.ColourScheme & TRACK_ELEMENT_COLOUR_DOOR_B_MASK) >> 5; +} + +void TrackElement::SetDoorAState(uint8_t newState) +{ + URide.ColourScheme &= ~TRACK_ELEMENT_COLOUR_DOOR_A_MASK; + URide.ColourScheme |= ((newState << 2) & TRACK_ELEMENT_COLOUR_DOOR_A_MASK); +} + +void TrackElement::SetDoorBState(uint8_t newState) +{ + URide.ColourScheme &= ~TRACK_ELEMENT_COLOUR_DOOR_B_MASK; + URide.ColourScheme |= ((newState << 5) & TRACK_ELEMENT_COLOUR_DOOR_B_MASK); +} + +RideId TrackElement::GetRideIndex() const +{ + return RideIndex; +} + +void TrackElement::SetRideIndex(RideId newRideIndex) +{ + RideIndex = newRideIndex; +} + +uint8_t TrackElement::GetColourScheme() const +{ + return URide.ColourScheme & TRACK_ELEMENT_COLOUR_SCHEME_MASK; +} + +void TrackElement::SetColourScheme(RideColourScheme newColourScheme) +{ + URide.ColourScheme &= ~TRACK_ELEMENT_COLOUR_SCHEME_MASK; + URide.ColourScheme |= (EnumValue(newColourScheme) & TRACK_ELEMENT_COLOUR_SCHEME_MASK); +} + +bool TrackElement::HasCableLift() const +{ + return Flags2 & TRACK_ELEMENT_FLAGS2_CABLE_LIFT; +} + +void TrackElement::SetHasCableLift(bool on) +{ + Flags2 &= ~TRACK_ELEMENT_FLAGS2_CABLE_LIFT; + if (on) + Flags2 |= TRACK_ELEMENT_FLAGS2_CABLE_LIFT; +} + +bool TrackElement::IsInverted() const +{ + return Flags2 & TRACK_ELEMENT_FLAGS2_INVERTED; +} + +void TrackElement::SetInverted(bool inverted) +{ + if (inverted) + { + Flags2 |= TRACK_ELEMENT_FLAGS2_INVERTED; + } + else + { + Flags2 &= ~TRACK_ELEMENT_FLAGS2_INVERTED; + } +} + +bool TrackElement::IsBrakeClosed() const +{ + return (Flags2 & TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED) != 0; +} + +void TrackElement::SetBrakeClosed(bool isClosed) +{ + if (isClosed) + { + Flags2 |= TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED; + } + else + { + Flags2 &= ~TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED; + } +} + +bool TrackElement::IsIndestructible() const +{ + return (Flags2 & TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE) != 0 && !GetGameState().Cheats.MakeAllDestructible; +} + +void TrackElement::SetIsIndestructible(bool isIndestructible) +{ + if (isIndestructible) + { + Flags2 |= TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE; + } + else + { + Flags2 &= ~TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE; + } +} + +uint8_t TrackElement::GetBrakeBoosterSpeed() const +{ + return URide.BrakeBoosterSpeed << 1; +} + +void TrackElement::SetBrakeBoosterSpeed(uint8_t speed) +{ + URide.BrakeBoosterSpeed = (speed >> 1); +} + +bool TrackElement::HasGreenLight() const +{ + return (Flags2 & TRACK_ELEMENT_FLAGS2_HAS_GREEN_LIGHT) != 0; +} + +void TrackElement::SetHasGreenLight(bool on) +{ + Flags2 &= ~TRACK_ELEMENT_FLAGS2_HAS_GREEN_LIGHT; + if (on) + { + Flags2 |= TRACK_ELEMENT_FLAGS2_HAS_GREEN_LIGHT; + } +} + +bool TrackElement::IsHighlighted() const +{ + return (Flags2 & TRACK_ELEMENT_FLAGS2_HIGHLIGHT); +} + +void TrackElement::SetHighlight(bool on) +{ + Flags2 &= ~TRACK_ELEMENT_FLAGS2_HIGHLIGHT; + if (on) + Flags2 |= TRACK_ELEMENT_FLAGS2_HIGHLIGHT; +} diff --git a/src/openrct2/world/tile_element/TrackElement.h b/src/openrct2/world/tile_element/TrackElement.h new file mode 100644 index 0000000000..460190be10 --- /dev/null +++ b/src/openrct2/world/tile_element/TrackElement.h @@ -0,0 +1,145 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#pragma once + +#include "../TileElement.h" + +enum +{ + TRACK_ELEMENT_FLAGS2_CHAIN_LIFT = 1 << 0, + TRACK_ELEMENT_FLAGS2_INVERTED = 1 << 1, + // Used for giga coaster + TRACK_ELEMENT_FLAGS2_CABLE_LIFT = 1 << 2, + TRACK_ELEMENT_FLAGS2_HIGHLIGHT = 1 << 3, + TRACK_ELEMENT_FLAGS2_HAS_GREEN_LIGHT = 1 << 4, + TRACK_ELEMENT_FLAGS2_BRAKE_CLOSED = 1 << 5, + TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE = 1 << 6, +}; + +enum +{ + TRACK_ELEMENT_COLOUR_SCHEME_MASK = 0b00000011, + // Not colour related, but shares the field. + TRACK_ELEMENT_COLOUR_DOOR_A_MASK = 0b00011100, + TRACK_ELEMENT_COLOUR_DOOR_B_MASK = 0b11100000, + TRACK_ELEMENT_COLOUR_SEAT_ROTATION_MASK = 0b11110000, +}; + +enum +{ + LANDSCAPE_DOOR_CLOSED = 0, + LANDSCAPE_DOOR_HALF_OPEN = 2, + LANDSCAPE_DOOR_OPEN = 3, +}; + +#pragma pack(push, 1) + +struct TrackElement : TileElementBase +{ + static constexpr TileElementType ElementType = TileElementType::Track; + +private: + OpenRCT2::TrackElemType TrackType; + union + { + struct + { + uint8_t Sequence; + uint8_t ColourScheme; + union + { + // - Bits 3 and 4 are never set + // - Bits 1 and 2 are set when a vehicle triggers the on-ride photo and act like a countdown from 3. + // - If any of the bits 1-4 are set, the game counts it as a photo being taken. + uint8_t OnridePhotoBits; + // Contains the brake/booster speed, divided by 2. + uint8_t BrakeBoosterSpeed; + }; + StationIndex stationIndex; + } URide; + struct + { + uint16_t MazeEntry; // 6 + } UMaze; + }; + uint8_t Flags2; + RideId RideIndex; + ride_type_t RideType; + +public: + OpenRCT2::TrackElemType GetTrackType() const; + void SetTrackType(OpenRCT2::TrackElemType newEntryIndex); + + ride_type_t GetRideType() const; + void SetRideType(const ride_type_t rideType); + + uint8_t GetSequenceIndex() const; + void SetSequenceIndex(uint8_t newSequenceIndex); + + RideId GetRideIndex() const; + void SetRideIndex(RideId newRideIndex); + + uint8_t GetColourScheme() const; + void SetColourScheme(RideColourScheme newColourScheme); + + StationIndex GetStationIndex() const; + void SetStationIndex(StationIndex newStationIndex); + + bool HasChain() const; + void SetHasChain(bool on); + + bool HasCableLift() const; + void SetHasCableLift(bool on); + + bool IsInverted() const; + void SetInverted(bool inverted); + + bool IsBrakeClosed() const; + void SetBrakeClosed(bool isClosed); + + bool IsIndestructible() const; + void SetIsIndestructible(bool isIndestructible); + + uint8_t GetBrakeBoosterSpeed() const; + void SetBrakeBoosterSpeed(uint8_t speed); + + bool HasGreenLight() const; + void SetHasGreenLight(bool on); + + uint8_t GetSeatRotation() const; + void SetSeatRotation(uint8_t newSeatRotation); + + uint16_t GetMazeEntry() const; + void SetMazeEntry(uint16_t newMazeEntry); + void MazeEntryAdd(uint16_t addVal); + void MazeEntrySubtract(uint16_t subVal); + + bool IsTakingPhoto() const; + void SetPhotoTimeout(); + void SetPhotoTimeout(uint8_t newValue); + void DecrementPhotoTimeout(); + uint8_t GetPhotoTimeout() const; + + bool IsHighlighted() const; + void SetHighlight(bool on); + + // Used by ghost train, RCT1 feature, will be reintroduced at some point. + // (See https://github.com/OpenRCT2/OpenRCT2/issues/7059) + uint8_t GetDoorAState() const; + uint8_t GetDoorBState() const; + void SetDoorAState(uint8_t newState); + void SetDoorBState(uint8_t newState); + + bool IsStation() const; + bool IsBlockStart() const; +}; +static_assert(sizeof(TrackElement) == kTileElementSize); + +#pragma pack(pop) diff --git a/src/openrct2/world/tile_element/WallElement.cpp b/src/openrct2/world/tile_element/WallElement.cpp index 0f34685ac6..af9a61ad8e 100644 --- a/src/openrct2/world/tile_element/WallElement.cpp +++ b/src/openrct2/world/tile_element/WallElement.cpp @@ -10,6 +10,7 @@ #include "../../object/ObjectEntryManager.h" #include "../../object/WallSceneryEntry.h" +#include "../Banner.h" uint8_t WallElement::GetSlope() const { diff --git a/test/tests/TileElements.cpp b/test/tests/TileElements.cpp index 8eb7b25166..41c18c4501 100644 --- a/test/tests/TileElements.cpp +++ b/test/tests/TileElements.cpp @@ -18,6 +18,7 @@ #include #include #include +#include using namespace OpenRCT2; diff --git a/test/tests/TileElementsView.cpp b/test/tests/TileElementsView.cpp index edc026eeb6..fb880e1f5f 100644 --- a/test/tests/TileElementsView.cpp +++ b/test/tests/TileElementsView.cpp @@ -18,7 +18,9 @@ #include #include #include +#include #include +#include #include using namespace OpenRCT2;