From a51462b0fdbafbcb30970ef02bad8752604ad36d Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 31 Mar 2018 13:55:54 +0200 Subject: [PATCH] Include necessary files for compiling headers This commits works towards #7289. It includes files that it depends on, or forward declares types when possible. It may seem like this only increases compilation time, but before this commit they depended on the other includes of the source files that use them. --- src/openrct2/actions/BannerSetNameAction.hpp | 1 + src/openrct2/actions/MazeSetTrackAction.hpp | 1 + src/openrct2/actions/ParkSetNameAction.hpp | 1 + src/openrct2/actions/PlacePeepSpawnAction.hpp | 1 + src/openrct2/actions/RideDemolishAction.hpp | 3 +++ src/openrct2/actions/RideSetName.hpp | 2 ++ src/openrct2/actions/RideSetStatus.hpp | 4 ++++ src/openrct2/actions/SignSetNameAction.hpp | 1 + src/openrct2/actions/StaffSetNameAction.hpp | 2 ++ src/openrct2/core/Zip.h | 2 ++ src/openrct2/drawing/NewDrawing.h | 1 + src/openrct2/drawing/Rain.h | 2 ++ src/openrct2/interface/Window_internal.h | 2 ++ src/openrct2/localisation/FormatCodes.h | 2 ++ src/openrct2/network/NetworkKey.h | 1 + src/openrct2/object/ObjectFactory.h | 1 + src/openrct2/paint/VirtualFloor.h | 2 ++ src/openrct2/ride/VehiclePaint.h | 6 +++++- src/openrct2/ride/coaster/BolligerMabillardTrack.h | 5 +++++ src/openrct2/title/TitleSequencePlayer.h | 2 ++ src/openrct2/world/MapHelpers.h | 2 ++ 21 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/openrct2/actions/BannerSetNameAction.hpp b/src/openrct2/actions/BannerSetNameAction.hpp index e7b61c0b18..4375813a8b 100644 --- a/src/openrct2/actions/BannerSetNameAction.hpp +++ b/src/openrct2/actions/BannerSetNameAction.hpp @@ -19,6 +19,7 @@ #include "../Context.h" #include "../core/String.hpp" #include "../drawing/Drawing.h" +#include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../ui/UiContext.h" #include "../world/Sprite.h" diff --git a/src/openrct2/actions/MazeSetTrackAction.hpp b/src/openrct2/actions/MazeSetTrackAction.hpp index 82a4312004..0c2b10a9dd 100644 --- a/src/openrct2/actions/MazeSetTrackAction.hpp +++ b/src/openrct2/actions/MazeSetTrackAction.hpp @@ -26,6 +26,7 @@ #include "../management/Finance.h" #include "../ride/Track.h" #include "../ride/TrackData.h" +#include "../world/Footpath.h" #include "../world/Park.h" /** rct2: 0x00993CE9 */ diff --git a/src/openrct2/actions/ParkSetNameAction.hpp b/src/openrct2/actions/ParkSetNameAction.hpp index 0e9cd59a91..fab0d9bd9b 100644 --- a/src/openrct2/actions/ParkSetNameAction.hpp +++ b/src/openrct2/actions/ParkSetNameAction.hpp @@ -18,6 +18,7 @@ #include "../Context.h" #include "../drawing/Drawing.h" +#include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../ui/UiContext.h" #include "../world/Sprite.h" diff --git a/src/openrct2/actions/PlacePeepSpawnAction.hpp b/src/openrct2/actions/PlacePeepSpawnAction.hpp index 5b5d6c58af..9bbbf34266 100644 --- a/src/openrct2/actions/PlacePeepSpawnAction.hpp +++ b/src/openrct2/actions/PlacePeepSpawnAction.hpp @@ -22,6 +22,7 @@ #include "GameAction.h" #include "../Cheats.h" +#include "../management/Finance.h" #include "../world/Park.h" #include "../world/Footpath.h" diff --git a/src/openrct2/actions/RideDemolishAction.hpp b/src/openrct2/actions/RideDemolishAction.hpp index 5948fbd4d3..11d52aca94 100644 --- a/src/openrct2/actions/RideDemolishAction.hpp +++ b/src/openrct2/actions/RideDemolishAction.hpp @@ -21,9 +21,12 @@ #include "../core/MemoryStream.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" +#include "../management/NewsItem.h" #include "../ride/Ride.h" #include "../ui/UiContext.h" #include "../ui/WindowManager.h" +#include "../world/Banner.h" +#include "../world/Sprite.h" #include "../world/Park.h" #include "GameAction.h" #include "MazeSetTrackAction.hpp" diff --git a/src/openrct2/actions/RideSetName.hpp b/src/openrct2/actions/RideSetName.hpp index 329faaa659..9f61a87a9d 100644 --- a/src/openrct2/actions/RideSetName.hpp +++ b/src/openrct2/actions/RideSetName.hpp @@ -19,9 +19,11 @@ #include "../Cheats.h" #include "../Context.h" #include "../core/MemoryStream.h" +#include "../drawing/Drawing.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../localisation/StringIds.h" +#include "../ride/Ride.h" #include "../ui/UiContext.h" #include "../ui/WindowManager.h" #include "../world/Park.h" diff --git a/src/openrct2/actions/RideSetStatus.hpp b/src/openrct2/actions/RideSetStatus.hpp index ee22f50e36..f953ba80a6 100644 --- a/src/openrct2/actions/RideSetStatus.hpp +++ b/src/openrct2/actions/RideSetStatus.hpp @@ -16,13 +16,17 @@ #pragma once +#include "../common.h" #include "../core/MemoryStream.h" +#include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "GameAction.h" #include "../Cheats.h" #include "../interface/Window.h" +#include "../management/Finance.h" #include "../world/Park.h" +#include "../world/Sprite.h" #include "../ride/Ride.h" static rct_string_id _StatusErrorTitles[] = diff --git a/src/openrct2/actions/SignSetNameAction.hpp b/src/openrct2/actions/SignSetNameAction.hpp index e5440d2e68..6b952b6449 100644 --- a/src/openrct2/actions/SignSetNameAction.hpp +++ b/src/openrct2/actions/SignSetNameAction.hpp @@ -18,6 +18,7 @@ #include "../Context.h" #include "../drawing/Drawing.h" +#include "../localisation/Localisation.h" #include "../localisation/StringIds.h" #include "../ui/UiContext.h" #include "../world/Sprite.h" diff --git a/src/openrct2/actions/StaffSetNameAction.hpp b/src/openrct2/actions/StaffSetNameAction.hpp index b270a500fe..8fdfecdd00 100644 --- a/src/openrct2/actions/StaffSetNameAction.hpp +++ b/src/openrct2/actions/StaffSetNameAction.hpp @@ -22,11 +22,13 @@ #include "../Cheats.h" #include "../Context.h" +#include "../drawing/Drawing.h" #include "../peep/Staff.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" #include "../windows/Intent.h" #include "../world/Park.h" +#include "../world/Sprite.h" struct StaffSetNameAction : public GameActionBase { diff --git a/src/openrct2/core/Zip.h b/src/openrct2/core/Zip.h index 8d3e85efd0..c1add665c4 100644 --- a/src/openrct2/core/Zip.h +++ b/src/openrct2/core/Zip.h @@ -18,6 +18,8 @@ #include "../common.h" +interface IStream; + /** * Represents a zip file. */ diff --git a/src/openrct2/drawing/NewDrawing.h b/src/openrct2/drawing/NewDrawing.h index 37a5205ee4..244bd3fca3 100644 --- a/src/openrct2/drawing/NewDrawing.h +++ b/src/openrct2/drawing/NewDrawing.h @@ -19,6 +19,7 @@ #include "../common.h" struct rct_drawpixelinfo; +struct rct_palette_entry; extern rct_string_id DrawingEngineStringIds[3]; diff --git a/src/openrct2/drawing/Rain.h b/src/openrct2/drawing/Rain.h index 97bfb60c91..552057ef5a 100644 --- a/src/openrct2/drawing/Rain.h +++ b/src/openrct2/drawing/Rain.h @@ -18,6 +18,8 @@ #include "../common.h" +struct rct_drawpixelinfo; + namespace OpenRCT2 { namespace Drawing { interface IRainDrawer; diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index dddd97823f..30845f4a1e 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -17,6 +17,8 @@ #ifndef _WINDOW2_H_ #define _WINDOW2_H_ +#include "Window.h" + struct rct_research_item; struct rct_object_entry; diff --git a/src/openrct2/localisation/FormatCodes.h b/src/openrct2/localisation/FormatCodes.h index 6cc7224a61..e7d0d518cf 100644 --- a/src/openrct2/localisation/FormatCodes.h +++ b/src/openrct2/localisation/FormatCodes.h @@ -17,6 +17,8 @@ #ifndef _FORMAT_CODES_H_ #define _FORMAT_CODES_H_ +#include "../common.h" + uint32 format_get_code(const char *token); const char *format_get_token(uint32 code); diff --git a/src/openrct2/network/NetworkKey.h b/src/openrct2/network/NetworkKey.h index 91a97395f5..eb5e9275f4 100644 --- a/src/openrct2/network/NetworkKey.h +++ b/src/openrct2/network/NetworkKey.h @@ -21,6 +21,7 @@ #include "../common.h" #include +#include using EVP_PKEY = evp_pkey_st; using EVP_PKEY_CTX = evp_pkey_ctx_st; diff --git a/src/openrct2/object/ObjectFactory.h b/src/openrct2/object/ObjectFactory.h index c8b1793f1d..5db5444e41 100644 --- a/src/openrct2/object/ObjectFactory.h +++ b/src/openrct2/object/ObjectFactory.h @@ -19,6 +19,7 @@ #include "../common.h" class Object; +struct rct_object_entry; namespace ObjectFactory { diff --git a/src/openrct2/paint/VirtualFloor.h b/src/openrct2/paint/VirtualFloor.h index 7c20c27a29..771d1e8115 100644 --- a/src/openrct2/paint/VirtualFloor.h +++ b/src/openrct2/paint/VirtualFloor.h @@ -17,6 +17,8 @@ #ifndef _VIRTUAL_FLOOR_H #define _VIRTUAL_FLOOR_H +#include "../common.h" + struct paint_session; uint16 virtual_floor_get_height(); diff --git a/src/openrct2/ride/VehiclePaint.h b/src/openrct2/ride/VehiclePaint.h index b953029d62..eca7be6918 100644 --- a/src/openrct2/ride/VehiclePaint.h +++ b/src/openrct2/ride/VehiclePaint.h @@ -17,7 +17,11 @@ #ifndef _VEHICLE_PAINT_H #define _VEHICLE_PAINT_H -#include "Vehicle.h" +#include "../common.h" + +struct paint_session; +struct rct_ride_entry_vehicle; +struct rct_vehicle; struct vehicle_boundbox { sint8 offset_x; diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.h b/src/openrct2/ride/coaster/BolligerMabillardTrack.h index a538f417b2..b59e43c746 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.h +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.h @@ -16,6 +16,11 @@ #pragma once +#include "../../common.h" + +struct paint_session; +struct rct_tile_element; + void bolliger_mabillard_track_flat( paint_session * session, uint8 rideIndex, diff --git a/src/openrct2/title/TitleSequencePlayer.h b/src/openrct2/title/TitleSequencePlayer.h index ea61e68c0f..864a2cb5b0 100644 --- a/src/openrct2/title/TitleSequencePlayer.h +++ b/src/openrct2/title/TitleSequencePlayer.h @@ -16,6 +16,8 @@ #pragma once +#include "../common.h" + interface IScenarioRepository; interface ITitleSequencePlayer diff --git a/src/openrct2/world/MapHelpers.h b/src/openrct2/world/MapHelpers.h index 53d4b80b17..b17d4f0a87 100644 --- a/src/openrct2/world/MapHelpers.h +++ b/src/openrct2/world/MapHelpers.h @@ -17,6 +17,8 @@ #ifndef _MAP_HELPERS_H_ #define _MAP_HELPERS_H_ +#include "../common.h" + enum { SLOPE_S_THRESHOLD_FLAGS = (1 << 0), SLOPE_W_THRESHOLD_FLAGS = (1 << 1),