summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ai/default/default.cpp1
-rw-r--r--src/ai/trolly/pathfinder.cpp1
-rw-r--r--src/ai/trolly/trolly.cpp3
-rw-r--r--src/aircraft_cmd.cpp2
-rw-r--r--src/aircraft_gui.cpp1
-rw-r--r--src/airport_gui.cpp2
-rw-r--r--src/autoreplace_cmd.cpp1
-rw-r--r--src/autoslope.h2
-rw-r--r--src/build_vehicle_gui.cpp1
-rw-r--r--src/depot.cpp2
-rw-r--r--src/depot.h91
-rw-r--r--src/depot_base.h35
-rw-r--r--src/depot_func.h39
-rw-r--r--src/depot_gui.cpp3
-rw-r--r--src/depot_map.h41
-rw-r--r--src/group_gui.cpp1
-rw-r--r--src/npf.cpp3
-rw-r--r--src/oldloader.cpp2
-rw-r--r--src/openttd.cpp1
-rw-r--r--src/order_cmd.cpp3
-rw-r--r--src/order_gui.cpp3
-rw-r--r--src/pathfind.cpp2
-rw-r--r--src/rail_cmd.cpp5
-rw-r--r--src/road_cmd.cpp3
-rw-r--r--src/road_map.cpp1
-rw-r--r--src/roadveh_cmd.cpp3
-rw-r--r--src/roadveh_gui.cpp1
-rw-r--r--src/ship_cmd.cpp3
-rw-r--r--src/ship_gui.cpp1
-rw-r--r--src/station.cpp1
-rw-r--r--src/station_cmd.cpp1
-rw-r--r--src/timetable_gui.cpp1
-rw-r--r--src/town_cmd.cpp3
-rw-r--r--src/train_cmd.cpp3
-rw-r--r--src/train_gui.cpp1
-rw-r--r--src/tunnelbridge_cmd.cpp2
-rw-r--r--src/unmovable_cmd.cpp2
-rw-r--r--src/vehicle.cpp2
-rw-r--r--src/vehicle_gui.cpp3
-rw-r--r--src/water_cmd.cpp3
-rw-r--r--src/waypoint.h1
-rw-r--r--src/yapf/follow_track.hpp2
-rw-r--r--src/yapf/yapf.hpp1
-rw-r--r--src/yapf/yapf_road.cpp1
44 files changed, 157 insertions, 127 deletions
diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp
index dcdf2f2c4..ed7f103a2 100644
--- a/src/ai/default/default.cpp
+++ b/src/ai/default/default.cpp
@@ -16,7 +16,6 @@
#include "../../industry.h"
#include "../../pathfind.h"
#include "../../airport.h"
-#include "../../depot.h"
#include "../../variables.h"
#include "../../bridge.h"
#include "../../date_func.h"
diff --git a/src/ai/trolly/pathfinder.cpp b/src/ai/trolly/pathfinder.cpp
index 15052cc39..0928a3a35 100644
--- a/src/ai/trolly/pathfinder.cpp
+++ b/src/ai/trolly/pathfinder.cpp
@@ -6,7 +6,6 @@
#include "../../debug.h"
#include "../../command_func.h"
#include "trolly.h"
-#include "../../depot.h"
#include "../../tunnel_map.h"
#include "../../bridge.h"
#include "../../tunnelbridge_map.h"
diff --git a/src/ai/trolly/trolly.cpp b/src/ai/trolly/trolly.cpp
index 851f1092e..3df5f06ac 100644
--- a/src/ai/trolly/trolly.cpp
+++ b/src/ai/trolly/trolly.cpp
@@ -24,12 +24,13 @@
#include "../../station_map.h"
#include "../../command_func.h"
#include "trolly.h"
+#include "../../depot_base.h"
#include "../../town.h"
#include "../../industry.h"
#include "../../station_base.h"
#include "../../engine_func.h"
#include "../../gui.h"
-#include "../../depot.h"
+#include "../../depot_base.h"
#include "../../vehicle_base.h"
#include "../../vehicle_func.h"
#include "../../date_func.h"
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 29da2d603..d0c7b0af7 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -10,7 +10,7 @@
#include "landscape.h"
#include "station_map.h"
#include "timetable.h"
-#include "depot.h"
+#include "depot_func.h"
#include "news_func.h"
#include "aircraft.h"
#include "airport.h"
diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp
index bf445b8ee..595b7c94e 100644
--- a/src/aircraft_gui.cpp
+++ b/src/aircraft_gui.cpp
@@ -7,7 +7,6 @@
#include "aircraft.h"
#include "debug.h"
#include "gui.h"
-#include "depot.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "strings_func.h"
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index b222defca..181744adc 100644
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -10,7 +10,6 @@
#include "terraform_gui.h"
#include "command_func.h"
#include "airport.h"
-#include "depot.h"
#include "sound_func.h"
#include "window_func.h"
#include "settings_type.h"
@@ -18,6 +17,7 @@
#include "gfx_func.h"
#include "player_func.h"
#include "order_func.h"
+#include "station_type.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index bb13c7374..f4fe718ff 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -8,7 +8,6 @@
#include "player_func.h"
#include "debug.h"
#include "vehicle_gui.h"
-#include "depot.h"
#include "train.h"
#include "aircraft.h"
#include "cargotype.h"
diff --git a/src/autoslope.h b/src/autoslope.h
index 036b43a57..2b7909fb8 100644
--- a/src/autoslope.h
+++ b/src/autoslope.h
@@ -5,9 +5,9 @@
#ifndef AUTOSLOPE_H
#define AUTOSLOPE_H
-#include "depot.h"
#include "settings_type.h"
#include "player_func.h"
+#include "depot_func.h"
/**
* Autoslope check for tiles with an entrance on an edge.
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 58114c221..42210cf63 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -14,7 +14,6 @@
#include "textbuf_gui.h"
#include "command_func.h"
#include "player_func.h"
-#include "depot.h"
#include "airport.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
diff --git a/src/depot.cpp b/src/depot.cpp
index c842aba1d..9475366d0 100644
--- a/src/depot.cpp
+++ b/src/depot.cpp
@@ -4,7 +4,7 @@
#include "stdafx.h"
#include "openttd.h"
-#include "depot.h"
+#include "depot_base.h"
#include "landscape.h"
#include "saveload.h"
#include "order_func.h"
diff --git a/src/depot.h b/src/depot.h
deleted file mode 100644
index 28c5275c9..000000000
--- a/src/depot.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* $Id$ */
-
-/** @file depot.h Header files for depots (not hangars) */
-
-#ifndef DEPOT_H
-#define DEPOT_H
-
-#include "direction_type.h"
-#include "depot_type.h"
-#include "oldpool.h"
-#include "road_map.h"
-#include "rail_map.h"
-#include "water_map.h"
-#include "station_map.h"
-
-DECLARE_OLD_POOL(Depot, Depot, 3, 8000)
-
-struct Depot : PoolItem<Depot, DepotID, &_Depot_pool> {
- TileIndex xy;
- TownID town_index;
-
- Depot(TileIndex xy = 0) : xy(xy) {}
- ~Depot();
-
- inline bool IsValid() const { return this->xy != 0; }
-};
-
-static inline bool IsValidDepotID(DepotID index)
-{
- return index < GetDepotPoolSize() && GetDepot(index)->IsValid();
-}
-
-void ShowDepotWindow(TileIndex tile, VehicleType type);
-
-#define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1U < GetDepotPoolSize()) ? GetDepot(d->index + 1U) : NULL) if (d->IsValid())
-#define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0)
-
-/**
- * Check if a tile is a depot and it is a depot of the given type.
- */
-static inline bool IsDepotTypeTile(TileIndex tile, TransportType type)
-{
- switch (type) {
- default: NOT_REACHED();
- case TRANSPORT_RAIL:
- return IsRailDepotTile(tile);
-
- case TRANSPORT_ROAD:
- return IsRoadDepotTile(tile);
-
- case TRANSPORT_WATER:
- return IsShipDepotTile(tile);
- }
-}
-
-/**
- * Is the given tile a tile with a depot on it?
- * @param tile the tile to check
- * @return true if and only if there is a depot on the tile.
- */
-static inline bool IsDepotTile(TileIndex tile)
-{
- return IsRailDepotTile(tile) || IsRoadDepotTile(tile) || IsShipDepotTile(tile) || IsHangarTile(tile);
-}
-
-/**
- * Find out if the slope of the tile is suitable to build a depot of given direction
- * @param direction The direction in which the depot's exit points
- * @param tileh The slope of the tile in question
- * @return true if the construction is possible
-
- * This is checked by the ugly 0x4C >> direction magic, which does the following:
- * 0x4C is 0100 1100 and tileh has only bits 0..3 set (steep tiles are ruled out)
- * So: for direction (only the significant bits are shown)<p>
- * 00 (exit towards NE) we need either bit 2 or 3 set in tileh: 0x4C >> 0 = 1100<p>
- * 01 (exit towards SE) we need either bit 1 or 2 set in tileh: 0x4C >> 1 = 0110<p>
- * 02 (exit towards SW) we need either bit 0 or 1 set in tileh: 0x4C >> 2 = 0011<p>
- * 03 (exit towards NW) we need either bit 0 or 4 set in tileh: 0x4C >> 3 = 1001<p>
- * So ((0x4C >> direction) & tileh) determines whether the depot can be built on the current tileh
- */
-static inline bool CanBuildDepotByTileh(DiagDirection direction, Slope tileh)
-{
- return ((0x4C >> direction) & tileh) != 0;
-}
-
-Depot *GetDepotByTile(TileIndex tile);
-void InitializeDepots();
-
-void DeleteDepotHighlightOfVehicle(const Vehicle *v);
-
-#endif /* DEPOT_H */
diff --git a/src/depot_base.h b/src/depot_base.h
new file mode 100644
index 000000000..e1c9e2168
--- /dev/null
+++ b/src/depot_base.h
@@ -0,0 +1,35 @@
+/* $Id$ */
+
+/** @file depot.h Base for all depots (except hangars) */
+
+#ifndef DEPOT_BASE_H
+#define DEPOT_BASE_H
+
+#include "tile_type.h"
+#include "depot_type.h"
+#include "oldpool.h"
+#include "town_type.h"
+
+DECLARE_OLD_POOL(Depot, Depot, 3, 8000)
+
+struct Depot : PoolItem<Depot, DepotID, &_Depot_pool> {
+ TileIndex xy;
+ TownID town_index;
+
+ Depot(TileIndex xy = 0) : xy(xy) {}
+ ~Depot();
+
+ inline bool IsValid() const { return this->xy != 0; }
+};
+
+static inline bool IsValidDepotID(DepotID index)
+{
+ return index < GetDepotPoolSize() && GetDepot(index)->IsValid();
+}
+
+Depot *GetDepotByTile(TileIndex tile);
+
+#define FOR_ALL_DEPOTS_FROM(d, start) for (d = GetDepot(start); d != NULL; d = (d->index + 1U < GetDepotPoolSize()) ? GetDepot(d->index + 1U) : NULL) if (d->IsValid())
+#define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0)
+
+#endif /* DEPOT_BASE_H */
diff --git a/src/depot_func.h b/src/depot_func.h
new file mode 100644
index 000000000..5a2d28a6f
--- /dev/null
+++ b/src/depot_func.h
@@ -0,0 +1,39 @@
+/* $Id$ */
+
+/** @file depot_func.h Functions related to depots. */
+
+#ifndef DEPOT_FUNC_H
+#define DEPOT_FUNC_H
+
+#include "depot_type.h"
+#include "tile_type.h"
+#include "vehicle_type.h"
+#include "direction_type.h"
+#include "slope_type.h"
+
+void ShowDepotWindow(TileIndex tile, VehicleType type);
+void InitializeDepots();
+
+void DeleteDepotHighlightOfVehicle(const Vehicle *v);
+
+/**
+ * Find out if the slope of the tile is suitable to build a depot of given direction
+ * @param direction The direction in which the depot's exit points
+ * @param tileh The slope of the tile in question
+ * @return true if the construction is possible
+
+ * This is checked by the ugly 0x4C >> direction magic, which does the following:
+ * 0x4C is 0100 1100 and tileh has only bits 0..3 set (steep tiles are ruled out)
+ * So: for direction (only the significant bits are shown)<p>
+ * 00 (exit towards NE) we need either bit 2 or 3 set in tileh: 0x4C >> 0 = 1100<p>
+ * 01 (exit towards SE) we need either bit 1 or 2 set in tileh: 0x4C >> 1 = 0110<p>
+ * 02 (exit towards SW) we need either bit 0 or 1 set in tileh: 0x4C >> 2 = 0011<p>
+ * 03 (exit towards NW) we need either bit 0 or 4 set in tileh: 0x4C >> 3 = 1001<p>
+ * So ((0x4C >> direction) & tileh) determines whether the depot can be built on the current tileh
+ */
+static inline bool CanBuildDepotByTileh(DiagDirection direction, Slope tileh)
+{
+ return ((0x4C >> direction) & tileh) != 0;
+}
+
+#endif /* DEPOT_FUNC_H */
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index e6f9fbcc5..e5a0b8e67 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -13,7 +13,7 @@
#include "viewport_func.h"
#include "gfx_func.h"
#include "command_func.h"
-#include "depot.h"
+#include "depot_base.h"
#include "vehicle_gui.h"
#include "station_map.h"
#include "newgrf_engine.h"
@@ -23,6 +23,7 @@
#include "vehicle_func.h"
#include "player_func.h"
#include "order_func.h"
+#include "depot_base.h"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/depot_map.h b/src/depot_map.h
new file mode 100644
index 000000000..6c4bff847
--- /dev/null
+++ b/src/depot_map.h
@@ -0,0 +1,41 @@
+/* $Id$ */
+
+/** @file depot_map.h Map related accessors for depots. */
+
+#ifndef DEPOT_MAP_H
+#define DEPOT_MAP_H
+
+#include "road_map.h"
+#include "rail_map.h"
+#include "water_map.h"
+#include "station_map.h"
+
+/**
+ * Check if a tile is a depot and it is a depot of the given type.
+ */
+static inline bool IsDepotTypeTile(TileIndex tile, TransportType type)
+{
+ switch (type) {
+ default: NOT_REACHED();
+ case TRANSPORT_RAIL:
+ return IsRailDepotTile(tile);
+
+ case TRANSPORT_ROAD:
+ return IsRoadDepotTile(tile);
+
+ case TRANSPORT_WATER:
+ return IsShipDepotTile(tile);
+ }
+}
+
+/**
+ * Is the given tile a tile with a depot on it?
+ * @param tile the tile to check
+ * @return true if and only if there is a depot on the tile.
+ */
+static inline bool IsDepotTile(TileIndex tile)
+{
+ return IsRailDepotTile(tile) || IsRoadDepotTile(tile) || IsShipDepotTile(tile) || IsHangarTile(tile);
+}
+
+#endif /* DEPOT_MAP_H */
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index 23e1f5c4e..4ccc62ad5 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -9,7 +9,6 @@
#include "textbuf_gui.h"
#include "command_func.h"
#include "vehicle_gui.h"
-#include "depot.h"
#include "train.h"
#include "group.h"
#include "debug.h"
diff --git a/src/npf.cpp b/src/npf.cpp
index b0f762c25..adbb4228a 100644
--- a/src/npf.cpp
+++ b/src/npf.cpp
@@ -14,7 +14,8 @@
#include "pathfind.h"
#include "station_base.h"
#include "station_map.h"
-#include "depot.h"
+#include "depot_base.h"
+#include "depot_map.h"
#include "tunnel_map.h"
#include "network/network.h"
#include "water_map.h"
diff --git a/src/oldloader.cpp b/src/oldloader.cpp
index 8d7832da9..103845a3d 100644
--- a/src/oldloader.cpp
+++ b/src/oldloader.cpp
@@ -15,7 +15,7 @@
#include "train.h"
#include "signs_base.h"
#include "debug.h"
-#include "depot.h"
+#include "depot_base.h"
#include "newgrf_config.h"
#include "ai/ai.h"
#include "ai/default/default.h"
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 92a70d6cf..cf88a7db7 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -46,7 +46,6 @@
#include "network/network.h"
#include "signs_base.h"
#include "signs_func.h"
-#include "depot.h"
#include "waypoint.h"
#include "ai/ai.h"
#include "train.h"
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 2b2cc2870..60ec9311d 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -7,7 +7,7 @@
#include "order_base.h"
#include "order_func.h"
#include "airport.h"
-#include "depot.h"
+#include "order_base.h"
#include "waypoint.h"
#include "command_func.h"
#include "player_func.h"
@@ -26,6 +26,7 @@
#include "timetable.h"
#include "vehicle_func.h"
#include "oldpool_func.h"
+#include "depot_base.h"
#include "table/strings.h"
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index 4631db958..b14ec8edb 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -13,7 +13,7 @@
#include "command_func.h"
#include "viewport_func.h"
#include "gfx_func.h"
-#include "depot.h"
+#include "depot_base.h"
#include "waypoint.h"
#include "train.h"
#include "water_map.h"
@@ -29,6 +29,7 @@
#include "widgets/dropdown_func.h"
#include "textbuf_gui.h"
#include "string_func.h"
+#include "depot_base.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/pathfind.cpp b/src/pathfind.cpp
index ccbe47a14..09a38a37d 100644
--- a/src/pathfind.cpp
+++ b/src/pathfind.cpp
@@ -6,7 +6,6 @@
#include "openttd.h"
#include "bridge_map.h"
#include "station_map.h"
-#include "depot.h"
#include "tile_cmd.h"
#include "landscape.h"
#include "pathfind.h"
@@ -14,7 +13,6 @@
#include "debug.h"
#include "tunnel_map.h"
#include "settings_type.h"
-#include "depot.h"
#include "tunnelbridge_map.h"
#include "core/random_func.hpp"
#include "core/alloc_type.hpp"
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index 1f033bdea..2870e4f5a 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -20,7 +20,8 @@
#include "engine_func.h"
#include "town.h"
#include "sprite.h"
-#include "depot.h"
+#include "depot_base.h"
+#include "depot_func.h"
#include "waypoint.h"
#include "rail.h"
#include "newgrf.h"
@@ -40,6 +41,8 @@
#include "sound_func.h"
#include "signal_func.h"
#include "tunnelbridge.h"
+#include "station_map.h"
+#include "water_map.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index cd0582082..56f6ec2eb 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -18,7 +18,8 @@
#include "command_func.h"
#include "town.h"
#include "yapf/yapf.h"
-#include "depot.h"
+#include "depot_base.h"
+#include "depot_func.h"
#include "newgrf.h"
#include "station_map.h"
#include "tunnel_map.h"
diff --git a/src/road_map.cpp b/src/road_map.cpp
index 8c1783640..1663987c7 100644
--- a/src/road_map.cpp
+++ b/src/road_map.cpp
@@ -9,7 +9,6 @@
#include "road_map.h"
#include "tunnel_map.h"
#include "station_map.h"
-#include "depot.h"
#include "tunnelbridge_map.h"
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 476239e32..4ec5ba5c0 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -17,7 +17,6 @@
#include "npf.h"
#include "player_func.h"
#include "player_base.h"
-#include "depot.h"
#include "bridge.h"
#include "tunnel_map.h"
#include "bridge_map.h"
@@ -41,6 +40,8 @@
#include "gfx_func.h"
#include "settings_type.h"
#include "order_func.h"
+#include "depot_base.h"
+#include "depot_func.h"
#include "table/strings.h"
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp
index ba383c8bf..53859aa58 100644
--- a/src/roadveh_gui.cpp
+++ b/src/roadveh_gui.cpp
@@ -11,7 +11,6 @@
#include "viewport_func.h"
#include "gfx_func.h"
#include "command_func.h"
-#include "depot.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "strings_func.h"
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index e7a22b6e8..ac00f121b 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -17,7 +17,8 @@
#include "player_func.h"
#include "player_base.h"
#include "npf.h"
-#include "depot.h"
+#include "depot_base.h"
+#include "depot_func.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "water_map.h"
diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp
index 9b95a52a1..2629e96ed 100644
--- a/src/ship_gui.cpp
+++ b/src/ship_gui.cpp
@@ -10,7 +10,6 @@
#include "window_gui.h"
#include "viewport_func.h"
#include "gfx_func.h"
-#include "depot.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "strings_func.h"
diff --git a/src/station.cpp b/src/station.cpp
index f16fb8430..ecca12b02 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -13,7 +13,6 @@
#include "player_func.h"
#include "airport.h"
#include "sprite.h"
-#include "depot.h"
#include "train.h"
#include "water_map.h"
#include "industry_map.h"
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index f0d20b05b..5116784cc 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -18,7 +18,6 @@
#include "saveload.h"
#include "airport.h"
#include "sprite.h"
-#include "depot.h"
#include "train.h"
#include "roadveh.h"
#include "water_map.h"
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp
index 7fa33a239..86d30f8b9 100644
--- a/src/timetable_gui.cpp
+++ b/src/timetable_gui.cpp
@@ -10,7 +10,6 @@
#include "window_gui.h"
#include "textbuf_gui.h"
#include "cargotype.h"
-#include "depot.h"
#include "strings_func.h"
#include "vehicle_base.h"
#include "string_func.h"
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 410044932..447c4d29d 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -41,6 +41,9 @@
#include "string_func.h"
#include "newgrf_cargo.h"
#include "oldpool_func.h"
+#include "sprite.h"
+#include "economy_func.h"
+#include "station_func.h"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 408d88487..15cec8113 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -20,7 +20,8 @@
#include "engine_func.h"
#include "player_func.h"
#include "player_base.h"
-#include "depot.h"
+#include "depot_base.h"
+#include "depot_func.h"
#include "waypoint.h"
#include "vehicle_gui.h"
#include "train.h"
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 97680a8be..49ac235a5 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -10,7 +10,6 @@
#include "gfx_func.h"
#include "command_func.h"
#include "vehicle_gui.h"
-#include "depot.h"
#include "train.h"
#include "newgrf_engine.h"
#include "strings_func.h"
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 2f4c7ac28..739156b0b 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -35,6 +35,8 @@
#include "tunnelbridge.h"
#include "player_base.h"
#include "engine_func.h"
+#include "economy_func.h"
+#include "rail.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index 0ff3d299f..53e453f9e 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -24,6 +24,8 @@
#include "window_func.h"
#include "vehicle_func.h"
#include "player_gui.h"
+#include "station_type.h"
+#include "economy_func.h"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 8a65c8d02..dc7348840 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -19,7 +19,6 @@
#include "player_func.h"
#include "debug.h"
#include "vehicle_gui.h"
-#include "depot.h"
#include "rail_type.h"
#include "train.h"
#include "aircraft.h"
@@ -47,6 +46,7 @@
#include "string_func.h"
#include "settings_type.h"
#include "oldpool_func.h"
+#include "depot_map.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 806150e82..e8cdd455b 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -21,7 +21,7 @@
#include "ship.h"
#include "aircraft.h"
#include "roadveh.h"
-#include "depot.h"
+#include "depot_base.h"
#include "cargotype.h"
#include "group.h"
#include "group_gui.h"
@@ -35,6 +35,7 @@
#include "settings_type.h"
#include "widgets/dropdown_func.h"
#include "order_func.h"
+#include "depot_base.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 822ebad45..6d46cddb2 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -14,7 +14,8 @@
#include "command_func.h"
#include "town.h"
#include "news_func.h"
-#include "depot.h"
+#include "depot_base.h"
+#include "depot_func.h"
#include "vehicle_gui.h"
#include "train.h"
#include "roadveh.h"
diff --git a/src/waypoint.h b/src/waypoint.h
index 3c4400d42..be259e630 100644
--- a/src/waypoint.h
+++ b/src/waypoint.h
@@ -10,6 +10,7 @@
#include "rail_map.h"
#include "command_type.h"
#include "station_type.h"
+#include "town_type.h"
DECLARE_OLD_POOL(Waypoint, Waypoint, 3, 8000)
diff --git a/src/yapf/follow_track.hpp b/src/yapf/follow_track.hpp
index 0b5608fb4..e72d9deda 100644
--- a/src/yapf/follow_track.hpp
+++ b/src/yapf/follow_track.hpp
@@ -6,7 +6,7 @@
#define FOLLOW_TRACK_HPP
#include "yapf.hpp"
-
+#include "../depot_map.h"
/** Track follower helper template class (can serve pathfinders and vehicle
* controllers). See 6 different typedefs below for 3 different transport
diff --git a/src/yapf/yapf.hpp b/src/yapf/yapf.hpp
index 97f104e49..61e409bb3 100644
--- a/src/yapf/yapf.hpp
+++ b/src/yapf/yapf.hpp
@@ -8,7 +8,6 @@
#include "track_dir.hpp"
#include "../vehicle_base.h"
-#include "../depot.h"
#include "../road_map.h"
#include "../tunnel_map.h"
#include "../bridge_map.h"
diff --git a/src/yapf/yapf_road.cpp b/src/yapf/yapf_road.cpp
index 853b68e5b..ce032eacd 100644
--- a/src/yapf/yapf_road.cpp
+++ b/src/yapf/yapf_road.cpp
@@ -3,6 +3,7 @@
/** @file yapf_road.cpp */
#include "../stdafx.h"
+#include "../depot_base.h"
#include "yapf.hpp"
#include "yapf_node_road.hpp"