From a2ed0262644ea76407eb40f912e3e0d8cc13e88f Mon Sep 17 00:00:00 2001 From: Michael Steenbeek <1478678+Gymnasiast@users.noreply.github.com> Date: Tue, 15 Oct 2024 22:02:31 +0200 Subject: [PATCH] Split up remaining tile elements --- src/openrct2-ui/interface/LandTool.cpp | 1 - .../interface/ViewportInteraction.cpp | 5 +- src/openrct2-ui/interface/ViewportQuery.cpp | 3 +- src/openrct2-ui/ride/VehicleSounds.cpp | 1 + src/openrct2-ui/windows/Cheats.cpp | 2 +- .../windows/EditorParkEntrance.cpp | 4 +- src/openrct2-ui/windows/Footpath.cpp | 4 +- src/openrct2-ui/windows/LandRights.cpp | 2 +- src/openrct2-ui/windows/Map.cpp | 2 +- src/openrct2-ui/windows/MapGen.cpp | 1 - src/openrct2-ui/windows/RideConstruction.cpp | 3 + src/openrct2-ui/windows/Scenery.cpp | 6 + src/openrct2-ui/windows/Sign.cpp | 1 + src/openrct2-ui/windows/TileInspector.cpp | 5 +- src/openrct2-ui/windows/TopToolbar.cpp | 1 - src/openrct2-ui/windows/TrackDesignPlace.cpp | 2 +- src/openrct2-ui/windows/Transparency.cpp | 1 - src/openrct2/Cheats.cpp | 1 - src/openrct2/EditorObjectSelectionSession.cpp | 7 +- src/openrct2/Game.cpp | 2 +- src/openrct2/actions/BannerPlaceAction.cpp | 2 + src/openrct2/actions/CheatSetAction.cpp | 4 +- src/openrct2/actions/ClearAction.cpp | 3 + .../actions/FootpathAdditionPlaceAction.cpp | 1 + .../actions/FootpathAdditionRemoveAction.cpp | 1 + .../actions/FootpathLayoutPlaceAction.cpp | 3 +- .../actions/FootpathLayoutPlaceAction.h | 1 + src/openrct2/actions/FootpathPlaceAction.cpp | 3 +- src/openrct2/actions/FootpathRemoveAction.cpp | 1 + src/openrct2/actions/LandBuyRightsAction.cpp | 2 +- src/openrct2/actions/LandLowerAction.cpp | 2 +- src/openrct2/actions/LandRaiseAction.cpp | 2 +- src/openrct2/actions/LandSetHeightAction.cpp | 5 +- src/openrct2/actions/LandSetRightsAction.cpp | 2 +- src/openrct2/actions/LandSmoothAction.cpp | 2 +- .../actions/LargeSceneryPlaceAction.cpp | 4 +- .../actions/LargeSceneryRemoveAction.cpp | 1 + .../actions/LargeScenerySetColourAction.cpp | 1 + src/openrct2/actions/MazePlaceTrackAction.cpp | 2 + src/openrct2/actions/MazeSetTrackAction.cpp | 1 + .../actions/ParkEntrancePlaceAction.cpp | 2 +- src/openrct2/actions/PeepSpawnPlaceAction.cpp | 2 +- src/openrct2/actions/SignSetStyleAction.cpp | 1 + .../actions/SmallSceneryPlaceAction.cpp | 5 +- .../actions/SmallSceneryPlaceAction.h | 1 - .../actions/SmallSceneryRemoveAction.cpp | 1 + .../actions/SmallSceneryRemoveAction.h | 1 - .../actions/SmallScenerySetColourAction.cpp | 3 +- .../actions/SurfaceSetStyleAction.cpp | 4 +- src/openrct2/actions/TrackPlaceAction.cpp | 4 +- src/openrct2/actions/TrackRemoveAction.cpp | 3 +- src/openrct2/actions/WallPlaceAction.cpp | 5 +- src/openrct2/actions/WallSetColourAction.cpp | 1 - src/openrct2/actions/WaterLowerAction.cpp | 1 + src/openrct2/actions/WaterRaiseAction.cpp | 1 + src/openrct2/actions/WaterSetHeightAction.cpp | 3 +- src/openrct2/audio/Audio.cpp | 1 + src/openrct2/core/DataSerialiserTraits.h | 2 +- src/openrct2/drawing/LightFX.cpp | 1 + src/openrct2/drawing/ScrollingText.cpp | 1 + src/openrct2/entity/Duck.cpp | 2 +- src/openrct2/entity/Fountain.cpp | 1 + src/openrct2/entity/Fountain.h | 1 + src/openrct2/entity/Guest.cpp | 4 +- src/openrct2/entity/Litter.cpp | 1 + src/openrct2/entity/Particle.cpp | 1 + src/openrct2/entity/Peep.cpp | 3 +- src/openrct2/entity/Staff.cpp | 4 +- src/openrct2/entity/Staff.h | 4 + src/openrct2/interface/Screenshot.cpp | 2 +- src/openrct2/interface/Viewport.cpp | 3 + src/openrct2/libopenrct2.vcxproj | 18 +- src/openrct2/network/NetworkPlayer.cpp | 1 + src/openrct2/network/NetworkPlayer.h | 1 + src/openrct2/paint/Paint.cpp | 1 + src/openrct2/paint/Paint.h | 1 + src/openrct2/paint/VirtualFloor.cpp | 2 + src/openrct2/paint/support/MetalSupports.cpp | 2 +- src/openrct2/paint/support/WoodenSupports.cpp | 1 - .../paint/tile_element/Paint.LargeScenery.cpp | 1 + .../paint/tile_element/Paint.Path.cpp | 4 +- .../paint/tile_element/Paint.PathAddition.cpp | 1 + .../paint/tile_element/Paint.PathAddition.h | 1 - .../paint/tile_element/Paint.SmallScenery.cpp | 1 + .../paint/tile_element/Paint.Surface.cpp | 3 +- .../paint/tile_element/Paint.TileElement.cpp | 3 +- .../paint/tile_element/Paint.Tunnel.cpp | 1 + .../coaster/ClassicStandUpRollerCoaster.cpp | 1 + .../coaster/FlyingRollerCoasterInverted.cpp | 1 + .../paint/track/gentle/CrookedHouse.cpp | 1 + src/openrct2/paint/track/gentle/MiniGolf.cpp | 2 +- .../paint/track/gentle/ObservationTower.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 | 2 + src/openrct2/park/ParkFile.cpp | 2 + src/openrct2/peep/GuestPathfinding.cpp | 4 +- src/openrct2/rct1/S4Importer.cpp | 5 +- src/openrct2/rct1/Tables.cpp | 1 - src/openrct2/rct12/RCT12.cpp | 6 +- src/openrct2/rct12/RCT12.h | 5 + src/openrct2/rct12/ScenarioPatcher.cpp | 3 +- src/openrct2/rct2/S6Importer.cpp | 6 +- src/openrct2/ride/CableLift.cpp | 1 + src/openrct2/ride/MazeCost.cpp | 1 + src/openrct2/ride/Ride.cpp | 1 + src/openrct2/ride/Ride.h | 2 + src/openrct2/ride/RideConstruction.cpp | 1 + src/openrct2/ride/RideRatings.cpp | 3 +- src/openrct2/ride/Station.cpp | 1 + src/openrct2/ride/Track.cpp | 2 +- src/openrct2/ride/Track.h | 3 +- src/openrct2/ride/TrackDesign.cpp | 3 +- src/openrct2/ride/TrackDesignSave.cpp | 5 + src/openrct2/ride/TrackPaint.h | 1 + src/openrct2/ride/Vehicle.cpp | 5 +- src/openrct2/scenario/Scenario.cpp | 1 + .../scripting/bindings/ride/ScTrackIterator.h | 1 - .../scripting/bindings/ride/ScTrackSegment.h | 1 - .../scripting/bindings/world/ScTile.cpp | 2 +- .../bindings/world/ScTileElement.cpp | 5 +- .../bindings/world/ScTileElement.hpp | 1 - src/openrct2/world/Banner.cpp | 1 + src/openrct2/world/ConstructionClearance.cpp | 6 +- src/openrct2/world/ConstructionClearance.h | 7 + src/openrct2/world/Entrance.h | 15 +- src/openrct2/world/Footpath.cpp | 290 +------------ src/openrct2/world/Footpath.h | 35 -- src/openrct2/world/LargeScenery.h | 15 - src/openrct2/world/Map.cpp | 11 +- src/openrct2/world/Map.h | 19 +- src/openrct2/world/MapAnimation.cpp | 4 + src/openrct2/world/MapGen.cpp | 4 +- src/openrct2/world/MapHelpers.cpp | 2 +- src/openrct2/world/Park.cpp | 2 +- src/openrct2/world/Scenery.cpp | 2 + src/openrct2/world/SmallScenery.h | 15 - src/openrct2/world/Surface.h | 88 ---- src/openrct2/world/SurfaceData.cpp | 10 +- src/openrct2/world/TileElement.h | 398 ------------------ src/openrct2/world/TileElementsView.h | 1 - src/openrct2/world/TileInspector.cpp | 9 +- src/openrct2/world/TileInspector.h | 2 + src/openrct2/world/Wall.cpp | 1 + .../world/tile_element/BannerElement.h | 3 +- .../world/tile_element/EntranceElement.h | 18 +- .../LargeSceneryElement.cpp} | 12 +- .../world/tile_element/LargeSceneryElement.h | 64 +++ .../world/tile_element/PathElement.cpp | 306 ++++++++++++++ src/openrct2/world/tile_element/PathElement.h | 153 +++++++ .../SmallSceneryElement.cpp} | 33 +- .../world/tile_element/SmallSceneryElement.h | 57 +++ .../SurfaceElement.cpp} | 20 +- .../world/tile_element/SurfaceElement.h | 92 ++++ .../world/{ => tile_element}/TileElement.cpp | 47 +-- src/openrct2/world/tile_element/TileElement.h | 38 ++ .../world/tile_element/TileElementBase.cpp | 15 +- .../world/tile_element/TileElementBase.h | 120 ++++++ .../world/tile_element/TrackElement.h | 11 +- src/openrct2/world/tile_element/WallElement.h | 6 +- test/tests/Pathfinding.cpp | 1 + test/tests/TileElements.cpp | 1 + test/tests/TileElementsView.cpp | 5 + 164 files changed, 1216 insertions(+), 1014 deletions(-) delete mode 100644 src/openrct2/world/LargeScenery.h delete mode 100644 src/openrct2/world/SmallScenery.h delete mode 100644 src/openrct2/world/Surface.h delete mode 100644 src/openrct2/world/TileElement.h rename src/openrct2/world/{LargeScenery.cpp => tile_element/LargeSceneryElement.cpp} (91%) create mode 100644 src/openrct2/world/tile_element/LargeSceneryElement.h create mode 100644 src/openrct2/world/tile_element/PathElement.cpp create mode 100644 src/openrct2/world/tile_element/PathElement.h rename src/openrct2/world/{SmallScenery.cpp => tile_element/SmallSceneryElement.cpp} (84%) create mode 100644 src/openrct2/world/tile_element/SmallSceneryElement.h rename src/openrct2/world/{Surface.cpp => tile_element/SurfaceElement.cpp} (94%) create mode 100644 src/openrct2/world/tile_element/SurfaceElement.h rename src/openrct2/world/{ => tile_element}/TileElement.cpp (87%) create mode 100644 src/openrct2/world/tile_element/TileElement.h create mode 100644 src/openrct2/world/tile_element/TileElementBase.h diff --git a/src/openrct2-ui/interface/LandTool.cpp b/src/openrct2-ui/interface/LandTool.cpp index ea1853b5bd..a52541b77b 100644 --- a/src/openrct2-ui/interface/LandTool.cpp +++ b/src/openrct2-ui/interface/LandTool.cpp @@ -20,7 +20,6 @@ #include #include #include -#include using namespace OpenRCT2; using namespace OpenRCT2::Ui::Windows; diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 4327d11ef9..b7d15b726d 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -51,9 +51,12 @@ #include #include #include -#include #include #include +#include +#include +#include +#include #include #include diff --git a/src/openrct2-ui/interface/ViewportQuery.cpp b/src/openrct2-ui/interface/ViewportQuery.cpp index bd81178ff0..a143d67fc5 100644 --- a/src/openrct2-ui/interface/ViewportQuery.cpp +++ b/src/openrct2-ui/interface/ViewportQuery.cpp @@ -13,8 +13,9 @@ #include #include -#include #include +#include +#include namespace OpenRCT2::Ui { diff --git a/src/openrct2-ui/ride/VehicleSounds.cpp b/src/openrct2-ui/ride/VehicleSounds.cpp index dc302fcffe..2eed807354 100644 --- a/src/openrct2-ui/ride/VehicleSounds.cpp +++ b/src/openrct2-ui/ride/VehicleSounds.cpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace OpenRCT2::Audio { diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index fc5a47b23a..8b06add9be 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include namespace OpenRCT2::Ui::Windows { diff --git a/src/openrct2-ui/windows/EditorParkEntrance.cpp b/src/openrct2-ui/windows/EditorParkEntrance.cpp index fbb16e0916..fcaa1fdd42 100644 --- a/src/openrct2-ui/windows/EditorParkEntrance.cpp +++ b/src/openrct2-ui/windows/EditorParkEntrance.cpp @@ -17,9 +17,11 @@ #include #include #include -#include #include +#include +#include #include +#include namespace OpenRCT2::Ui::Windows { diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 76102abbfd..2cefec0636 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -37,10 +37,12 @@ #include #include #include +#include #include #include -#include +#include #include +#include namespace OpenRCT2::Ui::Windows { diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index d7b4624959..2d85fb0190 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -24,7 +24,7 @@ #include #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 28bb1d4d9b..049532acc7 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -33,9 +33,9 @@ #include #include #include -#include #include #include +#include #include #include diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 017fa07e48..086ea6c88e 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -26,7 +26,6 @@ #include #include #include -#include namespace OpenRCT2::Ui::Windows { diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 70da1e91b7..43d6aa7419 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -47,9 +47,12 @@ #include #include #include +#include #include #include #include +#include +#include #include constexpr int8_t kDefaultSpeedIncrement = 2; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 663a85ddc6..1a38918b49 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -48,9 +48,15 @@ #include #include #include +#include +#include #include #include #include +#include +#include +#include +#include #include namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 9deff0ae4d..2dcfb75f73 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -25,6 +25,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 6e8735f370..c2a141947d 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -39,11 +39,14 @@ #include #include #include -#include #include #include #include +#include +#include #include +#include +#include #include #include diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 7990116f8b..33b2e95096 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 8d3d9e29b0..c1c83bf06c 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -33,8 +33,8 @@ #include #include #include -#include #include +#include #include using namespace OpenRCT2::TrackMetaData; diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 43e00729d8..e2bc14eec5 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -27,7 +27,6 @@ #include #include #include -#include namespace OpenRCT2::Ui::Windows { diff --git a/src/openrct2/Cheats.cpp b/src/openrct2/Cheats.cpp index 9e999bc7cf..58d86ba487 100644 --- a/src/openrct2/Cheats.cpp +++ b/src/openrct2/Cheats.cpp @@ -22,7 +22,6 @@ #include "world/Map.h" #include "world/Park.h" #include "world/Scenery.h" -#include "world/Surface.h" using namespace OpenRCT2; diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index f860e462fd..292e2a5ed2 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -28,10 +28,13 @@ #include "ride/Vehicle.h" #include "scenario/Scenario.h" #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/LargeSceneryElement.h" +#include "world/tile_element/PathElement.h" +#include "world/tile_element/SmallSceneryElement.h" +#include "world/tile_element/SurfaceElement.h" +#include "world/tile_element/TileElement.h" #include "world/tile_element/WallElement.h" #include diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index 1ed4341d19..767e53ff75 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -70,7 +70,7 @@ #include "world/MapAnimation.h" #include "world/Park.h" #include "world/Scenery.h" -#include "world/Surface.h" +#include "world/tile_element/SurfaceElement.h" #include #include diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index ead853ba0d..4b19e4032c 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -14,10 +14,12 @@ #include "../object/BannerSceneryEntry.h" #include "../object/ObjectEntryManager.h" #include "../world/Banner.h" +#include "../world/Footpath.h" #include "../world/MapAnimation.h" #include "../world/Scenery.h" #include "../world/TileElementsView.h" #include "../world/tile_element/BannerElement.h" +#include "../world/tile_element/PathElement.h" #include "GameAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index cc81dd174e..3106c75158 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -35,7 +35,9 @@ #include "../world/Map.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "ParkSetLoanAction.h" #include "ParkSetParameterAction.h" diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index b084c1e57d..662bb77e65 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -17,6 +17,9 @@ #include "../management/Finance.h" #include "../world/Location.hpp" #include "../world/Map.h" +#include "../world/tile_element/LargeSceneryElement.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SmallSceneryElement.h" #include "FootpathRemoveAction.h" #include "LargeSceneryRemoveAction.h" #include "SmallSceneryRemoveAction.h" diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 9c75c5f2bf..d175b002ce 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -23,6 +23,7 @@ #include "../world/Location.hpp" #include "../world/Park.h" #include "../world/Scenery.h" +#include "../world/tile_element/PathElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index d592ab7ba2..a9cfb875de 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -20,6 +20,7 @@ #include "../world/Footpath.h" #include "../world/Location.hpp" #include "../world/Park.h" +#include "../world/tile_element/PathElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp index b99740aa17..77a99bf527 100644 --- a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp +++ b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp @@ -22,9 +22,10 @@ #include "../world/Location.hpp" #include "../world/Park.h" #include "../world/QuarterTile.h" -#include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/PathElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/FootpathLayoutPlaceAction.h b/src/openrct2/actions/FootpathLayoutPlaceAction.h index 130c540f22..63fd99851e 100644 --- a/src/openrct2/actions/FootpathLayoutPlaceAction.h +++ b/src/openrct2/actions/FootpathLayoutPlaceAction.h @@ -9,6 +9,7 @@ #pragma once +#include "../world/Footpath.h" #include "GameAction.h" class FootpathLayoutPlaceAction final : public GameActionBase diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 14a19f47cf..5deeeb6ddc 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -27,11 +27,12 @@ #include "../world/Park.h" #include "../world/QuarterTile.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/TileElementsView.h" #include "../world/Wall.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/PathElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SurfaceElement.h" #include diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index 8297d31899..39eafb1a58 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -20,6 +20,7 @@ #include "../world/Location.hpp" #include "../world/Park.h" #include "../world/tile_element/BannerElement.h" +#include "../world/tile_element/PathElement.h" #include "BannerRemoveAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index 9c16f882d8..0e53666f3e 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -23,7 +23,7 @@ #include "../windows/Intent.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 94e68219ea..7b3cf49f26 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -22,9 +22,9 @@ #include "../windows/Intent.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/SurfaceData.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index b32cd57612..adae6589b2 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -23,9 +23,9 @@ #include "../windows/Intent.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/SurfaceData.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 31ec643d7c..c31217efca 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -19,12 +19,15 @@ #include "../ride/RideData.h" #include "../windows/Intent.h" #include "../world/ConstructionClearance.h" +#include "../world/Footpath.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/TileElementsView.h" #include "../world/Wall.h" +#include "../world/tile_element/PathElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 89c20b04b2..a6308a903b 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -23,9 +23,9 @@ #include "../windows/Intent.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/TileElementsView.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index e711144e77..23929488fc 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -23,9 +23,9 @@ #include "../windows/Intent.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/SurfaceData.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SurfaceElement.h" #include diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index b4229620a9..36888238db 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -20,11 +20,13 @@ #include "../ride/RideConstruction.h" #include "../world/Banner.h" #include "../world/ConstructionClearance.h" +#include "../world/Footpath.h" #include "../world/MapAnimation.h" #include "../world/QuarterTile.h" -#include "../world/Surface.h" #include "../world/Wall.h" +#include "../world/tile_element/LargeSceneryElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index 7bce2ad289..998b5f470e 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -21,6 +21,7 @@ #include "../ride/Ride.h" #include "../world/Park.h" #include "../world/TileElementsView.h" +#include "../world/tile_element/LargeSceneryElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 36ab12a774..e7f73fdca3 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -15,6 +15,7 @@ #include "../management/Finance.h" #include "../object/LargeSceneryEntry.h" #include "../world/Scenery.h" +#include "../world/tile_element/LargeSceneryElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 32b4495696..5784aa74b3 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -15,7 +15,9 @@ #include "../ride/RideData.h" #include "../ride/TrackData.h" #include "../world/ConstructionClearance.h" +#include "../world/Footpath.h" #include "../world/Wall.h" +#include "../world/tile_element/SurfaceElement.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 4e70b682b4..e754f26134 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/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/ParkEntrancePlaceAction.cpp b/src/openrct2/actions/ParkEntrancePlaceAction.cpp index d52baca087..713d6f647d 100644 --- a/src/openrct2/actions/ParkEntrancePlaceAction.cpp +++ b/src/openrct2/actions/ParkEntrancePlaceAction.cpp @@ -20,8 +20,8 @@ #include "../world/Footpath.h" #include "../world/MapAnimation.h" #include "../world/Park.h" -#include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/PeepSpawnPlaceAction.cpp b/src/openrct2/actions/PeepSpawnPlaceAction.cpp index c27e534302..5e2898a692 100644 --- a/src/openrct2/actions/PeepSpawnPlaceAction.cpp +++ b/src/openrct2/actions/PeepSpawnPlaceAction.cpp @@ -17,7 +17,7 @@ #include "../management/Finance.h" #include "../world/Footpath.h" #include "../world/Park.h" -#include "../world/Surface.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index df5cbf31d1..382fcdf53e 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -18,6 +18,7 @@ #include "../windows/Intent.h" #include "../world/Banner.h" #include "../world/Scenery.h" +#include "../world/tile_element/LargeSceneryElement.h" #include "../world/tile_element/WallElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 3f6ee3302c..8e0a12cffe 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -22,14 +22,15 @@ #include "../ride/Ride.h" #include "../ride/TrackDesign.h" #include "../world/ConstructionClearance.h" +#include "../world/Footpath.h" #include "../world/MapAnimation.h" #include "../world/Park.h" #include "../world/QuarterTile.h" #include "../world/Scenery.h" -#include "../world/Surface.h" -#include "../world/TileElement.h" #include "../world/Wall.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "GameAction.h" #include "SmallSceneryRemoveAction.h" diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.h b/src/openrct2/actions/SmallSceneryPlaceAction.h index 4c4d1ff3ee..b93fa2a72d 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.h +++ b/src/openrct2/actions/SmallSceneryPlaceAction.h @@ -9,7 +9,6 @@ #pragma once -#include "../world/TileElement.h" #include "GameAction.h" struct SmallSceneryPlaceActionResult diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index f1ce345a18..443145bbb3 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.cpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.cpp @@ -22,6 +22,7 @@ #include "../ride/Ride.h" #include "../world/Park.h" #include "../world/TileElementsView.h" +#include "../world/tile_element/SmallSceneryElement.h" #include "GameAction.h" #include "SmallSceneryPlaceAction.h" diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.h b/src/openrct2/actions/SmallSceneryRemoveAction.h index 05308959b9..ba064e94a2 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.h +++ b/src/openrct2/actions/SmallSceneryRemoveAction.h @@ -9,7 +9,6 @@ #pragma once -#include "../world/TileElement.h" #include "GameAction.h" class SmallSceneryRemoveAction final : public GameActionBase diff --git a/src/openrct2/actions/SmallScenerySetColourAction.cpp b/src/openrct2/actions/SmallScenerySetColourAction.cpp index cdaffe7891..5283e66107 100644 --- a/src/openrct2/actions/SmallScenerySetColourAction.cpp +++ b/src/openrct2/actions/SmallScenerySetColourAction.cpp @@ -21,8 +21,7 @@ #include "../ride/TrackDesign.h" #include "../world/MapAnimation.h" #include "../world/Park.h" -#include "../world/Surface.h" -#include "../world/TileElement.h" +#include "../world/tile_element/SmallSceneryElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index 64e617c3bd..ac39d49afa 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.cpp +++ b/src/openrct2/actions/SurfaceSetStyleAction.cpp @@ -17,9 +17,9 @@ #include "../object/ObjectManager.h" #include "../object/TerrainEdgeObject.h" #include "../object/TerrainSurfaceObject.h" +#include "../world/Footpath.h" #include "../world/Park.h" -#include "../world/Surface.h" -#include "../world/TileElement.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 0b24eab99d..4fcc2e39c6 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -19,11 +19,13 @@ #include "../ride/TrackDesign.h" #include "../util/Math.hpp" #include "../world/ConstructionClearance.h" +#include "../world/Footpath.h" #include "../world/MapAnimation.h" #include "../world/QuarterTile.h" -#include "../world/Surface.h" #include "../world/Wall.h" +#include "../world/tile_element/PathElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" #include "RideSetSettingAction.h" diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index a2577cd454..d3ec9ef4c9 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -17,8 +17,9 @@ #include "../ride/TrackData.h" #include "../ride/TrackDesign.h" #include "../util/Util.h" +#include "../world/Footpath.h" #include "../world/MapAnimation.h" -#include "../world/Surface.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" #include "RideSetSettingAction.h" diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 1eae718b4b..852a506d1a 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -22,9 +22,12 @@ #include "../world/Banner.h" #include "../world/ConstructionClearance.h" #include "../world/MapAnimation.h" -#include "../world/Surface.h" #include "../world/Wall.h" +#include "../world/tile_element/LargeSceneryElement.h" +#include "../world/tile_element/PathElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index e027958d42..9cbedcc2d3 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -19,7 +19,6 @@ #include "../world/Banner.h" #include "../world/MapAnimation.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/tile_element/WallElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/WaterLowerAction.cpp b/src/openrct2/actions/WaterLowerAction.cpp index d547ea6c3e..9005b0a01f 100644 --- a/src/openrct2/actions/WaterLowerAction.cpp +++ b/src/openrct2/actions/WaterLowerAction.cpp @@ -13,6 +13,7 @@ #include "../OpenRCT2.h" #include "../audio/audio.h" #include "../ride/RideConstruction.h" +#include "../world/tile_element/SurfaceElement.h" #include "WaterSetHeightAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index 3bd26c4217..eede825891 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -13,6 +13,7 @@ #include "../OpenRCT2.h" #include "../audio/audio.h" #include "../ride/RideConstruction.h" +#include "../world/tile_element/SurfaceElement.h" #include "WaterSetHeightAction.h" using namespace OpenRCT2; diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index 283c96892a..129d8bc69d 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -14,9 +14,10 @@ #include "../OpenRCT2.h" #include "../management/Finance.h" #include "../world/ConstructionClearance.h" +#include "../world/Footpath.h" #include "../world/Park.h" -#include "../world/Surface.h" #include "../world/Wall.h" +#include "../world/tile_element/SurfaceElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index 4b9f01e1d3..1ba0d268e8 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -29,6 +29,7 @@ #include "../ui/UiContext.h" #include "../util/Util.h" #include "../world/Climate.h" +#include "../world/tile_element/SurfaceElement.h" #include "AudioChannel.h" #include "AudioContext.h" #include "AudioMixer.h" diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index e818e276db..b8257a2f81 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -18,7 +18,7 @@ #include "../ride/TrackDesign.h" #include "../world/Banner.h" #include "../world/Location.hpp" -#include "../world/TileElement.h" +#include "../world/tile_element/TileElement.h" #include "DataSerialiserTag.h" #include "Endianness.h" #include "MemoryStream.h" diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 74a7a1c8f5..b1ee8e3cac 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -22,6 +22,7 @@ #include "../ride/RideData.h" #include "../ride/Vehicle.h" #include "../world/Map.h" +#include "../world/tile_element/TileElement.h" #include "Drawing.h" #include diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 99043e3c05..4b85b67609 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -18,6 +18,7 @@ #include "../localisation/LocalisationService.h" #include "../paint/Paint.h" #include "../sprites.h" +#include "../util/Util.h" #include "Drawing.h" #include "TTF.h" diff --git a/src/openrct2/entity/Duck.cpp b/src/openrct2/entity/Duck.cpp index 48dcb9b62f..14f6cd2482 100644 --- a/src/openrct2/entity/Duck.cpp +++ b/src/openrct2/entity/Duck.cpp @@ -16,7 +16,7 @@ #include "../profiling/Profiling.h" #include "../scenario/Scenario.h" #include "../sprites.h" -#include "../world/Surface.h" +#include "../world/tile_element/SurfaceElement.h" #include "EntityRegistry.h" #include diff --git a/src/openrct2/entity/Fountain.cpp b/src/openrct2/entity/Fountain.cpp index d8e8ebc302..7125959be8 100644 --- a/src/openrct2/entity/Fountain.cpp +++ b/src/openrct2/entity/Fountain.cpp @@ -20,6 +20,7 @@ #include "../world/Location.hpp" #include "../world/Map.h" #include "../world/Scenery.h" +#include "../world/tile_element/PathElement.h" #include "EntityRegistry.h" using namespace OpenRCT2; diff --git a/src/openrct2/entity/Fountain.h b/src/openrct2/entity/Fountain.h index 9820afb8a3..39aa1e6cb6 100644 --- a/src/openrct2/entity/Fountain.h +++ b/src/openrct2/entity/Fountain.h @@ -13,6 +13,7 @@ #include "EntityBase.h" class DataSerialiser; +struct PaintSession; enum class JumpingFountainType : uint8_t { diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 202d60954d..ca22b6f587 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -58,9 +58,11 @@ #include "../world/Map.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/TileElementsView.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/LargeSceneryElement.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" #include "Peep.h" diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index e544a7ec8c..0919ea9825 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -8,6 +8,7 @@ #include "../paint/Paint.h" #include "../profiling/Profiling.h" #include "../sprites.h" +#include "../world/Footpath.h" #include "../world/Map.h" #include "EntityList.h" #include "EntityRegistry.h" diff --git a/src/openrct2/entity/Particle.cpp b/src/openrct2/entity/Particle.cpp index d83a05acff..c648687298 100644 --- a/src/openrct2/entity/Particle.cpp +++ b/src/openrct2/entity/Particle.cpp @@ -14,6 +14,7 @@ #include "../profiling/Profiling.h" #include "../ride/VehicleColour.h" #include "../scenario/Scenario.h" +#include "../world/tile_element/SurfaceElement.h" #include "EntityRegistry.h" #include diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 8ead7e9184..962221d2ce 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -55,8 +55,9 @@ #include "../world/Map.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SurfaceElement.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 58b78d76ca..2bc911ab5f 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -42,9 +42,11 @@ #include "../world/Entrance.h" #include "../world/Footpath.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/PathElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" #include "PatrolArea.h" #include "Peep.h" diff --git a/src/openrct2/entity/Staff.h b/src/openrct2/entity/Staff.h index 2eea66d32a..1831002e8a 100644 --- a/src/openrct2/entity/Staff.h +++ b/src/openrct2/entity/Staff.h @@ -12,9 +12,13 @@ #include "../world/Map.h" #include "Peep.h" +#include + class DataSerialiser; class PatrolArea; +using colour_t = uint8_t; + struct Staff : Peep { static constexpr auto cEntityType = EntityType::Staff; diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 19ab1d27e3..0778d15173 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -32,7 +32,7 @@ #include "../world/Climate.h" #include "../world/Map.h" #include "../world/Park.h" -#include "../world/Surface.h" +#include "../world/tile_element/SurfaceElement.h" #include "Viewport.h" #include diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 5baa7d259f..64c5b6b4d0 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -38,6 +38,9 @@ #include "../util/Math.hpp" #include "../world/Climate.h" #include "../world/Map.h" +#include "../world/tile_element/LargeSceneryElement.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/TileElement.h" #include "../world/tile_element/WallElement.h" #include "Colour.h" #include "Window.h" diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index bcd41886a1..74ea55ec6e 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -614,16 +614,19 @@ - - - + + + + + + @@ -1093,7 +1096,6 @@ - @@ -1101,13 +1103,15 @@ - - - + + + + + diff --git a/src/openrct2/network/NetworkPlayer.cpp b/src/openrct2/network/NetworkPlayer.cpp index ef221ddbf8..9bc4915d75 100644 --- a/src/openrct2/network/NetworkPlayer.cpp +++ b/src/openrct2/network/NetworkPlayer.cpp @@ -11,6 +11,7 @@ # include "NetworkPlayer.h" +# include "../core/Money.hpp" # include "../interface/Window.h" # include "NetworkPacket.h" diff --git a/src/openrct2/network/NetworkPlayer.h b/src/openrct2/network/NetworkPlayer.h index 6a816283ae..9f9bea7b56 100644 --- a/src/openrct2/network/NetworkPlayer.h +++ b/src/openrct2/network/NetworkPlayer.h @@ -10,6 +10,7 @@ #pragma once #include "../Game.h" +#include "../core/Money.hpp" #include "../world/Map.h" #include diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 70919efbe3..209d317f1d 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -12,6 +12,7 @@ #include "../Context.h" #include "../config/Config.h" #include "../core/Guard.hpp" +#include "../core/Money.hpp" #include "../drawing/Drawing.h" #include "../interface/Viewport.h" #include "../localisation/Currency.h" diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index c8a9d16e50..250c6b834a 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -9,6 +9,7 @@ #pragma once +#include "../core/Money.hpp" #include "../drawing/Drawing.h" #include "../interface/Colour.h" #include "../world/Location.hpp" diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index da9cecdf96..2eb7285a92 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -21,6 +21,8 @@ #include "../world/Location.hpp" #include "../world/Map.h" #include "../world/TileElementsView.h" +#include "../world/tile_element/SurfaceElement.h" +#include "../world/tile_element/TileElement.h" #include "Paint.h" #include "VirtualFloor.h" #include "tile_element/Paint.TileElement.h" diff --git a/src/openrct2/paint/support/MetalSupports.cpp b/src/openrct2/paint/support/MetalSupports.cpp index 45a83fef36..a49be52f02 100644 --- a/src/openrct2/paint/support/MetalSupports.cpp +++ b/src/openrct2/paint/support/MetalSupports.cpp @@ -12,7 +12,7 @@ #include "../../drawing/Drawing.h" #include "../../interface/Viewport.h" #include "../../util/Util.h" -#include "../../world/Surface.h" +#include "../../world/Footpath.h" #include "../../world/tile_element/Slope.h" #include "../Paint.SessionFlags.h" #include "../Paint.h" diff --git a/src/openrct2/paint/support/WoodenSupports.cpp b/src/openrct2/paint/support/WoodenSupports.cpp index eaec306c5b..e6fac7d1e6 100644 --- a/src/openrct2/paint/support/WoodenSupports.cpp +++ b/src/openrct2/paint/support/WoodenSupports.cpp @@ -13,7 +13,6 @@ #include "../../ride/TrackData.h" #include "../../sprites.h" #include "../../world/Map.h" -#include "../../world/Surface.h" #include "../../world/tile_element/Slope.h" #include "../Boundbox.h" #include "../Paint.SessionFlags.h" diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 1626c1fc64..7cdc0ca7ad 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -27,6 +27,7 @@ #include "../../world/Map.h" #include "../../world/Scenery.h" #include "../../world/TileInspector.h" +#include "../../world/tile_element/LargeSceneryElement.h" #include "../Boundbox.h" #include "../support/WoodenSupports.h" #include "Paint.TileElement.h" diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 3e4975facc..cdb3e35834 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -31,9 +31,11 @@ #include "../../world/Footpath.h" #include "../../world/Map.h" #include "../../world/Scenery.h" -#include "../../world/Surface.h" #include "../../world/TileInspector.h" +#include "../../world/tile_element/PathElement.h" #include "../../world/tile_element/Slope.h" +#include "../../world/tile_element/SurfaceElement.h" +#include "../../world/tile_element/TileElement.h" #include "../../world/tile_element/TrackElement.h" #include "../Boundbox.h" #include "../Paint.SessionFlags.h" diff --git a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp index 1f79c8002f..7578140bc6 100644 --- a/src/openrct2/paint/tile_element/Paint.PathAddition.cpp +++ b/src/openrct2/paint/tile_element/Paint.PathAddition.cpp @@ -14,6 +14,7 @@ #include "../../interface/Viewport.h" #include "../../object/PathAdditionEntry.h" #include "../../profiling/Profiling.h" +#include "../../world/tile_element/PathElement.h" #include "Paint.TileElement.h" using namespace OpenRCT2; diff --git a/src/openrct2/paint/tile_element/Paint.PathAddition.h b/src/openrct2/paint/tile_element/Paint.PathAddition.h index e36ac0e225..dc7d0fbda3 100644 --- a/src/openrct2/paint/tile_element/Paint.PathAddition.h +++ b/src/openrct2/paint/tile_element/Paint.PathAddition.h @@ -10,7 +10,6 @@ #pragma once #include "../../drawing/ImageId.hpp" -#include "../../world/TileElement.h" #include "../Paint.h" #include diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 981fb48435..00cb9be4a4 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -20,6 +20,7 @@ #include "../../world/Map.h" #include "../../world/Scenery.h" #include "../../world/TileInspector.h" +#include "../../world/tile_element/SmallSceneryElement.h" #include "../support/WoodenSupports.h" #include "Paint.TileElement.h" #include "Segment.h" diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index a1eac2f7c1..81937e7172 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -27,8 +27,9 @@ #include "../../profiling/Profiling.h" #include "../../ride/TrackDesign.h" #include "../../sprites.h" -#include "../../world/Surface.h" #include "../../world/tile_element/Slope.h" +#include "../../world/tile_element/SurfaceElement.h" +#include "../../world/tile_element/TileElement.h" #include "../Boundbox.h" #include "../Paint.SessionFlags.h" #include "Paint.TileElement.h" diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 34691e8d0d..c123239df9 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -25,8 +25,9 @@ #include "../../world/Footpath.h" #include "../../world/Map.h" #include "../../world/Scenery.h" -#include "../../world/Surface.h" #include "../../world/tile_element/Slope.h" +#include "../../world/tile_element/SurfaceElement.h" +#include "../../world/tile_element/TileElement.h" #include "../Paint.SessionFlags.h" #include "../Paint.h" #include "../VirtualFloor.h" diff --git a/src/openrct2/paint/tile_element/Paint.Tunnel.cpp b/src/openrct2/paint/tile_element/Paint.Tunnel.cpp index 9f0c739d9f..16cfd844bd 100644 --- a/src/openrct2/paint/tile_element/Paint.Tunnel.cpp +++ b/src/openrct2/paint/tile_element/Paint.Tunnel.cpp @@ -1,6 +1,7 @@ #include "Paint.Tunnel.h" +#include "../../util/Util.h" #include "../Paint.h" #include diff --git a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp index 3686d97e24..f4749db671 100644 --- a/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/ClassicStandUpRollerCoaster.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../../ride/Ride.h" #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" diff --git a/src/openrct2/paint/track/coaster/FlyingRollerCoasterInverted.cpp b/src/openrct2/paint/track/coaster/FlyingRollerCoasterInverted.cpp index e5d8f682ae..c94457a7c2 100644 --- a/src/openrct2/paint/track/coaster/FlyingRollerCoasterInverted.cpp +++ b/src/openrct2/paint/track/coaster/FlyingRollerCoasterInverted.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../../ride/Ride.h" #include "../../../ride/Track.h" #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" diff --git a/src/openrct2/paint/track/gentle/CrookedHouse.cpp b/src/openrct2/paint/track/gentle/CrookedHouse.cpp index 70a8199132..4bd1540037 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/TileElement.h" #include "../../../world/tile_element/TrackElement.h" #include "../../Boundbox.h" #include "../../Paint.h" diff --git a/src/openrct2/paint/track/gentle/MiniGolf.cpp b/src/openrct2/paint/track/gentle/MiniGolf.cpp index d0efbd75c5..c09cd5bb03 100644 --- a/src/openrct2/paint/track/gentle/MiniGolf.cpp +++ b/src/openrct2/paint/track/gentle/MiniGolf.cpp @@ -13,8 +13,8 @@ #include "../../../ride/TrackPaint.h" #include "../../../ride/Vehicle.h" #include "../../../world/Map.h" -#include "../../../world/Surface.h" #include "../../../world/tile_element/Slope.h" +#include "../../../world/tile_element/SurfaceElement.h" #include "../../../world/tile_element/TrackElement.h" #include "../../Paint.SessionFlags.h" #include "../../Paint.h" diff --git a/src/openrct2/paint/track/gentle/ObservationTower.cpp b/src/openrct2/paint/track/gentle/ObservationTower.cpp index 9b5682f684..8e9eae8b02 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/TileElement.h" #include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp b/src/openrct2/paint/track/thrill/LaunchedFreefall.cpp index 841fda7e08..46a0968512 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/TileElement.h" #include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/thrill/RotoDrop.cpp b/src/openrct2/paint/track/thrill/RotoDrop.cpp index 0ffc4e5b49..9029cd1193 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/TileElement.h" #include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/paint/track/transport/Chairlift.cpp b/src/openrct2/paint/track/transport/Chairlift.cpp index a091e12492..728717a686 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/TileElement.h" #include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/MetalSupports.h" diff --git a/src/openrct2/paint/track/transport/MiniatureRailway.cpp b/src/openrct2/paint/track/transport/MiniatureRailway.cpp index 64318bc93f..252eb27813 100644 --- a/src/openrct2/paint/track/transport/MiniatureRailway.cpp +++ b/src/openrct2/paint/track/transport/MiniatureRailway.cpp @@ -13,6 +13,8 @@ #include "../../../ride/TrackPaint.h" #include "../../../sprites.h" #include "../../../world/Map.h" +#include "../../../world/tile_element/PathElement.h" +#include "../../../world/tile_element/TileElement.h" #include "../../../world/tile_element/TrackElement.h" #include "../../Paint.h" #include "../../support/WoodenSupports.h" diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 9154b81107..5ce16b396f 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -56,6 +56,8 @@ #include "../world/Map.h" #include "../world/Park.h" #include "../world/Scenery.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SmallSceneryElement.h" #include "../world/tile_element/TrackElement.h" #include "Legacy.h" diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 22f4a8f1b9..3bcbb584ca 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -24,6 +24,8 @@ #include "../world/Footpath.h" #include "../world/tile_element/BannerElement.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/TileElement.h" #include "../world/tile_element/TrackElement.h" #include @@ -1823,7 +1825,7 @@ namespace OpenRCT2::PathFinding break; } - if (loc.z == MAX_ELEMENT_HEIGHT) + if (loc.z == kMaxTileElementHeight) return; tileElement = lastPathElement; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 1756e49080..553efaab6d 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -69,11 +69,14 @@ #include "../world/MapAnimation.h" #include "../world/Park.h" #include "../world/Scenery.h" -#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/LargeSceneryElement.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" #include "RCT1.h" diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index 8d20f630bf..23211ae6e4 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -15,7 +15,6 @@ #include "../object/ObjectManager.h" #include "../ride/Ride.h" #include "../ride/RideData.h" -#include "../world/Surface.h" #include "RCT1.h" #include diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index d1ade8462e..4cb535081d 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -22,11 +22,11 @@ #include "../scenario/Scenario.h" #include "../world/Banner.h" #include "../world/Footpath.h" -#include "../world/SmallScenery.h" -#include "../world/Surface.h" -#include "../world/TileElement.h" #include "../world/Wall.h" +#include "../world/tile_element/PathElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/WallElement.h" #include "EntryList.h" diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 1fdaaa34cc..357c25390b 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -306,6 +306,11 @@ namespace OpenRCT2::RCT12 }; } // namespace OpenRCT2::RCT12 +enum +{ + MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT = (1 << 7), +}; + constexpr uint8_t RCT2_STRING_FORMAT_ARG_START = 123; constexpr uint8_t RCT2_STRING_FORMAT_ARG_END = 141; constexpr uint8_t RCT2_STRING_FORMAT_COLOUR_START = 142; diff --git a/src/openrct2/rct12/ScenarioPatcher.cpp b/src/openrct2/rct12/ScenarioPatcher.cpp index b621b20806..0f05fdcc6c 100644 --- a/src/openrct2/rct12/ScenarioPatcher.cpp +++ b/src/openrct2/rct12/ScenarioPatcher.cpp @@ -26,8 +26,9 @@ #include "../world/Footpath.h" #include "../world/Location.hpp" #include "../world/Map.h" -#include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/SurfaceElement.h" +#include "../world/tile_element/TileElement.h" #include "../world/tile_element/TileElementType.h" #include "../world/tile_element/TrackElement.h" diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 428d3161e3..f698231114 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -75,10 +75,14 @@ #include "../world/MapAnimation.h" #include "../world/Park.h" #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/LargeSceneryElement.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" +#include "../world/tile_element/TileElement.h" #include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" diff --git a/src/openrct2/ride/CableLift.cpp b/src/openrct2/ride/CableLift.cpp index fe27561c85..6dd960b5d3 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/TileElement.h" #include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" diff --git a/src/openrct2/ride/MazeCost.cpp b/src/openrct2/ride/MazeCost.cpp index ef8e3108dc..04c54b37a7 100644 --- a/src/openrct2/ride/MazeCost.cpp +++ b/src/openrct2/ride/MazeCost.cpp @@ -11,6 +11,7 @@ #include "../core/Money.hpp" #include "../world/Location.hpp" +#include "../world/tile_element/SurfaceElement.h" #include "Ride.h" #include "RideData.h" #include "TrackData.h" diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 112cd79325..1275005c85 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/PathElement.h" #include "../world/tile_element/TrackElement.h" #include "CableLift.h" #include "RideAudio.h" diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 3899b1937b..214cba38b6 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -40,6 +40,8 @@ struct Staff; struct Vehicle; struct RideObjectEntry; struct ResultWithMessage; +struct TileElement; +struct TrackElement; constexpr uint8_t kRideAdjacencyCheckDistance = 5; diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 62e96b586b..f5f57f7e5f 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/PathElement.h" #include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 256281587e..20226b1a4c 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -19,7 +19,8 @@ #include "../scripting/ScriptEngine.h" #include "../world/Footpath.h" #include "../world/Map.h" -#include "../world/Surface.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 2e487b7693..cbf738a361 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/TileElement.h" #include "../world/tile_element/TrackElement.h" #include "RideEntry.h" #include "Track.h" diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 68efe948b4..b03c3730c3 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -28,7 +28,7 @@ #include "../world/MapAnimation.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" +#include "../world/tile_element/TileElement.h" #include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index 627a5b24c8..9a37c76438 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -9,10 +9,10 @@ #pragma once +#include "../Identifiers.h" #include "../object/Object.h" #include "../world/Map.h" #include "../world/QuarterTile.h" -#include "../world/TileElement.h" #include @@ -28,6 +28,7 @@ namespace OpenRCT2 } struct ResultWithMessage; +struct TileElement; enum class TrackRoll : uint8_t { diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 3de439adc9..86a702b2dd 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -56,9 +56,10 @@ #include "../world/Footpath.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" #include "../world/tile_element/EntranceElement.h" +#include "../world/tile_element/PathElement.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" #include "Ride.h" #include "RideData.h" diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index 367183ed8c..469e514a07 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -25,7 +25,12 @@ #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/LargeSceneryElement.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/TileElement.h" #include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" #include "RideData.h" diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 8c87898015..9519baab66 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -16,6 +16,7 @@ #include "../world/Map.h" class StationObject; +struct Ride; constexpr uint8_t kTrackMap2x2[][4] = { { 0, 1, 2, 3 }, diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 5a59047a95..c65cee8446 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -46,7 +46,10 @@ #include "../world/MapAnimation.h" #include "../world/Park.h" #include "../world/Scenery.h" -#include "../world/Surface.h" +#include "../world/tile_element/LargeSceneryElement.h" +#include "../world/tile_element/PathElement.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" #include "../world/tile_element/TrackElement.h" #include "../world/tile_element/WallElement.h" #include "CableLift.h" diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 9820fc9e80..5500175e3b 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/TileElement.h" #include "../world/tile_element/TrackElement.h" #include "ScenarioRepository.h" #include "ScenarioSources.h" diff --git a/src/openrct2/scripting/bindings/ride/ScTrackIterator.h b/src/openrct2/scripting/bindings/ride/ScTrackIterator.h index 9880586175..b3a977e957 100644 --- a/src/openrct2/scripting/bindings/ride/ScTrackIterator.h +++ b/src/openrct2/scripting/bindings/ride/ScTrackIterator.h @@ -12,7 +12,6 @@ #ifdef ENABLE_SCRIPTING # include "../../../Identifiers.h" -# include "../../../world/TileElement.h" # include "../../Duktape.hpp" # include diff --git a/src/openrct2/scripting/bindings/ride/ScTrackSegment.h b/src/openrct2/scripting/bindings/ride/ScTrackSegment.h index 769fcd95e9..8e9a9ea00a 100644 --- a/src/openrct2/scripting/bindings/ride/ScTrackSegment.h +++ b/src/openrct2/scripting/bindings/ride/ScTrackSegment.h @@ -11,7 +11,6 @@ #ifdef ENABLE_SCRIPTING -# include "../../../world/TileElement.h" # include "../../Duktape.hpp" # include diff --git a/src/openrct2/scripting/bindings/world/ScTile.cpp b/src/openrct2/scripting/bindings/world/ScTile.cpp index e04fd9385b..795911e97c 100644 --- a/src/openrct2/scripting/bindings/world/ScTile.cpp +++ b/src/openrct2/scripting/bindings/world/ScTile.cpp @@ -18,7 +18,7 @@ # include "../../../ride/Track.h" # include "../../../world/Footpath.h" # include "../../../world/Scenery.h" -# include "../../../world/Surface.h" +# include "../../../world/tile_element/LargeSceneryElement.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" # include "ScTileElement.hpp" diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 1760f3f52f..027a73a76b 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -21,9 +21,12 @@ # include "../../../ride/Track.h" # 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/LargeSceneryElement.h" +# include "../../../world/tile_element/PathElement.h" +# include "../../../world/tile_element/SmallSceneryElement.h" +# include "../../../world/tile_element/SurfaceElement.h" # include "../../../world/tile_element/TrackElement.h" # include "../../../world/tile_element/WallElement.h" # include "../../Duktape.hpp" diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.hpp b/src/openrct2/scripting/bindings/world/ScTileElement.hpp index 9ac6a6a0c5..b3c45e1343 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.hpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.hpp @@ -17,7 +17,6 @@ # include "../../../ride/Track.h" # include "../../../world/Footpath.h" # include "../../../world/Scenery.h" -# include "../../../world/Surface.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 6145a408c3..0281b391c2 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -33,6 +33,7 @@ #include "Scenery.h" #include "TileElementsView.h" #include "tile_element/BannerElement.h" +#include "tile_element/TileElement.h" #include "tile_element/TrackElement.h" #include "tile_element/WallElement.h" diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index 76bc023792..a3d65ad733 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -21,9 +21,13 @@ #include "Park.h" #include "QuarterTile.h" #include "Scenery.h" -#include "Surface.h" #include "tile_element/EntranceElement.h" +#include "tile_element/LargeSceneryElement.h" +#include "tile_element/PathElement.h" #include "tile_element/Slope.h" +#include "tile_element/SmallSceneryElement.h" +#include "tile_element/SurfaceElement.h" +#include "tile_element/TileElement.h" #include "tile_element/TrackElement.h" #include "tile_element/WallElement.h" diff --git a/src/openrct2/world/ConstructionClearance.h b/src/openrct2/world/ConstructionClearance.h index 618592c8d0..0d68eb7759 100644 --- a/src/openrct2/world/ConstructionClearance.h +++ b/src/openrct2/world/ConstructionClearance.h @@ -21,6 +21,13 @@ class QuarterTile; using CLEAR_FUNC = int32_t (*)(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money64* price); +enum +{ + ELEMENT_IS_ABOVE_GROUND = 1 << 0, + ELEMENT_IS_UNDERGROUND = 1 << 1, + ELEMENT_IS_UNDERWATER = 1 << 2, +}; + // Used when calling MapCanConstructWithClearAt(); // This assumes that the caller has already done the check on the element it wants to place, // as this function can only check the element the player wants to build through. diff --git a/src/openrct2/world/Entrance.h b/src/openrct2/world/Entrance.h index 0ea355a279..9959c31ac4 100644 --- a/src/openrct2/world/Entrance.h +++ b/src/openrct2/world/Entrance.h @@ -11,21 +11,8 @@ #include "../Identifiers.h" #include "Location.hpp" -#include "Map.h" -struct TileElement; - -enum -{ - ENTRANCE_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY = (1 << 0), -}; - -namespace OpenRCT2::EntranceSequence -{ - constexpr uint8_t Centre = 0; - constexpr uint8_t Left = 1; - constexpr uint8_t Right = 2; -}; // namespace OpenRCT2::EntranceSequence +struct CoordsXYE; constexpr uint8_t ParkEntranceHeight = 12 * kCoordsZStep; constexpr uint8_t RideEntranceHeight = 7 * kCoordsZStep; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index b97574c451..771050cb80 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -36,11 +36,11 @@ #include "Location.hpp" #include "Map.h" #include "MapAnimation.h" -#include "Surface.h" -#include "TileElement.h" #include "tile_element/BannerElement.h" #include "tile_element/EntranceElement.h" +#include "tile_element/PathElement.h" #include "tile_element/Slope.h" +#include "tile_element/SurfaceElement.h" #include "tile_element/TrackElement.h" #include @@ -1239,292 +1239,6 @@ int32_t FootpathIsConnectedToMapEdge(const CoordsXYZ& footpathPos, int32_t direc return FootpathIsConnectedToMapEdgeHelper(footpathPos, direction, flags); } -bool PathElement::IsSloped() const -{ - return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED) != 0; -} - -void PathElement::SetSloped(bool isSloped) -{ - Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED; - if (isSloped) - Flags2 |= FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED; -} - -bool PathElement::HasJunctionRailings() const -{ - return Flags2 & FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS; -} - -void PathElement::SetJunctionRailings(bool hasJunctionRailings) -{ - Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS; - if (hasJunctionRailings) - Flags2 |= FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS; -} - -Direction PathElement::GetSlopeDirection() const -{ - return SlopeDirection; -} - -void PathElement::SetSlopeDirection(Direction newSlope) -{ - SlopeDirection = newSlope; -} - -bool PathElement::IsQueue() const -{ - return (Type & FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE) != 0; -} - -void PathElement::SetIsQueue(bool isQueue) -{ - Type &= ~FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE; - if (isQueue) - Type |= FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE; -} - -bool PathElement::HasQueueBanner() const -{ - return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER) != 0; -} - -void PathElement::SetHasQueueBanner(bool hasQueueBanner) -{ - Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER; - if (hasQueueBanner) - Flags2 |= FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER; -} - -bool PathElement::IsBroken() const -{ - return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN) != 0; -} - -void PathElement::SetIsBroken(bool isBroken) -{ - if (isBroken) - { - Flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN; - } - else - { - Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN; - } -} - -bool PathElement::IsBlockedByVehicle() const -{ - return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE) != 0; -} - -void PathElement::SetIsBlockedByVehicle(bool isBlocked) -{ - if (isBlocked) - { - Flags2 |= FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE; - } - else - { - Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE; - } -} - -::StationIndex PathElement::GetStationIndex() const -{ - return StationIndex; -} - -void PathElement::SetStationIndex(::StationIndex newStationIndex) -{ - StationIndex = newStationIndex; -} - -bool PathElement::IsWide() const -{ - return (Type & FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE) != 0; -} - -void PathElement::SetWide(bool isWide) -{ - Type &= ~FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE; - if (isWide) - Type |= FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE; -} - -bool PathElement::HasAddition() const -{ - return Additions != 0; -} - -uint8_t PathElement::GetAddition() const -{ - return Additions; -} - -ObjectEntryIndex PathElement::GetAdditionEntryIndex() const -{ - // `Additions` is set to 0 when there is no addition, so the value 1 corresponds with path addition slot 0, etc. - return GetAddition() - 1; -} - -const PathAdditionEntry* PathElement::GetAdditionEntry() const -{ - if (!HasAddition()) - return nullptr; - return OpenRCT2::ObjectManager::GetObjectEntry(GetAdditionEntryIndex()); -} - -void PathElement::SetAddition(uint8_t newAddition) -{ - Additions = newAddition; -} - -void PathElement::SetAdditionEntryIndex(ObjectEntryIndex entryIndex) -{ - // `Additions` is set to 0 when there is no addition, so the value 1 corresponds with path addition slot 0, etc. - Additions = entryIndex + 1; -} - -bool PathElement::AdditionIsGhost() const -{ - return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST) != 0; -} - -void PathElement::SetAdditionIsGhost(bool isGhost) -{ - Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST; - if (isGhost) - Flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST; -} - -ObjectEntryIndex PathElement::GetLegacyPathEntryIndex() const -{ - if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) - return SurfaceIndex; - - return OBJECT_ENTRY_INDEX_NULL; -} - -const FootpathObject* PathElement::GetLegacyPathEntry() const -{ - return GetLegacyFootpathEntry(GetLegacyPathEntryIndex()); -} - -void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex) -{ - SurfaceIndex = newIndex; - RailingsIndex = OBJECT_ENTRY_INDEX_NULL; - Flags2 |= FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; -} - -bool PathElement::HasLegacyPathEntry() const -{ - return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) != 0; -} - -const PathSurfaceDescriptor* PathElement::GetSurfaceDescriptor() const -{ - if (HasLegacyPathEntry()) - { - const auto* legacyPathEntry = GetLegacyPathEntry(); - if (legacyPathEntry == nullptr) - return nullptr; - - if (IsQueue()) - return &legacyPathEntry->GetQueueSurfaceDescriptor(); - - return &legacyPathEntry->GetPathSurfaceDescriptor(); - } - - const auto* surfaceEntry = GetSurfaceEntry(); - if (surfaceEntry == nullptr) - return nullptr; - - return &surfaceEntry->GetDescriptor(); -} - -const PathRailingsDescriptor* PathElement::GetRailingsDescriptor() const -{ - if (HasLegacyPathEntry()) - { - const auto* legacyPathEntry = GetLegacyPathEntry(); - if (legacyPathEntry == nullptr) - return nullptr; - - return &legacyPathEntry->GetPathRailingsDescriptor(); - } - - const auto* railingsEntry = GetRailingsEntry(); - if (railingsEntry == nullptr) - return nullptr; - - return &railingsEntry->GetDescriptor(); -} - -ObjectEntryIndex PathElement::GetSurfaceEntryIndex() const -{ - if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) - return OBJECT_ENTRY_INDEX_NULL; - - return SurfaceIndex; -} - -const FootpathSurfaceObject* PathElement::GetSurfaceEntry() const -{ - auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); - return static_cast(objMgr.GetLoadedObject(ObjectType::FootpathSurface, GetSurfaceEntryIndex())); -} - -void PathElement::SetSurfaceEntryIndex(ObjectEntryIndex newIndex) -{ - SurfaceIndex = newIndex; - Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; -} - -ObjectEntryIndex PathElement::GetRailingsEntryIndex() const -{ - if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) - return OBJECT_ENTRY_INDEX_NULL; - - return RailingsIndex; -} - -const FootpathRailingsObject* PathElement::GetRailingsEntry() const -{ - auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); - return static_cast(objMgr.GetLoadedObject(ObjectType::FootpathRailings, GetRailingsEntryIndex())); -} - -void PathElement::SetRailingsEntryIndex(ObjectEntryIndex newEntryIndex) -{ - RailingsIndex = newEntryIndex; - Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; -} - -uint8_t PathElement::GetQueueBannerDirection() const -{ - return ((Type & FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK) >> 6); -} - -void PathElement::SetQueueBannerDirection(uint8_t direction) -{ - Type &= ~FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK; - Type |= (direction << 6); -} - -bool PathElement::ShouldDrawPathOverSupports() const -{ - // TODO: make this an actual decision of the tile element. - return (GetRailingsDescriptor()->Flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); -} - -void PathElement::SetShouldDrawPathOverSupports(bool on) -{ - LOG_VERBOSE("Setting 'draw path over supports' to %d", static_cast(on)); -} - /** * * rct2: 0x006A8B12 diff --git a/src/openrct2/world/Footpath.h b/src/openrct2/world/Footpath.h index 9db7eedced..295869d7a2 100644 --- a/src/openrct2/world/Footpath.h +++ b/src/openrct2/world/Footpath.h @@ -71,41 +71,6 @@ struct FootpathSelection } }; -// Masks for values stored in TileElement.type -enum -{ - FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE = (1 << 0), - FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE = (1 << 1), - FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK = (1 << 6) | (1 << 7), -}; - -// Masks and flags for values stored in TileElement.properties.path.type -enum -{ - FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK = (1 << 0) | (1 << 1), - FOOTPATH_PROPERTIES_FLAG_IS_SLOPED = (1 << 2), - FOOTPATH_PROPERTIES_FLAG_HAS_QUEUE_BANNER = (1 << 3), - FOOTPATH_PROPERTIES_TYPE_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7), -}; - -// Masks and flags for values stored in TileElement.properties.path.edges -enum -{ - FOOTPATH_PROPERTIES_EDGES_EDGES_MASK = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3), - FOOTPATH_PROPERTIES_EDGES_CORNERS_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7), -}; - -enum -{ - FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED = 1 << 0, - FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER = (1 << 1), - FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST = (1 << 2), - FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE = (1 << 3), - FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN = (1 << 4), - FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY = (1 << 5), - FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS = (1 << 6), -}; - enum { RAILING_ENTRY_FLAG_HAS_SUPPORT_BASE_SPRITE = (1 << 0), diff --git a/src/openrct2/world/LargeScenery.h b/src/openrct2/world/LargeScenery.h deleted file mode 100644 index 904b625874..0000000000 --- a/src/openrct2/world/LargeScenery.h +++ /dev/null @@ -1,15 +0,0 @@ -/***************************************************************************** - * 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 - -enum -{ - LARGE_SCENERY_ELEMENT_FLAGS2_ACCOUNTED = 1 << 0, -}; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 209c025d32..5c033abfc1 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -54,12 +54,15 @@ #include "MapAnimation.h" #include "Park.h" #include "Scenery.h" -#include "Surface.h" #include "TileElementsView.h" #include "TileInspector.h" #include "tile_element/BannerElement.h" #include "tile_element/EntranceElement.h" +#include "tile_element/LargeSceneryElement.h" +#include "tile_element/PathElement.h" #include "tile_element/Slope.h" +#include "tile_element/SmallSceneryElement.h" +#include "tile_element/SurfaceElement.h" #include "tile_element/TrackElement.h" #include @@ -1037,7 +1040,7 @@ void TileElementRemove(TileElement* tileElement) // Mark the latest element with the last element flag. (tileElement - 1)->SetLastForTile(true); - tileElement->BaseHeight = MAX_ELEMENT_HEIGHT; + tileElement->BaseHeight = kMaxTileElementHeight; _tileElementsInUse--; auto& gameState = GetGameState(); if (tileElement == &gameState.TileElements.back()) @@ -1205,7 +1208,7 @@ TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants, { // Copy over map element *newTileElement = *originalTileElement; - originalTileElement->BaseHeight = MAX_ELEMENT_HEIGHT; + originalTileElement->BaseHeight = kMaxTileElementHeight; originalTileElement++; newTileElement++; @@ -1240,7 +1243,7 @@ TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants, { // Copy over map element *newTileElement = *originalTileElement; - originalTileElement->BaseHeight = MAX_ELEMENT_HEIGHT; + originalTileElement->BaseHeight = kMaxTileElementHeight; originalTileElement++; newTileElement++; } while (!((newTileElement - 1)->IsLastForTile())); diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 2e53f1f74a..49f7da9cad 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -9,10 +9,12 @@ #pragma once +#include "../Identifiers.h" #include "Location.hpp" -#include "TileElement.h" +#include #include +#include #include constexpr uint8_t kMinimumLandHeight = 2; @@ -45,6 +47,21 @@ constexpr uint32_t MAX_TILE_ELEMENTS_WITH_SPARE_ROOM = 0x1000000; constexpr uint32_t MAX_TILE_ELEMENTS = MAX_TILE_ELEMENTS_WITH_SPARE_ROOM - 512; using PeepSpawn = CoordsXYZD; +struct BannerElement; +struct EntranceElement; +struct LargeSceneryElement; +struct PathElement; +struct SmallSceneryElement; +struct SurfaceElement; +struct TileElement; +struct TrackElement; +struct WallElement; +enum class TileElementType : uint8_t; + +namespace OpenRCT2 +{ + enum class TrackElemType : uint16_t; +} struct CoordsXYE : public CoordsXY { diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index a5762ac0b4..58dee1417d 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -29,6 +29,10 @@ #include "Map.h" #include "Scenery.h" #include "tile_element/EntranceElement.h" +#include "tile_element/LargeSceneryElement.h" +#include "tile_element/PathElement.h" +#include "tile_element/SmallSceneryElement.h" +#include "tile_element/TileElement.h" #include "tile_element/TrackElement.h" #include "tile_element/WallElement.h" diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index fa61cecd59..25bb70d59c 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -26,10 +26,12 @@ #include "../platform/Platform.h" #include "../util/Util.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SmallSceneryElement.h" +#include "../world/tile_element/SurfaceElement.h" +#include "../world/tile_element/TileElement.h" #include "Map.h" #include "MapHelpers.h" #include "Scenery.h" -#include "Surface.h" #include #include diff --git a/src/openrct2/world/MapHelpers.cpp b/src/openrct2/world/MapHelpers.cpp index 6c26578d3d..d75cdf34f5 100644 --- a/src/openrct2/world/MapHelpers.cpp +++ b/src/openrct2/world/MapHelpers.cpp @@ -10,8 +10,8 @@ #include "MapHelpers.h" #include "../world/tile_element/Slope.h" +#include "../world/tile_element/SurfaceElement.h" #include "Map.h" -#include "Surface.h" #include diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index a4756a2018..4eef41a9ef 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -38,8 +38,8 @@ #include "../windows/Intent.h" #include "Entrance.h" #include "Map.h" -#include "Surface.h" #include "tile_element/EntranceElement.h" +#include "tile_element/SurfaceElement.h" #include #include diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index c2c5a424b6..d070fd4c79 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -36,6 +36,8 @@ #include "Footpath.h" #include "Map.h" #include "Park.h" +#include "tile_element/PathElement.h" +#include "tile_element/SmallSceneryElement.h" uint8_t gSceneryQuadrant; diff --git a/src/openrct2/world/SmallScenery.h b/src/openrct2/world/SmallScenery.h deleted file mode 100644 index dba542218f..0000000000 --- a/src/openrct2/world/SmallScenery.h +++ /dev/null @@ -1,15 +0,0 @@ -/***************************************************************************** - * 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 - -enum -{ - MAP_ELEM_SMALL_SCENERY_FLAGS2_NEEDS_SUPPORTS = (1 << 0), -}; diff --git a/src/openrct2/world/Surface.h b/src/openrct2/world/Surface.h deleted file mode 100644 index d2d48698da..0000000000 --- a/src/openrct2/world/Surface.h +++ /dev/null @@ -1,88 +0,0 @@ -/***************************************************************************** - * 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 -{ - TERRAIN_GRASS, - TERRAIN_SAND, - TERRAIN_DIRT, - TERRAIN_ROCK, - TERRAIN_MARTIAN, - TERRAIN_CHECKERBOARD, - TERRAIN_GRASS_CLUMPS, - TERRAIN_ICE, - TERRAIN_GRID_RED, - TERRAIN_GRID_YELLOW, - TERRAIN_GRID_BLUE, - TERRAIN_GRID_GREEN, - TERRAIN_SAND_DARK, - TERRAIN_SAND_LIGHT, - - TERRAIN_RCT2_COUNT, - - TERRAIN_ROOF_BROWN = TERRAIN_RCT2_COUNT, - TERRAIN_ROOF_GREY, - TERRAIN_ROOF_IRON, - TERRAIN_ROOF_LOG, - TERRAIN_COUNT_REGULAR, // The amount of surface types the user can actually select - what follows are technical types - // Technical types (not selectable) - TERRAIN_CHECKERBOARD_INVERTED = TERRAIN_COUNT_REGULAR, - TERRAIN_UNDERGROUND_VIEW, -}; - -enum -{ - TERRAIN_EDGE_ROCK, - TERRAIN_EDGE_WOOD_RED, - TERRAIN_EDGE_WOOD_BLACK, - TERRAIN_EDGE_ICE, - - TERRAIN_EDGE_RCT2_COUNT, - - TERRAIN_EDGE_BRICK = TERRAIN_EDGE_RCT2_COUNT, - TERRAIN_EDGE_IRON, - TERRAIN_EDGE_GREY, - TERRAIN_EDGE_YELLOW, - TERRAIN_EDGE_RED, - TERRAIN_EDGE_PURPLE, - TERRAIN_EDGE_GREEN, - TERRAIN_EDGE_STONE_BROWN, - TERRAIN_EDGE_STONE_GREY, - TERRAIN_EDGE_SKYSCRAPER_A, - TERRAIN_EDGE_SKYSCRAPER_B, - - TERRAIN_EDGE_COUNT -}; - -enum -{ - GRASS_LENGTH_MOWED, - GRASS_LENGTH_CLEAR_0, - GRASS_LENGTH_CLEAR_1, - GRASS_LENGTH_CLEAR_2, - GRASS_LENGTH_CLUMPS_0, - GRASS_LENGTH_CLUMPS_1, - GRASS_LENGTH_CLUMPS_2 -}; - -enum -{ - OWNERSHIP_UNOWNED = 0, - OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED = (1 << 4), - OWNERSHIP_OWNED = (1 << 5), - OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE = (1 << 6), - OWNERSHIP_AVAILABLE = (1 << 7) -}; - -constexpr uint8_t kTileElementSurfaceOwnershipMask = 0xF0; -constexpr uint8_t kTileElementSurfaceParkFenceMask = 0x0F; diff --git a/src/openrct2/world/SurfaceData.cpp b/src/openrct2/world/SurfaceData.cpp index 1417e4f8b2..85394bd05f 100644 --- a/src/openrct2/world/SurfaceData.cpp +++ b/src/openrct2/world/SurfaceData.cpp @@ -1,6 +1,14 @@ +/***************************************************************************** + * 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 "SurfaceData.h" -#include "Surface.h" #include "tile_element/Slope.h" // 0x00981A1E diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h deleted file mode 100644 index ea7c779642..0000000000 --- a/src/openrct2/world/TileElement.h +++ /dev/null @@ -1,398 +0,0 @@ -/***************************************************************************** - * 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 "../Identifiers.h" -#include "../ride/RideTypes.h" -#include "../ride/Station.h" -#include "Footpath.h" -#include "tile_element/TileElementType.h" - -struct Banner; -struct CoordsXY; -struct LargeSceneryEntry; -struct SmallSceneryEntry; -struct WallSceneryEntry; -struct PathAdditionEntry; -struct FootpathEntry; -class LargeSceneryObject; -class TerrainSurfaceObject; -class TerrainEdgeObject; -class FootpathObject; -class FootpathSurfaceObject; -class FootpathRailingsObject; -enum class RideColourScheme : uint8_t; -namespace OpenRCT2 -{ - enum class TrackElemType : uint16_t; -} - -constexpr uint8_t MAX_ELEMENT_HEIGHT = 255; -constexpr uint8_t OWNER_MASK = 0b00001111; -constexpr uint8_t kTileElementSize = 16; - -#pragma pack(push, 1) - -struct TileElement; -struct SurfaceElement; -struct PathElement; -struct TrackElement; -struct SmallSceneryElement; -struct LargeSceneryElement; -struct WallElement; -struct EntranceElement; -struct BannerElement; - -struct TileElementBase -{ - uint8_t Type; // 0 - uint8_t Flags; // 1. Upper nibble: flags. Lower nibble: occupied quadrants (one bit per quadrant). - uint8_t BaseHeight; // 2 - uint8_t ClearanceHeight; // 3 - uint8_t Owner; // 4 - - void Remove(); - - TileElementType GetType() const; - void SetType(TileElementType newType); - - Direction GetDirection() const; - void SetDirection(Direction direction); - Direction GetDirectionWithOffset(uint8_t offset) const; - - bool IsLastForTile() const; - void SetLastForTile(bool on); - bool IsGhost() const; - void SetGhost(bool isGhost); - bool IsInvisible() const; - void SetInvisible(bool on); - - uint8_t GetOccupiedQuadrants() const; - void SetOccupiedQuadrants(uint8_t quadrants); - - int32_t GetBaseZ() const; - void SetBaseZ(int32_t newZ); - - int32_t GetClearanceZ() const; - void SetClearanceZ(int32_t newZ); - - uint8_t GetOwner() const; - void SetOwner(uint8_t newOwner); - - template const TType* as() const - { - if constexpr (std::is_same_v) - return reinterpret_cast(this); - else - return GetType() == TType::ElementType ? reinterpret_cast(this) : nullptr; - } - - template TType* as() - { - if constexpr (std::is_same_v) - return reinterpret_cast(this); - else - return GetType() == TType::ElementType ? reinterpret_cast(this) : nullptr; - } - - const SurfaceElement* AsSurface() const; - SurfaceElement* AsSurface(); - const PathElement* AsPath() const; - PathElement* AsPath(); - const TrackElement* AsTrack() const; - TrackElement* AsTrack(); - const SmallSceneryElement* AsSmallScenery() const; - SmallSceneryElement* AsSmallScenery(); - const LargeSceneryElement* AsLargeScenery() const; - LargeSceneryElement* AsLargeScenery(); - const WallElement* AsWall() const; - WallElement* AsWall(); - const EntranceElement* AsEntrance() const; - EntranceElement* AsEntrance(); - const BannerElement* AsBanner() const; - BannerElement* AsBanner(); -}; - -/** - * Map element structure - * size: 0x10 - */ -struct TileElement : public TileElementBase -{ - uint8_t Pad05[3]; - uint8_t Pad08[8]; - - void ClearAs(TileElementType newType); - - RideId GetRideIndex() const; - - void SetBannerIndex(BannerIndex newIndex); - void RemoveBannerEntry(); - BannerIndex GetBannerIndex() const; -}; -static_assert(sizeof(TileElement) == 16); - -struct SurfaceElement : TileElementBase -{ - static constexpr TileElementType ElementType = TileElementType::Surface; - -private: - uint8_t Slope; - uint8_t WaterHeight; - uint8_t GrassLength; - uint8_t Ownership; - uint8_t SurfaceStyle; - uint8_t EdgeObjectIndex; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" - uint8_t Pad0B[5]; -#pragma clang diagnostic pop - -public: - uint8_t GetSlope() const; - void SetSlope(uint8_t newSlope); - - ObjectEntryIndex GetSurfaceObjectIndex() const; - TerrainSurfaceObject* GetSurfaceObject() const; - void SetSurfaceObjectIndex(ObjectEntryIndex newStyle); - - ObjectEntryIndex GetEdgeObjectIndex() const; - TerrainEdgeObject* GetEdgeObject() const; - void SetEdgeObjectIndex(ObjectEntryIndex newStyle); - - bool CanGrassGrow() const; - uint8_t GetGrassLength() const; - void SetGrassLength(uint8_t newLength); - void SetGrassLengthAndInvalidate(uint8_t newLength, const CoordsXY& coords); - void UpdateGrassLength(const CoordsXY& coords); - - uint8_t GetOwnership() const; - void SetOwnership(uint8_t newOwnership); - - int32_t GetWaterHeight() const; - void SetWaterHeight(int32_t newWaterHeight); - - uint8_t GetParkFences() const; - void SetParkFences(uint8_t newParkFences); - - bool HasTrackThatNeedsWater() const; - void SetHasTrackThatNeedsWater(bool on); -}; -static_assert(sizeof(SurfaceElement) == 16); - -struct PathElement : TileElementBase -{ - static constexpr TileElementType ElementType = TileElementType::Path; - -private: - ObjectEntryIndex SurfaceIndex; // 5 - ObjectEntryIndex RailingsIndex; // 7 - uint8_t Additions; // 9 (0 means no addition) - uint8_t EdgesAndCorners; // 10 (edges in lower 4 bits, corners in upper 4) - uint8_t Flags2; // 11 - uint8_t SlopeDirection; // 12 - union - { - uint8_t AdditionStatus; // 13, only used for litter bins - RideId rideIndex; // 13 - }; - ::StationIndex StationIndex; // 15 - -public: - ObjectEntryIndex GetLegacyPathEntryIndex() const; - const FootpathObject* GetLegacyPathEntry() const; - void SetLegacyPathEntryIndex(ObjectEntryIndex newIndex); - bool HasLegacyPathEntry() const; - - ObjectEntryIndex GetSurfaceEntryIndex() const; - const FootpathSurfaceObject* GetSurfaceEntry() const; - void SetSurfaceEntryIndex(ObjectEntryIndex newIndex); - - ObjectEntryIndex GetRailingsEntryIndex() const; - const FootpathRailingsObject* GetRailingsEntry() const; - void SetRailingsEntryIndex(ObjectEntryIndex newIndex); - - const PathSurfaceDescriptor* GetSurfaceDescriptor() const; - const PathRailingsDescriptor* GetRailingsDescriptor() const; - - uint8_t GetQueueBannerDirection() const; - void SetQueueBannerDirection(uint8_t direction); - - bool IsSloped() const; - void SetSloped(bool isSloped); - - bool HasJunctionRailings() const; - void SetJunctionRailings(bool hasJunctionRailings); - - Direction GetSlopeDirection() const; - void SetSlopeDirection(Direction newSlope); - - RideId GetRideIndex() const; - void SetRideIndex(RideId newRideIndex); - - ::StationIndex GetStationIndex() const; - void SetStationIndex(::StationIndex newStationIndex); - - bool IsWide() const; - void SetWide(bool isWide); - - bool IsQueue() const; - void SetIsQueue(bool isQueue); - bool HasQueueBanner() const; - void SetHasQueueBanner(bool hasQueueBanner); - - bool IsBroken() const; - void SetIsBroken(bool isBroken); - - bool IsBlockedByVehicle() const; - void SetIsBlockedByVehicle(bool isBlocked); - - uint8_t GetEdges() const; - void SetEdges(uint8_t newEdges); - uint8_t GetCorners() const; - void SetCorners(uint8_t newCorners); - uint8_t GetEdgesAndCorners() const; - void SetEdgesAndCorners(uint8_t newEdgesAndCorners); - - bool HasAddition() const; - uint8_t GetAddition() const; - ObjectEntryIndex GetAdditionEntryIndex() const; - const PathAdditionEntry* GetAdditionEntry() const; - void SetAddition(uint8_t newAddition); - void SetAdditionEntryIndex(ObjectEntryIndex entryIndex); - - bool AdditionIsGhost() const; - void SetAdditionIsGhost(bool isGhost); - - uint8_t GetAdditionStatus() const; - void SetAdditionStatus(uint8_t newStatus); - - bool ShouldDrawPathOverSupports() const; - void SetShouldDrawPathOverSupports(bool on); - - bool IsLevelCrossing(const CoordsXY& coords) const; -}; -static_assert(sizeof(PathElement) == 16); - -struct SmallSceneryElement : TileElementBase -{ - static constexpr TileElementType ElementType = TileElementType::SmallScenery; - -private: - ObjectEntryIndex entryIndex; // 5 - uint8_t age; // 7 - uint8_t Colour[3]; // 8 - uint8_t Flags2; // B -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" - uint8_t Pad0B[4]; -#pragma clang diagnostic pop - -public: - ObjectEntryIndex GetEntryIndex() const; - void SetEntryIndex(ObjectEntryIndex newIndex); - const SmallSceneryEntry* GetEntry() const; - uint8_t GetAge() const; - void SetAge(uint8_t newAge); - void IncreaseAge(const CoordsXY& sceneryPos); - uint8_t GetSceneryQuadrant() const; - void SetSceneryQuadrant(uint8_t newQuadrant); - colour_t GetPrimaryColour() const; - void SetPrimaryColour(colour_t colour); - colour_t GetSecondaryColour() const; - void SetSecondaryColour(colour_t colour); - colour_t GetTertiaryColour() const; - void SetTertiaryColour(colour_t colour); - bool NeedsSupports() const; - void SetNeedsSupports(); - void UpdateAge(const CoordsXY& sceneryPos); -}; -static_assert(sizeof(SmallSceneryElement) == 16); - -struct LargeSceneryElement : TileElementBase -{ - static constexpr TileElementType ElementType = TileElementType::LargeScenery; - -private: - ObjectEntryIndex EntryIndex; - ::BannerIndex BannerIndex; - uint8_t SequenceIndex; - uint8_t Colour[3]; - uint8_t Flags2; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-private-field" - uint8_t pad[2]; -#pragma clang diagnostic pop - -public: - ObjectEntryIndex GetEntryIndex() const; - void SetEntryIndex(ObjectEntryIndex newIndex); - const LargeSceneryEntry* GetEntry() const; - const LargeSceneryObject* GetObject() const; - - uint8_t GetSequenceIndex() const; - void SetSequenceIndex(uint8_t newIndex); - - colour_t GetPrimaryColour() const; - void SetPrimaryColour(colour_t colour); - colour_t GetSecondaryColour() const; - void SetSecondaryColour(colour_t colour); - colour_t GetTertiaryColour() const; - void SetTertiaryColour(colour_t colour); - - Banner* GetBanner() const; - ::BannerIndex GetBannerIndex() const; - void SetBannerIndex(::BannerIndex newIndex); - - bool IsAccounted() const; - void SetIsAccounted(bool isAccounted); -}; -static_assert(sizeof(LargeSceneryElement) == 16); - -#pragma pack(pop) - -enum -{ - SURFACE_ELEMENT_HAS_TRACK_THAT_NEEDS_WATER = (1 << 6), -}; - -enum -{ - TILE_ELEMENT_DIRECTION_WEST, - TILE_ELEMENT_DIRECTION_NORTH, - TILE_ELEMENT_DIRECTION_EAST, - TILE_ELEMENT_DIRECTION_SOUTH -}; - -enum -{ - TILE_ELEMENT_FLAG_GHOST = (1 << 4), - TILE_ELEMENT_FLAG_INVISIBLE = (1 << 5), - TILE_ELEMENT_FLAG_LAST_TILE = (1 << 7) -}; - -enum -{ - ELEMENT_IS_ABOVE_GROUND = 1 << 0, - ELEMENT_IS_UNDERGROUND = 1 << 1, - ELEMENT_IS_UNDERWATER = 1 << 2, -}; - -enum -{ - MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT = (1 << 7), -}; - -constexpr uint8_t kTileElementQuadrantMask = 0b11000000; -constexpr uint8_t kTileElementTypeMask = 0b00111100; -constexpr uint8_t kTileElementDirectionMask = 0b00000011; -constexpr uint8_t kTileElementOccupiedQuadrantsMask = 0b00001111; - -bool TileElementIsUnderground(TileElement* tileElement); diff --git a/src/openrct2/world/TileElementsView.h b/src/openrct2/world/TileElementsView.h index a8bef7a87a..edf1057e6c 100644 --- a/src/openrct2/world/TileElementsView.h +++ b/src/openrct2/world/TileElementsView.h @@ -11,7 +11,6 @@ #include "Location.hpp" #include "Map.h" -#include "TileElement.h" #include diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 996461a6b4..97351eec7c 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -24,10 +24,13 @@ #include "MapAnimation.h" #include "Park.h" #include "Scenery.h" -#include "Surface.h" #include "tile_element/BannerElement.h" #include "tile_element/EntranceElement.h" +#include "tile_element/LargeSceneryElement.h" +#include "tile_element/PathElement.h" #include "tile_element/Slope.h" +#include "tile_element/SmallSceneryElement.h" +#include "tile_element/SurfaceElement.h" #include "tile_element/TrackElement.h" #include "tile_element/WallElement.h" @@ -429,7 +432,7 @@ namespace OpenRCT2::TileInspector { return GameActions::Result(GameActions::Status::TooLow, STR_CANT_LOWER_ELEMENT_HERE, STR_TOO_LOW); } - if (newBaseHeight > MAX_ELEMENT_HEIGHT) + if (newBaseHeight > kMaxTileElementHeight) { return GameActions::Result(GameActions::Status::TooHigh, STR_CANT_RAISE_ELEMENT_HERE, STR_TOO_HIGH); } @@ -437,7 +440,7 @@ namespace OpenRCT2::TileInspector { return GameActions::Result(GameActions::Status::NoClearance, STR_CANT_LOWER_ELEMENT_HERE, STR_NO_CLEARANCE); } - if (newClearanceHeight > MAX_ELEMENT_HEIGHT) + if (newClearanceHeight > kMaxTileElementHeight) { return GameActions::Result(GameActions::Status::NoClearance, STR_CANT_RAISE_ELEMENT_HERE, STR_NO_CLEARANCE); } diff --git a/src/openrct2/world/TileInspector.h b/src/openrct2/world/TileInspector.h index 777f03899a..d280ccb714 100644 --- a/src/openrct2/world/TileInspector.h +++ b/src/openrct2/world/TileInspector.h @@ -11,6 +11,8 @@ #include "Map.h" +struct Banner; + namespace OpenRCT2::GameActions { class Result; diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index 22e34cbcfe..484518bfe5 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -10,6 +10,7 @@ #include "Wall.h" #include "Map.h" +#include "tile_element/TileElement.h" #include "tile_element/WallElement.h" /** diff --git a/src/openrct2/world/tile_element/BannerElement.h b/src/openrct2/world/tile_element/BannerElement.h index a0bfe2d01b..929c46da70 100644 --- a/src/openrct2/world/tile_element/BannerElement.h +++ b/src/openrct2/world/tile_element/BannerElement.h @@ -9,7 +9,8 @@ #pragma once -#include "../TileElement.h" +#include "../Banner.h" +#include "TileElementBase.h" struct BannerSceneryEntry; diff --git a/src/openrct2/world/tile_element/EntranceElement.h b/src/openrct2/world/tile_element/EntranceElement.h index abeb9f43bd..c57c97722b 100644 --- a/src/openrct2/world/tile_element/EntranceElement.h +++ b/src/openrct2/world/tile_element/EntranceElement.h @@ -10,7 +10,11 @@ #pragma once #include "../../Identifiers.h" -#include "../TileElement.h" +#include "../../object/FootpathObject.h" +#include "../../object/FootpathRailingsObject.h" +#include "../../object/FootpathSurfaceObject.h" +#include "../../object/ObjectTypes.h" +#include "TileElementBase.h" #include @@ -21,6 +25,18 @@ enum ENTRANCE_TYPE_PARK_ENTRANCE }; +enum +{ + ENTRANCE_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY = (1 << 0), +}; + +namespace OpenRCT2::EntranceSequence +{ + constexpr uint8_t Centre = 0; + constexpr uint8_t Left = 1; + constexpr uint8_t Right = 2; +}; // namespace OpenRCT2::EntranceSequence + #pragma pack(push, 1) struct EntranceElement; diff --git a/src/openrct2/world/LargeScenery.cpp b/src/openrct2/world/tile_element/LargeSceneryElement.cpp similarity index 91% rename from src/openrct2/world/LargeScenery.cpp rename to src/openrct2/world/tile_element/LargeSceneryElement.cpp index f53c595fd7..2292c4ec98 100644 --- a/src/openrct2/world/LargeScenery.cpp +++ b/src/openrct2/world/tile_element/LargeSceneryElement.cpp @@ -7,14 +7,12 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#include "LargeScenery.h" +#include "LargeSceneryElement.h" -#include "../Context.h" -#include "../object/LargeSceneryObject.h" -#include "../object/ObjectEntryManager.h" -#include "../object/ObjectManager.h" -#include "../world/Banner.h" -#include "TileElement.h" +#include "../../object/LargeSceneryObject.h" +#include "../../object/ObjectEntryManager.h" +#include "../../object/ObjectManager.h" +#include "../Banner.h" #include diff --git a/src/openrct2/world/tile_element/LargeSceneryElement.h b/src/openrct2/world/tile_element/LargeSceneryElement.h new file mode 100644 index 0000000000..437e207337 --- /dev/null +++ b/src/openrct2/world/tile_element/LargeSceneryElement.h @@ -0,0 +1,64 @@ +/***************************************************************************** + * 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 "../../Identifiers.h" +#include "../../object/LargeSceneryEntry.h" +#include "../../object/LargeSceneryObject.h" +#include "TileElementBase.h" + +struct Banner; + +enum +{ + LARGE_SCENERY_ELEMENT_FLAGS2_ACCOUNTED = 1 << 0, +}; + +#pragma pack(push, 1) +struct LargeSceneryElement : TileElementBase +{ + static constexpr TileElementType ElementType = TileElementType::LargeScenery; + +private: + ObjectEntryIndex EntryIndex; + ::BannerIndex BannerIndex; + uint8_t SequenceIndex; + uint8_t Colour[3]; + uint8_t Flags2; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-private-field" + uint8_t pad[2]; +#pragma clang diagnostic pop + +public: + ObjectEntryIndex GetEntryIndex() const; + void SetEntryIndex(ObjectEntryIndex newIndex); + const LargeSceneryEntry* GetEntry() const; + const LargeSceneryObject* GetObject() const; + + uint8_t GetSequenceIndex() const; + void SetSequenceIndex(uint8_t newIndex); + + colour_t GetPrimaryColour() const; + void SetPrimaryColour(colour_t colour); + colour_t GetSecondaryColour() const; + void SetSecondaryColour(colour_t colour); + colour_t GetTertiaryColour() const; + void SetTertiaryColour(colour_t colour); + + Banner* GetBanner() const; + ::BannerIndex GetBannerIndex() const; + void SetBannerIndex(::BannerIndex newIndex); + + bool IsAccounted() const; + void SetIsAccounted(bool isAccounted); +}; +static_assert(sizeof(LargeSceneryElement) == kTileElementSize); +#pragma pack(pop) diff --git a/src/openrct2/world/tile_element/PathElement.cpp b/src/openrct2/world/tile_element/PathElement.cpp new file mode 100644 index 0000000000..36ba91b305 --- /dev/null +++ b/src/openrct2/world/tile_element/PathElement.cpp @@ -0,0 +1,306 @@ +/***************************************************************************** + * 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 "PathElement.h" + +#include "../../Context.h" +#include "../../Diagnostic.h" +#include "../../object/FootpathObject.h" +#include "../../object/FootpathRailingsObject.h" +#include "../../object/FootpathSurfaceObject.h" +#include "../../object/ObjectEntryManager.h" +#include "../../object/ObjectManager.h" +#include "../../object/PathAdditionEntry.h" +#include "../Footpath.h" + +bool PathElement::IsSloped() const +{ + return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED) != 0; +} + +void PathElement::SetSloped(bool isSloped) +{ + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED; + if (isSloped) + Flags2 |= FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED; +} + +bool PathElement::HasJunctionRailings() const +{ + return Flags2 & FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS; +} + +void PathElement::SetJunctionRailings(bool hasJunctionRailings) +{ + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS; + if (hasJunctionRailings) + Flags2 |= FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS; +} + +Direction PathElement::GetSlopeDirection() const +{ + return SlopeDirection; +} + +void PathElement::SetSlopeDirection(Direction newSlope) +{ + SlopeDirection = newSlope; +} + +bool PathElement::IsQueue() const +{ + return (Type & FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE) != 0; +} + +void PathElement::SetIsQueue(bool isQueue) +{ + Type &= ~FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE; + if (isQueue) + Type |= FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE; +} + +bool PathElement::HasQueueBanner() const +{ + return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER) != 0; +} + +void PathElement::SetHasQueueBanner(bool hasQueueBanner) +{ + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER; + if (hasQueueBanner) + Flags2 |= FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER; +} + +bool PathElement::IsBroken() const +{ + return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN) != 0; +} + +void PathElement::SetIsBroken(bool isBroken) +{ + if (isBroken) + { + Flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN; + } + else + { + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN; + } +} + +bool PathElement::IsBlockedByVehicle() const +{ + return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE) != 0; +} + +void PathElement::SetIsBlockedByVehicle(bool isBlocked) +{ + if (isBlocked) + { + Flags2 |= FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE; + } + else + { + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE; + } +} + +::StationIndex PathElement::GetStationIndex() const +{ + return StationIndex; +} + +void PathElement::SetStationIndex(::StationIndex newStationIndex) +{ + StationIndex = newStationIndex; +} + +bool PathElement::IsWide() const +{ + return (Type & FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE) != 0; +} + +void PathElement::SetWide(bool isWide) +{ + Type &= ~FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE; + if (isWide) + Type |= FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE; +} + +bool PathElement::HasAddition() const +{ + return Additions != 0; +} + +uint8_t PathElement::GetAddition() const +{ + return Additions; +} + +ObjectEntryIndex PathElement::GetAdditionEntryIndex() const +{ + // `Additions` is set to 0 when there is no addition, so the value 1 corresponds with path addition slot 0, etc. + return GetAddition() - 1; +} + +const PathAdditionEntry* PathElement::GetAdditionEntry() const +{ + if (!HasAddition()) + return nullptr; + return OpenRCT2::ObjectManager::GetObjectEntry(GetAdditionEntryIndex()); +} + +void PathElement::SetAddition(uint8_t newAddition) +{ + Additions = newAddition; +} + +void PathElement::SetAdditionEntryIndex(ObjectEntryIndex entryIndex) +{ + // `Additions` is set to 0 when there is no addition, so the value 1 corresponds with path addition slot 0, etc. + Additions = entryIndex + 1; +} + +bool PathElement::AdditionIsGhost() const +{ + return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST) != 0; +} + +void PathElement::SetAdditionIsGhost(bool isGhost) +{ + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST; + if (isGhost) + Flags2 |= FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST; +} + +ObjectEntryIndex PathElement::GetLegacyPathEntryIndex() const +{ + if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) + return SurfaceIndex; + + return OBJECT_ENTRY_INDEX_NULL; +} + +const FootpathObject* PathElement::GetLegacyPathEntry() const +{ + return GetLegacyFootpathEntry(GetLegacyPathEntryIndex()); +} + +void PathElement::SetLegacyPathEntryIndex(ObjectEntryIndex newIndex) +{ + SurfaceIndex = newIndex; + RailingsIndex = OBJECT_ENTRY_INDEX_NULL; + Flags2 |= FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; +} + +bool PathElement::HasLegacyPathEntry() const +{ + return (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) != 0; +} + +const PathSurfaceDescriptor* PathElement::GetSurfaceDescriptor() const +{ + if (HasLegacyPathEntry()) + { + const auto* legacyPathEntry = GetLegacyPathEntry(); + if (legacyPathEntry == nullptr) + return nullptr; + + if (IsQueue()) + return &legacyPathEntry->GetQueueSurfaceDescriptor(); + + return &legacyPathEntry->GetPathSurfaceDescriptor(); + } + + const auto* surfaceEntry = GetSurfaceEntry(); + if (surfaceEntry == nullptr) + return nullptr; + + return &surfaceEntry->GetDescriptor(); +} + +const PathRailingsDescriptor* PathElement::GetRailingsDescriptor() const +{ + if (HasLegacyPathEntry()) + { + const auto* legacyPathEntry = GetLegacyPathEntry(); + if (legacyPathEntry == nullptr) + return nullptr; + + return &legacyPathEntry->GetPathRailingsDescriptor(); + } + + const auto* railingsEntry = GetRailingsEntry(); + if (railingsEntry == nullptr) + return nullptr; + + return &railingsEntry->GetDescriptor(); +} + +ObjectEntryIndex PathElement::GetSurfaceEntryIndex() const +{ + if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) + return OBJECT_ENTRY_INDEX_NULL; + + return SurfaceIndex; +} + +const FootpathSurfaceObject* PathElement::GetSurfaceEntry() const +{ + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + return static_cast(objMgr.GetLoadedObject(ObjectType::FootpathSurface, GetSurfaceEntryIndex())); +} + +void PathElement::SetSurfaceEntryIndex(ObjectEntryIndex newIndex) +{ + SurfaceIndex = newIndex; + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; +} + +ObjectEntryIndex PathElement::GetRailingsEntryIndex() const +{ + if (Flags2 & FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY) + return OBJECT_ENTRY_INDEX_NULL; + + return RailingsIndex; +} + +const FootpathRailingsObject* PathElement::GetRailingsEntry() const +{ + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + return static_cast(objMgr.GetLoadedObject(ObjectType::FootpathRailings, GetRailingsEntryIndex())); +} + +void PathElement::SetRailingsEntryIndex(ObjectEntryIndex newEntryIndex) +{ + RailingsIndex = newEntryIndex; + Flags2 &= ~FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY; +} + +uint8_t PathElement::GetQueueBannerDirection() const +{ + return ((Type & FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK) >> 6); +} + +void PathElement::SetQueueBannerDirection(uint8_t direction) +{ + Type &= ~FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK; + Type |= (direction << 6); +} + +bool PathElement::ShouldDrawPathOverSupports() const +{ + // TODO: make this an actual decision of the tile element. + return (GetRailingsDescriptor()->Flags & RAILING_ENTRY_FLAG_DRAW_PATH_OVER_SUPPORTS); +} + +void PathElement::SetShouldDrawPathOverSupports(bool on) +{ + LOG_VERBOSE("Setting 'draw path over supports' to %d", static_cast(on)); +} diff --git a/src/openrct2/world/tile_element/PathElement.h b/src/openrct2/world/tile_element/PathElement.h new file mode 100644 index 0000000000..bb3c759f13 --- /dev/null +++ b/src/openrct2/world/tile_element/PathElement.h @@ -0,0 +1,153 @@ +/***************************************************************************** + * 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 "../../Identifiers.h" +#include "TileElementBase.h" + +class FootpathObject; +class FootpathRailingsObject; +class FootpathSurfaceObject; +struct PathAdditionEntry; +struct PathRailingsDescriptor; +struct PathSurfaceDescriptor; + +using ObjectEntryIndex = uint16_t; + +// Masks for values stored in TileElement.type +enum +{ + FOOTPATH_ELEMENT_TYPE_FLAG_IS_QUEUE = (1 << 0), + FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE = (1 << 1), + FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK = (1 << 6) | (1 << 7), +}; + +// Masks and flags for values stored in TileElement.properties.path.type +enum +{ + FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK = (1 << 0) | (1 << 1), + FOOTPATH_PROPERTIES_FLAG_IS_SLOPED = (1 << 2), + FOOTPATH_PROPERTIES_FLAG_HAS_QUEUE_BANNER = (1 << 3), + FOOTPATH_PROPERTIES_TYPE_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7), +}; + +// Masks and flags for values stored in TileElement.properties.path.edges +enum +{ + FOOTPATH_PROPERTIES_EDGES_EDGES_MASK = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3), + FOOTPATH_PROPERTIES_EDGES_CORNERS_MASK = (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7), +}; + +enum +{ + FOOTPATH_ELEMENT_FLAGS2_IS_SLOPED = 1 << 0, + FOOTPATH_ELEMENT_FLAGS2_HAS_QUEUE_BANNER = (1 << 1), + FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_GHOST = (1 << 2), + FOOTPATH_ELEMENT_FLAGS2_BLOCKED_BY_VEHICLE = (1 << 3), + FOOTPATH_ELEMENT_FLAGS2_ADDITION_IS_BROKEN = (1 << 4), + FOOTPATH_ELEMENT_FLAGS2_LEGACY_PATH_ENTRY = (1 << 5), + FOOTPATH_ELEMENT_FLAGS2_HAS_JUNCTION_RAILINGS = (1 << 6), +}; + +#pragma pack(push, 1) +struct PathElement : TileElementBase +{ + static constexpr TileElementType ElementType = TileElementType::Path; + +private: + ObjectEntryIndex SurfaceIndex; // 5 + ObjectEntryIndex RailingsIndex; // 7 + uint8_t Additions; // 9 (0 means no addition) + uint8_t EdgesAndCorners; // 10 (edges in lower 4 bits, corners in upper 4) + uint8_t Flags2; // 11 + uint8_t SlopeDirection; // 12 + union + { + uint8_t AdditionStatus; // 13, only used for litter bins + RideId rideIndex; // 13 + }; + ::StationIndex StationIndex; // 15 + +public: + ObjectEntryIndex GetLegacyPathEntryIndex() const; + const FootpathObject* GetLegacyPathEntry() const; + void SetLegacyPathEntryIndex(ObjectEntryIndex newIndex); + bool HasLegacyPathEntry() const; + + ObjectEntryIndex GetSurfaceEntryIndex() const; + const FootpathSurfaceObject* GetSurfaceEntry() const; + void SetSurfaceEntryIndex(ObjectEntryIndex newIndex); + + ObjectEntryIndex GetRailingsEntryIndex() const; + const FootpathRailingsObject* GetRailingsEntry() const; + void SetRailingsEntryIndex(ObjectEntryIndex newIndex); + + const PathSurfaceDescriptor* GetSurfaceDescriptor() const; + const PathRailingsDescriptor* GetRailingsDescriptor() const; + + uint8_t GetQueueBannerDirection() const; + void SetQueueBannerDirection(uint8_t direction); + + bool IsSloped() const; + void SetSloped(bool isSloped); + + bool HasJunctionRailings() const; + void SetJunctionRailings(bool hasJunctionRailings); + + Direction GetSlopeDirection() const; + void SetSlopeDirection(Direction newSlope); + + RideId GetRideIndex() const; + void SetRideIndex(RideId newRideIndex); + + ::StationIndex GetStationIndex() const; + void SetStationIndex(::StationIndex newStationIndex); + + bool IsWide() const; + void SetWide(bool isWide); + + bool IsQueue() const; + void SetIsQueue(bool isQueue); + bool HasQueueBanner() const; + void SetHasQueueBanner(bool hasQueueBanner); + + bool IsBroken() const; + void SetIsBroken(bool isBroken); + + bool IsBlockedByVehicle() const; + void SetIsBlockedByVehicle(bool isBlocked); + + uint8_t GetEdges() const; + void SetEdges(uint8_t newEdges); + uint8_t GetCorners() const; + void SetCorners(uint8_t newCorners); + uint8_t GetEdgesAndCorners() const; + void SetEdgesAndCorners(uint8_t newEdgesAndCorners); + + bool HasAddition() const; + uint8_t GetAddition() const; + ObjectEntryIndex GetAdditionEntryIndex() const; + const PathAdditionEntry* GetAdditionEntry() const; + void SetAddition(uint8_t newAddition); + void SetAdditionEntryIndex(ObjectEntryIndex entryIndex); + + bool AdditionIsGhost() const; + void SetAdditionIsGhost(bool isGhost); + + uint8_t GetAdditionStatus() const; + void SetAdditionStatus(uint8_t newStatus); + + bool ShouldDrawPathOverSupports() const; + void SetShouldDrawPathOverSupports(bool on); + + bool IsLevelCrossing(const CoordsXY& coords) const; +}; +static_assert(sizeof(PathElement) == kTileElementSize); +#pragma pack(pop) diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/tile_element/SmallSceneryElement.cpp similarity index 84% rename from src/openrct2/world/SmallScenery.cpp rename to src/openrct2/world/tile_element/SmallSceneryElement.cpp index ffef941662..4109953518 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/tile_element/SmallSceneryElement.cpp @@ -7,24 +7,23 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#include "SmallScenery.h" +#include "SmallSceneryElement.h" -#include "../Cheats.h" -#include "../Context.h" -#include "../Game.h" -#include "../OpenRCT2.h" -#include "../management/Finance.h" -#include "../network/network.h" -#include "../object/ObjectEntryManager.h" -#include "../object/ObjectManager.h" -#include "../object/SmallSceneryEntry.h" -#include "../ride/TrackDesign.h" -#include "Footpath.h" -#include "Map.h" -#include "MapAnimation.h" -#include "Park.h" -#include "Scenery.h" -#include "Surface.h" +#include "../../Cheats.h" +#include "../../Context.h" +#include "../../Game.h" +#include "../../OpenRCT2.h" +#include "../../management/Finance.h" +#include "../../network/network.h" +#include "../../object/ObjectEntryManager.h" +#include "../../object/ObjectManager.h" +#include "../../object/SmallSceneryEntry.h" +#include "../../ride/TrackDesign.h" +#include "../Footpath.h" +#include "../Map.h" +#include "../MapAnimation.h" +#include "../Park.h" +#include "../Scenery.h" #include diff --git a/src/openrct2/world/tile_element/SmallSceneryElement.h b/src/openrct2/world/tile_element/SmallSceneryElement.h new file mode 100644 index 0000000000..a025314025 --- /dev/null +++ b/src/openrct2/world/tile_element/SmallSceneryElement.h @@ -0,0 +1,57 @@ +/***************************************************************************** + * 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 "../../interface/Colour.h" +#include "../../object/ObjectTypes.h" +#include "../../object/SmallSceneryEntry.h" +#include "TileElementBase.h" + +enum +{ + MAP_ELEM_SMALL_SCENERY_FLAGS2_NEEDS_SUPPORTS = (1 << 0), +}; + +#pragma pack(push, 1) +struct SmallSceneryElement : TileElementBase +{ + static constexpr TileElementType ElementType = TileElementType::SmallScenery; + +private: + ObjectEntryIndex entryIndex; // 5 + uint8_t age; // 7 + uint8_t Colour[3]; // 8 + uint8_t Flags2; // B +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-private-field" + uint8_t Pad0B[4]; +#pragma clang diagnostic pop + +public: + ObjectEntryIndex GetEntryIndex() const; + void SetEntryIndex(ObjectEntryIndex newIndex); + const SmallSceneryEntry* GetEntry() const; + uint8_t GetAge() const; + void SetAge(uint8_t newAge); + void IncreaseAge(const CoordsXY& sceneryPos); + uint8_t GetSceneryQuadrant() const; + void SetSceneryQuadrant(uint8_t newQuadrant); + colour_t GetPrimaryColour() const; + void SetPrimaryColour(colour_t colour); + colour_t GetSecondaryColour() const; + void SetSecondaryColour(colour_t colour); + colour_t GetTertiaryColour() const; + void SetTertiaryColour(colour_t colour); + bool NeedsSupports() const; + void SetNeedsSupports(); + void UpdateAge(const CoordsXY& sceneryPos); +}; +static_assert(sizeof(SmallSceneryElement) == kTileElementSize); +#pragma pack(pop) diff --git a/src/openrct2/world/Surface.cpp b/src/openrct2/world/tile_element/SurfaceElement.cpp similarity index 94% rename from src/openrct2/world/Surface.cpp rename to src/openrct2/world/tile_element/SurfaceElement.cpp index 61cb6bde17..aba3d12553 100644 --- a/src/openrct2/world/Surface.cpp +++ b/src/openrct2/world/tile_element/SurfaceElement.cpp @@ -7,16 +7,16 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#include "Surface.h" +#include "SurfaceElement.h" -#include "../Context.h" -#include "../object/ObjectManager.h" -#include "../object/TerrainEdgeObject.h" -#include "../object/TerrainSurfaceObject.h" -#include "../scenario/Scenario.h" -#include "Location.hpp" -#include "Map.h" -#include "tile_element/Slope.h" +#include "../../Context.h" +#include "../../object/ObjectManager.h" +#include "../../object/TerrainEdgeObject.h" +#include "../../object/TerrainSurfaceObject.h" +#include "../../scenario/Scenario.h" +#include "../Map.h" +#include "Slope.h" +#include "TileElement.h" ObjectEntryIndex SurfaceElement::GetSurfaceObjectIndex() const { @@ -67,7 +67,7 @@ bool SurfaceElement::CanGrassGrow() const auto obj = objMgr.GetLoadedObject(ObjectType::TerrainSurface, surfaceStyle); if (obj != nullptr) { - auto surfaceObject = static_cast(obj); + const auto* surfaceObject = static_cast(obj); if (surfaceObject->Flags & TERRAIN_SURFACE_FLAGS::CAN_GROW) { return true; diff --git a/src/openrct2/world/tile_element/SurfaceElement.h b/src/openrct2/world/tile_element/SurfaceElement.h new file mode 100644 index 0000000000..4d4c3c63a9 --- /dev/null +++ b/src/openrct2/world/tile_element/SurfaceElement.h @@ -0,0 +1,92 @@ +/***************************************************************************** + * 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 "../../object/TerrainEdgeObject.h" +#include "../../object/TerrainSurfaceObject.h" +#include "TileElementBase.h" + +enum +{ + SURFACE_ELEMENT_HAS_TRACK_THAT_NEEDS_WATER = (1 << 6), +}; + +enum GrassLength : uint8_t +{ + GRASS_LENGTH_MOWED, + GRASS_LENGTH_CLEAR_0, + GRASS_LENGTH_CLEAR_1, + GRASS_LENGTH_CLEAR_2, + GRASS_LENGTH_CLUMPS_0, + GRASS_LENGTH_CLUMPS_1, + GRASS_LENGTH_CLUMPS_2, +}; + +enum +{ + OWNERSHIP_UNOWNED = 0, + OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED = (1 << 4), + OWNERSHIP_OWNED = (1 << 5), + OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE = (1 << 6), + OWNERSHIP_AVAILABLE = (1 << 7) +}; + +constexpr uint8_t kTileElementSurfaceOwnershipMask = 0xF0; +constexpr uint8_t kTileElementSurfaceParkFenceMask = 0x0F; + +#pragma pack(push, 1) +struct SurfaceElement : TileElementBase +{ + static constexpr TileElementType ElementType = TileElementType::Surface; + +private: + uint8_t Slope; + uint8_t WaterHeight; + uint8_t GrassLength; + uint8_t Ownership; + uint8_t SurfaceStyle; + uint8_t EdgeObjectIndex; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-private-field" + uint8_t Pad0B[5]; +#pragma clang diagnostic pop + +public: + uint8_t GetSlope() const; + void SetSlope(uint8_t newSlope); + + ObjectEntryIndex GetSurfaceObjectIndex() const; + TerrainSurfaceObject* GetSurfaceObject() const; + void SetSurfaceObjectIndex(ObjectEntryIndex newStyle); + + ObjectEntryIndex GetEdgeObjectIndex() const; + TerrainEdgeObject* GetEdgeObject() const; + void SetEdgeObjectIndex(ObjectEntryIndex newStyle); + + bool CanGrassGrow() const; + uint8_t GetGrassLength() const; + void SetGrassLength(uint8_t newLength); + void SetGrassLengthAndInvalidate(uint8_t newLength, const CoordsXY& coords); + void UpdateGrassLength(const CoordsXY& coords); + + uint8_t GetOwnership() const; + void SetOwnership(uint8_t newOwnership); + + int32_t GetWaterHeight() const; + void SetWaterHeight(int32_t newWaterHeight); + + uint8_t GetParkFences() const; + void SetParkFences(uint8_t newParkFences); + + bool HasTrackThatNeedsWater() const; + void SetHasTrackThatNeedsWater(bool on); +}; +static_assert(sizeof(SurfaceElement) == kTileElementSize); +#pragma pack(pop) diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/tile_element/TileElement.cpp similarity index 87% rename from src/openrct2/world/TileElement.cpp rename to src/openrct2/world/tile_element/TileElement.cpp index c5c98518de..bf730e0e2b 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/tile_element/TileElement.cpp @@ -9,34 +9,20 @@ #include "TileElement.h" -#include "../Diagnostic.h" -#include "../core/Guard.hpp" -#include "../interface/Window.h" -#include "../object/LargeSceneryEntry.h" -#include "../object/WallSceneryEntry.h" -#include "../ride/Track.h" -#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" +#include "../../Diagnostic.h" +#include "../../core/Guard.hpp" +#include "../../interface/Window.h" +#include "../../interface/WindowClasses.h" +#include "../Map.h" +#include "BannerElement.h" +#include "EntranceElement.h" +#include "LargeSceneryElement.h" +#include "PathElement.h" +#include "TrackElement.h" +#include "WallElement.h" using namespace OpenRCT2; -bool TileElementIsUnderground(TileElement* tileElement) -{ - do - { - tileElement++; - if ((tileElement - 1)->IsLastForTile()) - return false; - } while (tileElement->GetType() != TileElementType::Surface); - return true; -} - BannerIndex TileElement::GetBannerIndex() const { switch (GetType()) @@ -120,3 +106,14 @@ void TileElement::ClearAs(TileElementType newType) std::fill_n(Pad05, sizeof(Pad05), 0x00); std::fill_n(Pad08, sizeof(Pad08), 0x00); } + +bool TileElementIsUnderground(TileElement* tileElement) +{ + do + { + tileElement++; + if ((tileElement - 1)->IsLastForTile()) + return false; + } while (tileElement->GetType() != TileElementType::Surface); + return true; +} diff --git a/src/openrct2/world/tile_element/TileElement.h b/src/openrct2/world/tile_element/TileElement.h new file mode 100644 index 0000000000..6d1bdce5e9 --- /dev/null +++ b/src/openrct2/world/tile_element/TileElement.h @@ -0,0 +1,38 @@ +/***************************************************************************** + * 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 "../../Identifiers.h" +#include "../Banner.h" +#include "TileElementBase.h" + +#pragma pack(push, 1) +/** + * Map element structure + * size: 0x10 + */ +struct TileElement : public TileElementBase +{ + uint8_t Pad05[3]; + uint8_t Pad08[8]; + + void ClearAs(TileElementType newType); + + RideId GetRideIndex() const; + + void SetBannerIndex(BannerIndex newIndex); + void RemoveBannerEntry(); + BannerIndex GetBannerIndex() const; +}; +static_assert(sizeof(TileElement) == kTileElementSize); + +bool TileElementIsUnderground(TileElement* tileElement); + +#pragma pack(pop) diff --git a/src/openrct2/world/tile_element/TileElementBase.cpp b/src/openrct2/world/tile_element/TileElementBase.cpp index 9e8a1215cb..48e2578113 100644 --- a/src/openrct2/world/tile_element/TileElementBase.cpp +++ b/src/openrct2/world/tile_element/TileElementBase.cpp @@ -7,10 +7,17 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "TileElementBase.h" + +#include "../../util/Util.h" #include "../Map.h" -#include "../TileElement.h" #include "BannerElement.h" #include "EntranceElement.h" +#include "LargeSceneryElement.h" +#include "PathElement.h" +#include "SmallSceneryElement.h" +#include "SurfaceElement.h" +#include "TileElement.h" #include "TrackElement.h" #include "WallElement.h" @@ -122,13 +129,13 @@ void TileElementBase::SetClearanceZ(int32_t newZ) uint8_t TileElementBase::GetOwner() const { - return Owner & OWNER_MASK; + return Owner & kTileElementOwnerMask; } void TileElementBase::SetOwner(uint8_t newOwner) { - Owner &= ~OWNER_MASK; - Owner |= (newOwner & OWNER_MASK); + Owner &= ~kTileElementOwnerMask; + Owner |= (newOwner & kTileElementOwnerMask); } const SurfaceElement* TileElementBase::AsSurface() const diff --git a/src/openrct2/world/tile_element/TileElementBase.h b/src/openrct2/world/tile_element/TileElementBase.h new file mode 100644 index 0000000000..a57a45de00 --- /dev/null +++ b/src/openrct2/world/tile_element/TileElementBase.h @@ -0,0 +1,120 @@ +/***************************************************************************** + * 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 "../Location.hpp" +#include "TileElementType.h" + +#include + +constexpr uint8_t kTileElementSize = 16; +constexpr uint8_t kMaxTileElementHeight = 255; +constexpr uint8_t kTileElementOwnerMask = 0b00001111; +constexpr uint8_t kTileElementQuadrantMask = 0b11000000; +constexpr uint8_t kTileElementTypeMask = 0b00111100; +constexpr uint8_t kTileElementDirectionMask = 0b00000011; +constexpr uint8_t kTileElementOccupiedQuadrantsMask = 0b00001111; + +enum +{ + TILE_ELEMENT_DIRECTION_WEST, + TILE_ELEMENT_DIRECTION_NORTH, + TILE_ELEMENT_DIRECTION_EAST, + TILE_ELEMENT_DIRECTION_SOUTH +}; + +enum +{ + TILE_ELEMENT_FLAG_GHOST = (1 << 4), + TILE_ELEMENT_FLAG_INVISIBLE = (1 << 5), + TILE_ELEMENT_FLAG_LAST_TILE = (1 << 7) +}; + +struct TileElement; +struct SurfaceElement; +struct PathElement; +struct TrackElement; +struct SmallSceneryElement; +struct LargeSceneryElement; +struct WallElement; +struct EntranceElement; +struct BannerElement; + +#pragma pack(push, 1) +struct TileElementBase +{ + uint8_t Type; // 0 + uint8_t Flags; // 1. Upper nibble: flags. Lower nibble: occupied quadrants (one bit per quadrant). + uint8_t BaseHeight; // 2 + uint8_t ClearanceHeight; // 3 + uint8_t Owner; // 4 + + void Remove(); + + TileElementType GetType() const; + void SetType(TileElementType newType); + + Direction GetDirection() const; + void SetDirection(Direction direction); + Direction GetDirectionWithOffset(uint8_t offset) const; + + bool IsLastForTile() const; + void SetLastForTile(bool on); + bool IsGhost() const; + void SetGhost(bool isGhost); + bool IsInvisible() const; + void SetInvisible(bool on); + + uint8_t GetOccupiedQuadrants() const; + void SetOccupiedQuadrants(uint8_t quadrants); + + int32_t GetBaseZ() const; + void SetBaseZ(int32_t newZ); + + int32_t GetClearanceZ() const; + void SetClearanceZ(int32_t newZ); + + uint8_t GetOwner() const; + void SetOwner(uint8_t newOwner); + + template const TType* as() const + { + if constexpr (std::is_same_v) + return reinterpret_cast(this); + else + return GetType() == TType::ElementType ? reinterpret_cast(this) : nullptr; + } + + template TType* as() + { + if constexpr (std::is_same_v) + return reinterpret_cast(this); + else + return GetType() == TType::ElementType ? reinterpret_cast(this) : nullptr; + } + + const SurfaceElement* AsSurface() const; + SurfaceElement* AsSurface(); + const PathElement* AsPath() const; + PathElement* AsPath(); + const TrackElement* AsTrack() const; + TrackElement* AsTrack(); + const SmallSceneryElement* AsSmallScenery() const; + SmallSceneryElement* AsSmallScenery(); + const LargeSceneryElement* AsLargeScenery() const; + LargeSceneryElement* AsLargeScenery(); + const WallElement* AsWall() const; + WallElement* AsWall(); + const EntranceElement* AsEntrance() const; + EntranceElement* AsEntrance(); + const BannerElement* AsBanner() const; + BannerElement* AsBanner(); +}; +#pragma pack(pop) diff --git a/src/openrct2/world/tile_element/TrackElement.h b/src/openrct2/world/tile_element/TrackElement.h index 460190be10..bec0b0c443 100644 --- a/src/openrct2/world/tile_element/TrackElement.h +++ b/src/openrct2/world/tile_element/TrackElement.h @@ -9,7 +9,16 @@ #pragma once -#include "../TileElement.h" +#include "../../Identifiers.h" +#include "TileElementBase.h" + +using ride_type_t = uint16_t; +enum class RideColourScheme : uint8_t; + +namespace OpenRCT2 +{ + enum class TrackElemType : uint16_t; +} enum { diff --git a/src/openrct2/world/tile_element/WallElement.h b/src/openrct2/world/tile_element/WallElement.h index bb179b4425..453acac36f 100644 --- a/src/openrct2/world/tile_element/WallElement.h +++ b/src/openrct2/world/tile_element/WallElement.h @@ -10,7 +10,11 @@ #pragma once #include "../../Identifiers.h" -#include "../TileElement.h" +#include "../../interface/Colour.h" +#include "../../object/ObjectTypes.h" +#include "../../object/WallSceneryEntry.h" +#include "../Banner.h" +#include "TileElementBase.h" #include diff --git a/test/tests/Pathfinding.cpp b/test/tests/Pathfinding.cpp index a9d84a5407..7e08f5422d 100644 --- a/test/tests/Pathfinding.cpp +++ b/test/tests/Pathfinding.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/test/tests/TileElements.cpp b/test/tests/TileElements.cpp index 41c18c4501..de1b1cf156 100644 --- a/test/tests/TileElements.cpp +++ b/test/tests/TileElements.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include using namespace OpenRCT2; diff --git a/test/tests/TileElementsView.cpp b/test/tests/TileElementsView.cpp index fb880e1f5f..ffcc93bdd8 100644 --- a/test/tests/TileElementsView.cpp +++ b/test/tests/TileElementsView.cpp @@ -20,6 +20,11 @@ #include #include #include +#include +#include +#include +#include +#include #include #include