From 8ce799a72e7fc6eefdd0def369371b734ff9d38b Mon Sep 17 00:00:00 2001 From: Thamara Andrade Date: Mon, 6 Jul 2020 10:10:39 -0300 Subject: [PATCH] Close #12118: Prefer foward declaration of *Coords* in headers (#12142) * Removing unnecessary world/Location includes in headers * Prefer foward declaration of *Coords* in header files Closes #12118 --- src/openrct2-ui/UiContext.cpp | 1 + src/openrct2-ui/input/KeyboardShortcuts.cpp | 1 + src/openrct2-ui/input/KeyboardShortcuts.h | 3 ++- src/openrct2/interface/Chat.cpp | 1 + src/openrct2/interface/Chat.h | 2 +- src/openrct2/management/NewsItem.cpp | 1 + src/openrct2/management/NewsItem.h | 4 +++- src/openrct2/object/LargeSceneryObject.h | 1 - src/openrct2/object/TerrainSurfaceObject.cpp | 1 + src/openrct2/object/TerrainSurfaceObject.h | 3 ++- src/openrct2/paint/VirtualFloor.cpp | 1 + src/openrct2/paint/VirtualFloor.h | 3 ++- src/openrct2/rct12/RCT12.h | 1 - src/openrct2/rct2/RCT2.h | 1 - src/openrct2/ride/Station.cpp | 1 + src/openrct2/ride/Station.h | 2 +- src/openrct2/ui/UiContext.h | 2 +- src/openrct2/world/TileElement.cpp | 1 + src/openrct2/world/TileElement.h | 2 +- 19 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index f29217d915..3ea286fbdd 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include using namespace OpenRCT2; diff --git a/src/openrct2-ui/input/KeyboardShortcuts.cpp b/src/openrct2-ui/input/KeyboardShortcuts.cpp index 455e882da6..0fc77b3390 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.cpp +++ b/src/openrct2-ui/input/KeyboardShortcuts.cpp @@ -20,6 +20,7 @@ #include #include #include +#include using namespace OpenRCT2; using namespace OpenRCT2::Input; diff --git a/src/openrct2-ui/input/KeyboardShortcuts.h b/src/openrct2-ui/input/KeyboardShortcuts.h index 8b56240417..381eacc737 100644 --- a/src/openrct2-ui/input/KeyboardShortcuts.h +++ b/src/openrct2-ui/input/KeyboardShortcuts.h @@ -11,7 +11,6 @@ #include #include -#include #define SHIFT 0x100 #define CTRL 0x200 @@ -23,6 +22,8 @@ # define PLATFORM_MODIFIER CTRL #endif +struct ScreenCoordsXY; + enum KeyboardShortcut { SHORTCUT_CLOSE_TOP_MOST_WINDOW, diff --git a/src/openrct2/interface/Chat.cpp b/src/openrct2/interface/Chat.cpp index 98ea151a39..ae231cd738 100644 --- a/src/openrct2/interface/Chat.cpp +++ b/src/openrct2/interface/Chat.cpp @@ -17,6 +17,7 @@ #include "../network/network.h" #include "../platform/platform.h" #include "../util/Util.h" +#include "../world/Location.hpp" #include diff --git a/src/openrct2/interface/Chat.h b/src/openrct2/interface/Chat.h index da36e213f2..92ed1bfd68 100644 --- a/src/openrct2/interface/Chat.h +++ b/src/openrct2/interface/Chat.h @@ -11,7 +11,6 @@ #define _CHAT_H_ #include "../common.h" -#include "../world/Location.hpp" #define CHAT_HISTORY_SIZE 10 #define CHAT_INPUT_SIZE 1024 @@ -19,6 +18,7 @@ #define CHAT_MAX_WINDOW_WIDTH 600 struct rct_drawpixelinfo; +struct ScreenCoordsXY; enum CHAT_INPUT { diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 2c442df8ef..61d7ed45e7 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -21,6 +21,7 @@ #include "../ride/Ride.h" #include "../util/Util.h" #include "../windows/Intent.h" +#include "../world/Location.hpp" #include "../world/Sprite.h" NewsItemQueues gNewsItems; diff --git a/src/openrct2/management/NewsItem.h b/src/openrct2/management/NewsItem.h index ff67657641..808084b6b7 100644 --- a/src/openrct2/management/NewsItem.h +++ b/src/openrct2/management/NewsItem.h @@ -10,12 +10,14 @@ #pragma once #include "../common.h" -#include "../world/Location.hpp" +#include #include #include #include +struct CoordsXYZ; + enum { NEWS_ITEM_NULL, diff --git a/src/openrct2/object/LargeSceneryObject.h b/src/openrct2/object/LargeSceneryObject.h index 3642878106..1237184c04 100644 --- a/src/openrct2/object/LargeSceneryObject.h +++ b/src/openrct2/object/LargeSceneryObject.h @@ -9,7 +9,6 @@ #pragma once -#include "../world/Location.hpp" #include "../world/Scenery.h" #include "SceneryObject.h" diff --git a/src/openrct2/object/TerrainSurfaceObject.cpp b/src/openrct2/object/TerrainSurfaceObject.cpp index 1f6de394e6..e7fac93c3e 100644 --- a/src/openrct2/object/TerrainSurfaceObject.cpp +++ b/src/openrct2/object/TerrainSurfaceObject.cpp @@ -15,6 +15,7 @@ #include "../core/String.hpp" #include "../drawing/Drawing.h" #include "../localisation/Localisation.h" +#include "../world/Location.hpp" #include "ObjectJsonHelpers.h" void TerrainSurfaceObject::Load() diff --git a/src/openrct2/object/TerrainSurfaceObject.h b/src/openrct2/object/TerrainSurfaceObject.h index 37cd4e94b4..34c76ae120 100644 --- a/src/openrct2/object/TerrainSurfaceObject.h +++ b/src/openrct2/object/TerrainSurfaceObject.h @@ -9,9 +9,10 @@ #pragma once -#include "../world/Location.hpp" #include "Object.h" +struct CoordsXY; + enum TERRAIN_SURFACE_FLAGS { NONE = 0, diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index 302e5d5090..683173b52f 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -14,6 +14,7 @@ #include "../config/Config.h" #include "../interface/Viewport.h" #include "../sprites.h" +#include "../world/Location.hpp" #include "../world/Map.h" #include "Paint.h" #include "VirtualFloor.h" diff --git a/src/openrct2/paint/VirtualFloor.h b/src/openrct2/paint/VirtualFloor.h index 22db262dcc..cdcacf43cf 100644 --- a/src/openrct2/paint/VirtualFloor.h +++ b/src/openrct2/paint/VirtualFloor.h @@ -10,7 +10,8 @@ #pragma once #include "../common.h" -#include "../world/Location.hpp" + +struct CoordsXY; enum VirtualFloorStyles { diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index 5a6c033b4a..b9a7a83f6d 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -13,7 +13,6 @@ #include "../common.h" #include "../object/Object.h" -#include "../world/Location.hpp" #include #include diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 35d8aa936c..85282def1d 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -14,7 +14,6 @@ #include "../rct12/RCT12.h" #include "../ride/RideRatings.h" #include "../ride/Vehicle.h" -#include "../world/Location.hpp" constexpr const uint8_t RCT2_MAX_STAFF = 200; constexpr const uint8_t RCT2_MAX_BANNERS_IN_PARK = 250; diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index 7d97a56f9a..6de5d73d40 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -11,6 +11,7 @@ #include "../Game.h" #include "../scenario/Scenario.h" +#include "../world/Location.hpp" #include "../world/Sprite.h" #include "Track.h" diff --git a/src/openrct2/ride/Station.h b/src/openrct2/ride/Station.h index 6b73bc8073..07ae724ad4 100644 --- a/src/openrct2/ride/Station.h +++ b/src/openrct2/ride/Station.h @@ -10,9 +10,9 @@ #pragma once #include "../common.h" -#include "../world/Location.hpp" struct Ride; +struct TileCoordsXYZD; using StationIndex = uint8_t; diff --git a/src/openrct2/ui/UiContext.h b/src/openrct2/ui/UiContext.h index 4be9911130..d99a2d1abf 100644 --- a/src/openrct2/ui/UiContext.h +++ b/src/openrct2/ui/UiContext.h @@ -12,12 +12,12 @@ #include "../Context.h" #include "../common.h" #include "../interface/Cursors.h" -#include "../world/Location.hpp" #include #include #include +struct ScreenCoordsXY; struct rct_drawpixelinfo; interface ITitleSequencePlayer; diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index f9bbdf4115..7f07668a88 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -15,6 +15,7 @@ #include "../ride/Track.h" #include "Banner.h" #include "LargeScenery.h" +#include "Location.hpp" #include "Scenery.h" uint8_t TileElementBase::GetType() const diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 68b014db14..a45d656834 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -14,9 +14,9 @@ #include "../ride/Station.h" #include "Banner.h" #include "Footpath.h" -#include "Location.hpp" struct Banner; +struct CoordsXY; struct rct_scenery_entry; struct rct_footpath_entry; using track_type_t = uint16_t;