summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-31 20:16:06 +0000
committersmatz <smatz@openttd.org>2009-01-31 20:16:06 +0000
commit0d3f5e6e74cae69d927a65a3d59c6391b713b987 (patch)
tree40327e8a6984433becd287c550cfef11be709043 /src
parent416c7d5ddaace157925d1d4220479be89a1cb13a (diff)
downloadopenttd-0d3f5e6e74cae69d927a65a3d59c6391b713b987.tar.xz
(svn r15299) -Cleanup: remove many redundant includes
Diffstat (limited to 'src')
-rw-r--r--src/ai/ai_config.cpp1
-rw-r--r--src/ai/ai_core.cpp4
-rw-r--r--src/ai/ai_gui.cpp12
-rw-r--r--src/ai/ai_info.cpp4
-rw-r--r--src/ai/ai_instance.cpp6
-rw-r--r--src/ai/ai_scanner.cpp2
-rw-r--r--src/ai/api/ai_airport.cpp4
-rw-r--r--src/ai/api/ai_bridge.cpp3
-rw-r--r--src/ai/api/ai_bridgelist.cpp1
-rw-r--r--src/ai/api/ai_cargo.cpp1
-rw-r--r--src/ai/api/ai_cargolist.cpp1
-rw-r--r--src/ai/api/ai_company.cpp2
-rw-r--r--src/ai/api/ai_controller.cpp6
-rw-r--r--src/ai/api/ai_depotlist.cpp1
-rw-r--r--src/ai/api/ai_engine.cpp8
-rw-r--r--src/ai/api/ai_error.cpp1
-rw-r--r--src/ai/api/ai_event.cpp2
-rw-r--r--src/ai/api/ai_event_types.cpp7
-rw-r--r--src/ai/api/ai_gamesettings.cpp1
-rw-r--r--src/ai/api/ai_group.cpp2
-rw-r--r--src/ai/api/ai_grouplist.cpp1
-rw-r--r--src/ai/api/ai_industry.cpp3
-rw-r--r--src/ai/api/ai_industrylist.cpp1
-rw-r--r--src/ai/api/ai_industrytype.cpp2
-rw-r--r--src/ai/api/ai_industrytypelist.cpp1
-rw-r--r--src/ai/api/ai_map.cpp1
-rw-r--r--src/ai/api/ai_marine.cpp4
-rw-r--r--src/ai/api/ai_object.cpp14
-rw-r--r--src/ai/api/ai_order.cpp6
-rw-r--r--src/ai/api/ai_rail.cpp8
-rw-r--r--src/ai/api/ai_road.cpp6
-rw-r--r--src/ai/api/ai_sign.cpp1
-rw-r--r--src/ai/api/ai_station.cpp4
-rw-r--r--src/ai/api/ai_stationlist.cpp1
-rw-r--r--src/ai/api/ai_subsidy.cpp3
-rw-r--r--src/ai/api/ai_tile.cpp7
-rw-r--r--src/ai/api/ai_tilelist.cpp7
-rw-r--r--src/ai/api/ai_town.cpp1
-rw-r--r--src/ai/api/ai_townlist.cpp1
-rw-r--r--src/ai/api/ai_tunnel.cpp4
-rw-r--r--src/ai/api/ai_vehicle.cpp4
-rw-r--r--src/ai/api/ai_vehiclelist.cpp1
-rw-r--r--src/aircraft_cmd.cpp13
-rw-r--r--src/aircraft_gui.cpp4
-rw-r--r--src/airport.cpp1
-rw-r--r--src/airport_gui.cpp4
-rw-r--r--src/animated_tile.cpp2
-rw-r--r--src/articulated_vehicles.cpp3
-rw-r--r--src/autoreplace.cpp2
-rw-r--r--src/autoreplace_cmd.cpp4
-rw-r--r--src/autoreplace_gui.cpp8
-rw-r--r--src/aystar.cpp1
-rw-r--r--src/blitter/32bpp_anim.cpp2
-rw-r--r--src/blitter/32bpp_optimized.cpp1
-rw-r--r--src/blitter/32bpp_simple.cpp1
-rw-r--r--src/blitter/8bpp_optimized.cpp1
-rw-r--r--src/bridge_gui.cpp3
-rw-r--r--src/bridge_map.cpp3
-rw-r--r--src/build_vehicle_gui.cpp10
-rw-r--r--src/callback_table.cpp2
-rw-r--r--src/cargopacket.cpp1
-rw-r--r--src/cargotype.cpp1
-rw-r--r--src/cheat_gui.cpp3
-rw-r--r--src/clear_cmd.cpp6
-rw-r--r--src/command.cpp1
-rw-r--r--src/company_cmd.cpp6
-rw-r--r--src/company_gui.cpp9
-rw-r--r--src/console.cpp6
-rw-r--r--src/console_cmds.cpp1
-rw-r--r--src/console_gui.cpp3
-rw-r--r--src/core/bitmath_func.cpp16
-rw-r--r--src/currency.cpp1
-rw-r--r--src/debug.cpp1
-rw-r--r--src/dedicated.cpp2
-rw-r--r--src/depot.cpp3
-rw-r--r--src/depot_gui.cpp5
-rw-r--r--src/disaster_cmd.cpp8
-rw-r--r--src/dock_gui.cpp3
-rw-r--r--src/driver.cpp3
-rw-r--r--src/driver.h1
-rw-r--r--src/dummy_land.cpp1
-rw-r--r--src/economy.cpp17
-rw-r--r--src/effectvehicle.cpp39
-rw-r--r--src/elrail.cpp11
-rw-r--r--src/engine.cpp9
-rw-r--r--src/engine_gui.cpp6
-rw-r--r--src/fileio.cpp4
-rw-r--r--src/fios.cpp4
-rw-r--r--src/fontcache.cpp3
-rw-r--r--src/gamelog.cpp5
-rw-r--r--src/genworld.cpp5
-rw-r--r--src/genworld_gui.cpp5
-rw-r--r--src/gfx.cpp6
-rw-r--r--src/gfxinit.cpp7
-rw-r--r--src/graph_gui.cpp3
-rw-r--r--src/group_cmd.cpp8
-rw-r--r--src/group_gui.cpp7
-rw-r--r--src/heightmap.cpp4
-rw-r--r--src/highscore.cpp1
-rw-r--r--src/highscore_gui.cpp1
-rw-r--r--src/industry_cmd.cpp9
-rw-r--r--src/industry_gui.cpp5
-rw-r--r--src/intro_gui.cpp5
-rw-r--r--src/landscape.cpp10
-rw-r--r--src/main_gui.cpp8
-rw-r--r--src/map.cpp1
-rw-r--r--src/misc.cpp8
-rw-r--r--src/misc/dbg_helpers.cpp4
-rw-r--r--src/misc_cmd.cpp3
-rw-r--r--src/misc_gui.cpp18
-rw-r--r--src/mixer.cpp1
-rw-r--r--src/music/extmidi.cpp3
-rw-r--r--src/music_gui.cpp1
-rw-r--r--src/namegen.cpp2
-rw-r--r--src/network/network.cpp9
-rw-r--r--src/network/network_chat_gui.cpp5
-rw-r--r--src/network/network_client.cpp6
-rw-r--r--src/network/network_command.cpp1
-rw-r--r--src/network/network_content.cpp5
-rw-r--r--src/network/network_content_gui.cpp1
-rw-r--r--src/network/network_gamelist.cpp3
-rw-r--r--src/network/network_gui.cpp8
-rw-r--r--src/network/network_server.cpp6
-rw-r--r--src/network/network_udp.cpp4
-rw-r--r--src/newgrf.cpp11
-rw-r--r--src/newgrf_canal.cpp7
-rw-r--r--src/newgrf_cargo.cpp4
-rw-r--r--src/newgrf_commons.cpp4
-rw-r--r--src/newgrf_config.cpp4
-rw-r--r--src/newgrf_engine.cpp18
-rw-r--r--src/newgrf_generic.cpp7
-rw-r--r--src/newgrf_gui.cpp4
-rw-r--r--src/newgrf_house.cpp7
-rw-r--r--src/newgrf_industries.cpp11
-rw-r--r--src/newgrf_industrytiles.cpp6
-rw-r--r--src/newgrf_sound.cpp4
-rw-r--r--src/newgrf_spritegroup.cpp6
-rw-r--r--src/newgrf_station.cpp9
-rw-r--r--src/newgrf_text.cpp5
-rw-r--r--src/newgrf_town.cpp4
-rw-r--r--src/newgrf_townname.cpp3
-rw-r--r--src/news_gui.cpp4
-rw-r--r--src/npf.cpp12
-rw-r--r--src/oldpool.cpp1
-rw-r--r--src/openttd.cpp38
-rw-r--r--src/order_cmd.cpp12
-rw-r--r--src/order_gui.cpp11
-rw-r--r--src/osk_gui.cpp4
-rw-r--r--src/pathfind.cpp8
-rw-r--r--src/pbs.cpp10
-rw-r--r--src/queue.cpp1
-rw-r--r--src/rail.cpp8
-rw-r--r--src/rail_cmd.cpp22
-rw-r--r--src/rail_gui.cpp17
-rw-r--r--src/road.cpp4
-rw-r--r--src/road_cmd.cpp15
-rw-r--r--src/road_gui.cpp5
-rw-r--r--src/road_map.cpp5
-rw-r--r--src/roadveh_cmd.cpp17
-rw-r--r--src/roadveh_gui.cpp7
-rw-r--r--src/saveload/afterload.cpp15
-rw-r--r--src/saveload/ai_sl.cpp2
-rw-r--r--src/saveload/autoreplace_sl.cpp1
-rw-r--r--src/saveload/cargopacket_sl.cpp1
-rw-r--r--src/saveload/company_sl.cpp2
-rw-r--r--src/saveload/engine_sl.cpp1
-rw-r--r--src/saveload/map_sl.cpp1
-rw-r--r--src/saveload/misc_sl.cpp1
-rw-r--r--src/saveload/oldloader.cpp1
-rw-r--r--src/saveload/oldloader_sl.cpp3
-rw-r--r--src/saveload/saveload.cpp5
-rw-r--r--src/saveload/signs_sl.cpp3
-rw-r--r--src/saveload/strings_sl.cpp5
-rw-r--r--src/saveload/town_sl.cpp2
-rw-r--r--src/saveload/vehicle_sl.cpp1
-rw-r--r--src/screenshot.cpp4
-rw-r--r--src/settings.cpp10
-rw-r--r--src/settings_gui.cpp3
-rw-r--r--src/ship_cmd.cpp14
-rw-r--r--src/ship_gui.cpp9
-rw-r--r--src/signal.cpp11
-rw-r--r--src/signs.cpp2
-rw-r--r--src/signs_gui.cpp7
-rw-r--r--src/smallmap_gui.cpp8
-rw-r--r--src/sound.cpp3
-rw-r--r--src/sound/sdl_s.cpp1
-rw-r--r--src/spritecache.cpp7
-rw-r--r--src/station.cpp20
-rw-r--r--src/station_cmd.cpp14
-rw-r--r--src/station_gui.cpp12
-rw-r--r--src/string.cpp1
-rw-r--r--src/strings.cpp13
-rw-r--r--src/subsidy_gui.cpp2
-rw-r--r--src/terraform_cmd.cpp3
-rw-r--r--src/terraform_gui.cpp3
-rw-r--r--src/texteff.cpp4
-rw-r--r--src/tgp.cpp7
-rw-r--r--src/thread_pthread.cpp5
-rw-r--r--src/tile_map.cpp2
-rw-r--r--src/timetable_cmd.cpp3
-rw-r--r--src/timetable_gui.cpp4
-rw-r--r--src/toolbar_gui.cpp10
-rw-r--r--src/town_cmd.cpp14
-rw-r--r--src/town_gui.cpp4
-rw-r--r--src/train_cmd.cpp23
-rw-r--r--src/train_gui.cpp7
-rw-r--r--src/transparency_gui.cpp2
-rw-r--r--src/tree_cmd.cpp3
-rw-r--r--src/tunnel_map.cpp2
-rw-r--r--src/tunnelbridge_cmd.cpp14
-rw-r--r--src/unmovable_cmd.cpp8
-rw-r--r--src/vehicle.cpp19
-rw-r--r--src/vehicle_gui.cpp15
-rw-r--r--src/vehiclelist.cpp5
-rw-r--r--src/video/dedicated_v.cpp3
-rw-r--r--src/video/null_v.cpp3
-rw-r--r--src/video/sdl_v.cpp4
-rw-r--r--src/viewport.cpp11
-rw-r--r--src/water_cmd.cpp12
-rw-r--r--src/waypoint.cpp10
-rw-r--r--src/waypoint_gui.cpp3
-rw-r--r--src/widget.cpp4
-rw-r--r--src/widgets/dropdown.cpp4
-rw-r--r--src/window.cpp5
-rw-r--r--src/yapf/yapf_rail.cpp1
225 files changed, 94 insertions, 1190 deletions
diff --git a/src/ai/ai_config.cpp b/src/ai/ai_config.cpp
index 2f08e0d14..1cad24bb7 100644
--- a/src/ai/ai_config.cpp
+++ b/src/ai/ai_config.cpp
@@ -8,7 +8,6 @@
#include "../core/random_func.hpp"
#include "ai.hpp"
#include "ai_config.hpp"
-#include "ai_info.hpp"
void AIConfig::ChangeAI(const char *name, int version)
{
diff --git a/src/ai/ai_core.cpp b/src/ai/ai_core.cpp
index 60475f24b..e9e2a5bd2 100644
--- a/src/ai/ai_core.cpp
+++ b/src/ai/ai_core.cpp
@@ -3,18 +3,14 @@
/** @file ai_core.cpp Implementation of AI. */
#include "../stdafx.h"
-#include "../openttd.h"
-#include "../company_type.h"
#include "../company_base.h"
#include "../company_func.h"
#include "../debug.h"
#include "../network/network.h"
#include "../settings_type.h"
-#include "../window_type.h"
#include "../window_func.h"
#include "../command_func.h"
#include "ai.hpp"
-#include "ai_info.hpp"
#include "ai_scanner.hpp"
#include "ai_instance.hpp"
#include "ai_config.hpp"
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index a68613530..4c34531df 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -3,21 +3,14 @@
/** @file ai_gui.cpp Window for configuring the AIs */
#include "../stdafx.h"
-#include "../openttd.h"
#include "../gui.h"
#include "../window_gui.h"
#include "../company_func.h"
#include "../company_base.h"
#include "../company_gui.h"
-#include "../economy_func.h"
-#include "../variables.h"
-#include "../cargotype.h"
#include "../strings_func.h"
-#include "../core/alloc_func.hpp"
#include "../window_func.h"
-#include "../date_func.h"
#include "../gfx_func.h"
-#include "../debug.h"
#include "../command_func.h"
#include "../network/network.h"
#include "../string_func.h"
@@ -26,15 +19,10 @@
#include "../network/network_content.h"
#include "ai.hpp"
-#include "api/ai_types.hpp"
-#include "api/ai_controller.hpp"
-#include "api/ai_object.hpp"
#include "api/ai_log.hpp"
-#include "ai_info.hpp"
#include "ai_config.hpp"
#include "table/strings.h"
-#include "../table/sprites.h"
/**
* Window that let you choose an available AI.
diff --git a/src/ai/ai_info.cpp b/src/ai/ai_info.cpp
index 4c70e2ab5..8dae0511e 100644
--- a/src/ai/ai_info.cpp
+++ b/src/ai/ai_info.cpp
@@ -3,17 +3,13 @@
/** @file ai_info.cpp Implementation of AIFileInfo */
#include "../stdafx.h"
-#include "../core/alloc_func.hpp"
#include <squirrel.h>
#include "../script/squirrel.hpp"
#include "../script/squirrel_helper.hpp"
-#include "../script/squirrel_class.hpp"
-#include "../script/squirrel_std.hpp"
#include "ai.hpp"
#include "ai_info.hpp"
#include "ai_scanner.hpp"
-#include "api/ai_controller.hpp"
#include "../settings_type.h"
#include "../openttd.h"
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index 5ad763ae9..14413d0bd 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -3,13 +3,8 @@
/** @file ai_instance.cpp Implementation of AIInstance. */
#include "../stdafx.h"
-#include "../openttd.h"
#include "../debug.h"
-#include "../company_func.h"
-#include "../core/alloc_func.hpp"
-#include "../string_func.h"
#include "../settings_type.h"
-#include "../company_base.h"
#include "../vehicle_base.h"
#include "../saveload/saveload.h"
#include "table/strings.h"
@@ -22,7 +17,6 @@
#define DEFINE_SCRIPT_FILES
-#include "ai.hpp"
#include "ai_info.hpp"
#include "ai_storage.hpp"
#include "ai_instance.hpp"
diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp
index e1a58b702..e9174504f 100644
--- a/src/ai/ai_scanner.cpp
+++ b/src/ai/ai_scanner.cpp
@@ -4,13 +4,11 @@
#include "../stdafx.h"
#include "../debug.h"
-#include "../openttd.h"
#include "../string_func.h"
#include "../fileio_func.h"
#include "../fios.h"
#include "../network/network.h"
#include "../core/random_func.hpp"
-#include <sys/types.h>
#include <sys/stat.h>
#include <squirrel.h>
diff --git a/src/ai/api/ai_airport.cpp b/src/ai/api/ai_airport.cpp
index 2b0c3155b..ec3d40029 100644
--- a/src/ai/api/ai_airport.cpp
+++ b/src/ai/api/ai_airport.cpp
@@ -4,12 +4,8 @@
#include "ai_airport.hpp"
#include "ai_station.hpp"
-#include "ai_error.hpp"
-#include "../../openttd.h"
-#include "../../variables.h"
#include "../../station_map.h"
#include "../../company_func.h"
-#include "../../settings_type.h"
#include "../../command_type.h"
#include "../../town.h"
diff --git a/src/ai/api/ai_bridge.cpp b/src/ai/api/ai_bridge.cpp
index 1ca26b81d..310c23f25 100644
--- a/src/ai/api/ai_bridge.cpp
+++ b/src/ai/api/ai_bridge.cpp
@@ -5,14 +5,11 @@
#include "ai_bridge.hpp"
#include "ai_rail.hpp"
#include "../ai_instance.hpp"
-#include "../../openttd.h"
#include "../../bridge_map.h"
#include "../../strings_func.h"
#include "../../core/alloc_func.hpp"
#include "../../economy_func.h"
#include "../../settings_type.h"
-#include "../../road_map.h"
-#include "table/strings.h"
/* static */ bool AIBridge::IsValidBridge(BridgeID bridge_id)
{
diff --git a/src/ai/api/ai_bridgelist.cpp b/src/ai/api/ai_bridgelist.cpp
index 4f2fb2719..9fd6728c2 100644
--- a/src/ai/api/ai_bridgelist.cpp
+++ b/src/ai/api/ai_bridgelist.cpp
@@ -4,7 +4,6 @@
#include "ai_bridgelist.hpp"
#include "ai_bridge.hpp"
-#include "../../openttd.h"
#include "../../bridge.h"
#include "../../date_func.h"
diff --git a/src/ai/api/ai_cargo.cpp b/src/ai/api/ai_cargo.cpp
index dccf2af6e..1e2684f1a 100644
--- a/src/ai/api/ai_cargo.cpp
+++ b/src/ai/api/ai_cargo.cpp
@@ -3,7 +3,6 @@
/** @file ai_cargo.cpp Implementation of AICargo. */
#include "ai_cargo.hpp"
-#include "../../openttd.h"
#include "../../cargotype.h"
#include "../../economy_func.h"
#include "../../core/alloc_func.hpp"
diff --git a/src/ai/api/ai_cargolist.cpp b/src/ai/api/ai_cargolist.cpp
index e480895fc..fe92a3886 100644
--- a/src/ai/api/ai_cargolist.cpp
+++ b/src/ai/api/ai_cargolist.cpp
@@ -4,7 +4,6 @@
#include "ai_cargolist.hpp"
#include "ai_industry.hpp"
-#include "../../openttd.h"
#include "../../cargotype.h"
#include "../../tile_type.h"
#include "../../industry.h"
diff --git a/src/ai/api/ai_company.cpp b/src/ai/api/ai_company.cpp
index 439215a7e..a2f85e202 100644
--- a/src/ai/api/ai_company.cpp
+++ b/src/ai/api/ai_company.cpp
@@ -5,14 +5,12 @@
#include "ai_company.hpp"
#include "ai_error.hpp"
#include "ai_log.hpp"
-#include "../../openttd.h"
#include "../../command_func.h"
#include "../../company_func.h"
#include "../../company_base.h"
#include "../../economy_func.h"
#include "../../strings_func.h"
#include "../../tile_map.h"
-#include "../../variables.h"
#include "../../core/alloc_func.hpp"
#include "../../string_func.h"
#include "table/strings.h"
diff --git a/src/ai/api/ai_controller.cpp b/src/ai/api/ai_controller.cpp
index cb1fb6819..96f9715a8 100644
--- a/src/ai/api/ai_controller.cpp
+++ b/src/ai/api/ai_controller.cpp
@@ -3,18 +3,12 @@
/** @file ai_controller.cpp Implementation of AIControler. */
#include "../../stdafx.h"
-#include "../../openttd.h"
-#include "../../company_func.h"
-#include "../../core/alloc_func.hpp"
#include "../../string_func.h"
-#include "../../settings_type.h"
#include "../../company_base.h"
-#include "../../saveload/saveload.h"
#include "table/strings.h"
#include "../ai.hpp"
#include "ai_controller.hpp"
-#include "../ai_info.hpp"
#include "../ai_storage.hpp"
#include "../ai_instance.hpp"
#include "../ai_config.hpp"
diff --git a/src/ai/api/ai_depotlist.cpp b/src/ai/api/ai_depotlist.cpp
index b93ec3aef..f4cdb1a08 100644
--- a/src/ai/api/ai_depotlist.cpp
+++ b/src/ai/api/ai_depotlist.cpp
@@ -3,7 +3,6 @@
/** @file ai_depotlist.cpp Implementation of AIDepotList and friends. */
#include "ai_depotlist.hpp"
-#include "../../core/math_func.hpp"
#include "../../tile_map.h"
#include "../../company_func.h"
#include "../../depot_base.h"
diff --git a/src/ai/api/ai_engine.cpp b/src/ai/api/ai_engine.cpp
index 5d301f47c..564dbc018 100644
--- a/src/ai/api/ai_engine.cpp
+++ b/src/ai/api/ai_engine.cpp
@@ -4,18 +4,10 @@
#include "ai_engine.hpp"
#include "ai_cargo.hpp"
-#include "ai_rail.hpp"
-#include "../../openttd.h"
#include "../../company_func.h"
#include "../../strings_func.h"
-#include "../../roadveh.h"
-#include "../../train.h"
-#include "../../ship.h"
#include "../../aircraft.h"
#include "../../vehicle_func.h"
-#include "../../core/alloc_func.hpp"
-#include "../../economy_func.h"
-#include "../../core/bitmath_func.hpp"
#include "../../settings_type.h"
#include "../../articulated_vehicles.h"
#include "table/strings.h"
diff --git a/src/ai/api/ai_error.cpp b/src/ai/api/ai_error.cpp
index e060532d4..7aca7d51e 100644
--- a/src/ai/api/ai_error.cpp
+++ b/src/ai/api/ai_error.cpp
@@ -3,7 +3,6 @@
/** @file ai_error.cpp Implementation of AIError. */
#include "ai_error.hpp"
-#include "table/strings.h"
#include "../../core/bitmath_func.hpp"
AIError::AIErrorMap AIError::error_map = AIError::AIErrorMap();
diff --git a/src/ai/api/ai_event.cpp b/src/ai/api/ai_event.cpp
index b18fa4777..1d6bdbce6 100644
--- a/src/ai/api/ai_event.cpp
+++ b/src/ai/api/ai_event.cpp
@@ -2,11 +2,9 @@
/** @file ai_event.cpp Implementation of AIEvent. */
-#include "ai_event.hpp"
#include "ai_event_types.hpp"
#include <queue>
-#include <set>
struct AIEventData {
std::queue<AIEvent *> stack;
diff --git a/src/ai/api/ai_event_types.cpp b/src/ai/api/ai_event_types.cpp
index 6230caad6..1cf14f32d 100644
--- a/src/ai/api/ai_event_types.cpp
+++ b/src/ai/api/ai_event_types.cpp
@@ -3,14 +3,9 @@
/** @file ai_event_types.cpp Implementation of all EventTypes. */
#include "ai_event_types.hpp"
-#include "../../openttd.h"
-#include "../../core/alloc_func.hpp"
#include "../../strings_func.h"
-#include "../../roadveh.h"
-#include "../../train.h"
-#include "../../ship.h"
-#include "../../aircraft.h"
#include "../../settings_type.h"
+#include "../../aircraft.h"
#include "../../articulated_vehicles.h"
#include "table/strings.h"
diff --git a/src/ai/api/ai_gamesettings.cpp b/src/ai/api/ai_gamesettings.cpp
index b3b4fb85a..16c95e72b 100644
--- a/src/ai/api/ai_gamesettings.cpp
+++ b/src/ai/api/ai_gamesettings.cpp
@@ -4,7 +4,6 @@
#include "ai_gamesettings.hpp"
#include "../../settings_internal.h"
-#include "../../saveload/saveload.h"
/* static */ bool AIGameSettings::IsValid(const char *setting)
{
diff --git a/src/ai/api/ai_group.cpp b/src/ai/api/ai_group.cpp
index ea3af7d8c..23846d815 100644
--- a/src/ai/api/ai_group.cpp
+++ b/src/ai/api/ai_group.cpp
@@ -3,10 +3,8 @@
/** @file ai_group.cpp Implementation of AIGroup. */
#include "ai_group.hpp"
-#include "ai_vehicle.hpp"
#include "ai_engine.hpp"
#include "../ai_instance.hpp"
-#include "../../openttd.h"
#include "../../company_func.h"
#include "../../group.h"
#include "../../string_func.h"
diff --git a/src/ai/api/ai_grouplist.cpp b/src/ai/api/ai_grouplist.cpp
index be57b3750..6ff0c3cf5 100644
--- a/src/ai/api/ai_grouplist.cpp
+++ b/src/ai/api/ai_grouplist.cpp
@@ -3,7 +3,6 @@
/** @file ai_grouplist.cpp Implementation of AIGroupList and friends. */
#include "ai_grouplist.hpp"
-#include "../../openttd.h"
#include "../../company_func.h"
#include "../../group.h"
diff --git a/src/ai/api/ai_industry.cpp b/src/ai/api/ai_industry.cpp
index 0cb5989aa..6876b270b 100644
--- a/src/ai/api/ai_industry.cpp
+++ b/src/ai/api/ai_industry.cpp
@@ -5,13 +5,10 @@
#include "ai_industry.hpp"
#include "ai_cargo.hpp"
#include "ai_map.hpp"
-#include "../../openttd.h"
#include "../../tile_type.h"
#include "../../industry.h"
-#include "../../tile_map.h"
#include "../../strings_func.h"
#include "../../station_map.h"
-#include "../../station_func.h"
#include "table/strings.h"
/* static */ IndustryID AIIndustry::GetMaxIndustryID()
diff --git a/src/ai/api/ai_industrylist.cpp b/src/ai/api/ai_industrylist.cpp
index 8917e9cc0..ab14a3c10 100644
--- a/src/ai/api/ai_industrylist.cpp
+++ b/src/ai/api/ai_industrylist.cpp
@@ -3,7 +3,6 @@
/** @file ai_industrylist.cpp Implementation of AIIndustryList and friends. */
#include "ai_industrylist.hpp"
-#include "../../openttd.h"
#include "../../tile_type.h"
#include "../../industry.h"
diff --git a/src/ai/api/ai_industrytype.cpp b/src/ai/api/ai_industrytype.cpp
index 18ea41de5..095aaa45f 100644
--- a/src/ai/api/ai_industrytype.cpp
+++ b/src/ai/api/ai_industrytype.cpp
@@ -4,11 +4,9 @@
#include "ai_industrytype.hpp"
#include "ai_map.hpp"
-#include "../../openttd.h"
#include "../../command_type.h"
#include "../../settings_type.h"
#include "../../strings_func.h"
-#include "../../tile_type.h"
#include "../../industry.h"
/* static */ bool AIIndustryType::IsValidIndustryType(IndustryType industry_type)
diff --git a/src/ai/api/ai_industrytypelist.cpp b/src/ai/api/ai_industrytypelist.cpp
index b5ef34b50..0b1e90a65 100644
--- a/src/ai/api/ai_industrytypelist.cpp
+++ b/src/ai/api/ai_industrytypelist.cpp
@@ -3,7 +3,6 @@
/** @file ai_industrytypelist.cpp Implementation of AIIndustryTypeList. */
#include "ai_industrytypelist.hpp"
-#include "../../openttd.h"
#include "../../tile_type.h"
#include "../../industry.h"
diff --git a/src/ai/api/ai_map.cpp b/src/ai/api/ai_map.cpp
index dd6151f19..61cfed87f 100644
--- a/src/ai/api/ai_map.cpp
+++ b/src/ai/api/ai_map.cpp
@@ -3,7 +3,6 @@
/** @file ai_map.cpp Implementation of AIMap. */
#include "ai_map.hpp"
-#include "../../map_func.h"
#include "../../tile_map.h"
/* static */ bool AIMap::IsValidTile(TileIndex t)
diff --git a/src/ai/api/ai_marine.cpp b/src/ai/api/ai_marine.cpp
index d2160b4ca..e1712ab69 100644
--- a/src/ai/api/ai_marine.cpp
+++ b/src/ai/api/ai_marine.cpp
@@ -3,11 +3,7 @@
/** @file ai_marine.cpp Implementation of AIMarine. */
#include "ai_marine.hpp"
-#include "../../openttd.h"
-#include "../../command_type.h"
-#include "../../variables.h"
#include "../../station_map.h"
-#include "../../water_map.h"
#include "../../tile_cmd.h"
diff --git a/src/ai/api/ai_object.cpp b/src/ai/api/ai_object.cpp
index 1ae5b4fd0..64ae49349 100644
--- a/src/ai/api/ai_object.cpp
+++ b/src/ai/api/ai_object.cpp
@@ -2,26 +2,12 @@
/** @file ai_object.cpp Implementation of AIObject. */
-#include "ai_object.hpp"
#include "ai_log.hpp"
-#include "ai_error.hpp"
#include "table/strings.h"
-#include "../../openttd.h"
-#include "../../command_func.h"
-#include "../../map_func.h"
-#include "../../network/network.h"
-#include "../../company_func.h"
-#include "../../signs_func.h"
-#include "../../tunnelbridge.h"
-#include "../../vehicle_func.h"
-#include "../../group.h"
#include "../ai.hpp"
-#include "ai_controller.hpp"
#include "../ai_storage.hpp"
#include "../ai_instance.hpp"
-#include <vector>
-
static AIStorage *GetStorage()
{
return AIInstance::GetStorage();
diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp
index 1f30688e4..6e8b1163a 100644
--- a/src/ai/api/ai_order.cpp
+++ b/src/ai/api/ai_order.cpp
@@ -3,18 +3,12 @@
/** @file ai_order.cpp Implementation of AIOrder. */
#include "ai_order.hpp"
-#include "ai_map.hpp"
#include "ai_vehicle.hpp"
#include "../ai_instance.hpp"
-#include "../../openttd.h"
#include "../../debug.h"
#include "../../vehicle_base.h"
#include "../../depot_base.h"
-#include "../../landscape.h"
-#include "../../rail_map.h"
-#include "../../road_map.h"
#include "../../station_map.h"
-#include "../../water_map.h"
#include "../../waypoint.h"
/**
diff --git a/src/ai/api/ai_rail.cpp b/src/ai/api/ai_rail.cpp
index f35f98de3..5d08690d9 100644
--- a/src/ai/api/ai_rail.cpp
+++ b/src/ai/api/ai_rail.cpp
@@ -3,21 +3,13 @@
/** @file ai_rail.cpp Implementation of AIRail. */
#include "ai_rail.hpp"
-#include "ai_object.hpp"
#include "ai_map.hpp"
-#include "../../openttd.h"
#include "../../debug.h"
-#include "../../rail_map.h"
-#include "../../road_map.h"
-#include "../../command_type.h"
#include "../../station_map.h"
#include "../../company_func.h"
-#include "../../core/math_func.hpp"
#include "../../waypoint.h"
-#include "../../newgrf.h"
#include "../../newgrf_generic.h"
#include "../../newgrf_station.h"
-#include "../../newgrf_callbacks.h"
/* static */ bool AIRail::IsRailTile(TileIndex tile)
{
diff --git a/src/ai/api/ai_road.cpp b/src/ai/api/ai_road.cpp
index 2e3137f23..be40caf4c 100644
--- a/src/ai/api/ai_road.cpp
+++ b/src/ai/api/ai_road.cpp
@@ -4,14 +4,10 @@
#include "ai_road.hpp"
#include "ai_map.hpp"
-#include "ai_list.hpp"
-#include "../../openttd.h"
-#include "../../road_map.h"
#include "../../station_map.h"
-#include "../../tunnelbridge_map.h"
#include "../../command_type.h"
-#include "../../company_func.h"
#include "../../settings_type.h"
+#include "../../company_func.h"
#include "../../script/squirrel_helper_type.hpp"
/* static */ bool AIRoad::IsRoadTile(TileIndex tile)
diff --git a/src/ai/api/ai_sign.cpp b/src/ai/api/ai_sign.cpp
index 4683e2d32..3f397a4f0 100644
--- a/src/ai/api/ai_sign.cpp
+++ b/src/ai/api/ai_sign.cpp
@@ -5,7 +5,6 @@
#include "ai_sign.hpp"
#include "table/strings.h"
#include "../ai_instance.hpp"
-#include "../../openttd.h"
#include "../../command_func.h"
#include "../../core/alloc_func.hpp"
#include "../../signs_base.h"
diff --git a/src/ai/api/ai_station.cpp b/src/ai/api/ai_station.cpp
index 4086b56a2..364b09538 100644
--- a/src/ai/api/ai_station.cpp
+++ b/src/ai/api/ai_station.cpp
@@ -6,16 +6,12 @@
#include "ai_cargo.hpp"
#include "ai_map.hpp"
#include "ai_town.hpp"
-#include "../../openttd.h"
#include "../../command_func.h"
#include "../../debug.h"
#include "../../station_map.h"
-#include "../../variables.h"
#include "../../string_func.h"
#include "../../strings_func.h"
-#include "../../core/alloc_func.hpp"
#include "../../company_func.h"
-#include "../../settings_type.h"
#include "../../town.h"
#include "table/strings.h"
diff --git a/src/ai/api/ai_stationlist.cpp b/src/ai/api/ai_stationlist.cpp
index 43cb33878..f392513e7 100644
--- a/src/ai/api/ai_stationlist.cpp
+++ b/src/ai/api/ai_stationlist.cpp
@@ -4,7 +4,6 @@
#include "ai_stationlist.hpp"
#include "ai_vehicle.hpp"
-#include "../../openttd.h"
#include "../../company_func.h"
#include "../../station_base.h"
#include "../../vehicle_base.h"
diff --git a/src/ai/api/ai_subsidy.cpp b/src/ai/api/ai_subsidy.cpp
index 1d0ec65d1..d4a8b7e0f 100644
--- a/src/ai/api/ai_subsidy.cpp
+++ b/src/ai/api/ai_subsidy.cpp
@@ -3,10 +3,7 @@
/** @file ai_subsidy.cpp Implementation of AISubsidy. */
#include "ai_subsidy.hpp"
-#include "ai_error.hpp"
-#include "ai_company.hpp"
#include "ai_date.hpp"
-#include "../../openttd.h"
#include "../../economy_func.h"
#include "../../station_base.h"
#include "../../cargotype.h"
diff --git a/src/ai/api/ai_tile.cpp b/src/ai/api/ai_tile.cpp
index 04b8c0290..8a04c1772 100644
--- a/src/ai/api/ai_tile.cpp
+++ b/src/ai/api/ai_tile.cpp
@@ -5,14 +5,7 @@
#include "ai_tile.hpp"
#include "ai_map.hpp"
#include "ai_town.hpp"
-#include "../../openttd.h"
-#include "../../tile_map.h"
-#include "../../tile_cmd.h"
-#include "../../map_func.h"
-#include "../../variables.h"
#include "../../station_func.h"
-#include "../../command_type.h"
-#include "../../settings_type.h"
#include "../../company_func.h"
#include "../../road_map.h"
#include "../../water_map.h"
diff --git a/src/ai/api/ai_tilelist.cpp b/src/ai/api/ai_tilelist.cpp
index 2360765f4..d2fa8c468 100644
--- a/src/ai/api/ai_tilelist.cpp
+++ b/src/ai/api/ai_tilelist.cpp
@@ -4,15 +4,10 @@
#include "ai_tilelist.hpp"
#include "ai_industry.hpp"
-#include "../../openttd.h"
-#include "../../landscape.h"
-#include "../../settings_type.h"
-#include "../../station_func.h"
-#include "../../map_func.h"
#include "../../tile_map.h"
#include "../../industry_map.h"
-#include "../../station_base.h"
#include "../../station_map.h"
+#include "../../settings_type.h"
void AITileList::FixRectangleSpan(TileIndex &t1, TileIndex &t2)
{
diff --git a/src/ai/api/ai_town.cpp b/src/ai/api/ai_town.cpp
index ebb575e96..60fbdb799 100644
--- a/src/ai/api/ai_town.cpp
+++ b/src/ai/api/ai_town.cpp
@@ -7,7 +7,6 @@
#include "ai_cargo.hpp"
#include "ai_error.hpp"
#include "../../command_type.h"
-#include "../../openttd.h"
#include "../../town.h"
#include "../../strings_func.h"
#include "../../core/alloc_func.hpp"
diff --git a/src/ai/api/ai_townlist.cpp b/src/ai/api/ai_townlist.cpp
index 34612d857..d14c280c9 100644
--- a/src/ai/api/ai_townlist.cpp
+++ b/src/ai/api/ai_townlist.cpp
@@ -3,7 +3,6 @@
/** @file ai_townlist.cpp Implementation of AITownList and friends. */
#include "ai_townlist.hpp"
-#include "../../openttd.h"
#include "../../town.h"
AITownList::AITownList()
diff --git a/src/ai/api/ai_tunnel.cpp b/src/ai/api/ai_tunnel.cpp
index 6c4c7b216..2b1fb1e31 100644
--- a/src/ai/api/ai_tunnel.cpp
+++ b/src/ai/api/ai_tunnel.cpp
@@ -3,13 +3,9 @@
/** @file ai_tunnel.cpp Implementation of AITunnel. */
#include "ai_tunnel.hpp"
-#include "ai_map.hpp"
#include "ai_rail.hpp"
#include "../ai_instance.hpp"
-#include "../../openttd.h"
-#include "../../landscape.h"
#include "../../tunnel_map.h"
-#include "../../road_type.h"
#include "../../command_func.h"
#include "../../tunnelbridge.h"
#include "../../road_func.h"
diff --git a/src/ai/api/ai_vehicle.cpp b/src/ai/api/ai_vehicle.cpp
index 197b558b8..93732130b 100644
--- a/src/ai/api/ai_vehicle.cpp
+++ b/src/ai/api/ai_vehicle.cpp
@@ -2,19 +2,15 @@
/** @file ai_vehicle.cpp Implementation of AIVehicle. */
-#include "ai_vehicle.hpp"
#include "ai_engine.hpp"
#include "ai_cargo.hpp"
-#include "ai_order.hpp"
#include "ai_gamesettings.hpp"
#include "ai_group.hpp"
#include "../ai_instance.hpp"
-#include "../../openttd.h"
#include "../../company_func.h"
#include "../../aircraft.h"
#include "../../string_func.h"
#include "../../strings_func.h"
-#include "../../core/alloc_func.hpp"
#include "../../command_func.h"
#include "../../roadveh.h"
#include "../../train.h"
diff --git a/src/ai/api/ai_vehiclelist.cpp b/src/ai/api/ai_vehiclelist.cpp
index 127ac77e9..c7e75c795 100644
--- a/src/ai/api/ai_vehiclelist.cpp
+++ b/src/ai/api/ai_vehiclelist.cpp
@@ -4,7 +4,6 @@
#include "ai_vehiclelist.hpp"
#include "ai_station.hpp"
-#include "../../openttd.h"
#include "../../company_func.h"
#include "../../vehicle_base.h"
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 4a14c2887..587cf2453 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -4,22 +4,14 @@
* This file deals with aircraft and airport movements functionalities */
#include "stdafx.h"
-#include "openttd.h"
#include "aircraft.h"
#include "debug.h"
#include "landscape.h"
-#include "station_map.h"
-#include "timetable.h"
-#include "depot_func.h"
#include "news_func.h"
-#include "airport.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
-#include "newgrf_callbacks.h"
-#include "newgrf_text.h"
#include "newgrf_sound.h"
#include "spritecache.h"
-#include "cargotype.h"
#include "strings_func.h"
#include "command_func.h"
#include "window_func.h"
@@ -28,15 +20,14 @@
#include "sound_func.h"
#include "functions.h"
#include "variables.h"
-#include "cheat_func.h"
+#include "cheat_type.h"
#include "autoreplace_func.h"
#include "autoreplace_gui.h"
#include "gfx_func.h"
#include "ai/ai.hpp"
#include "company_func.h"
-#include "settings_type.h"
-#include "order_func.h"
#include "effectvehicle_func.h"
+#include "settings_type.h"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp
index d4a484a31..7097ca6c9 100644
--- a/src/aircraft_gui.cpp
+++ b/src/aircraft_gui.cpp
@@ -3,16 +3,12 @@
/** @file aircraft_gui.cpp The GUI of aircraft. */
#include "stdafx.h"
-#include "openttd.h"
#include "aircraft.h"
-#include "debug.h"
-#include "gui.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "strings_func.h"
#include "vehicle_func.h"
#include "gfx_func.h"
-#include "order_func.h"
#include "window_gui.h"
#include "table/sprites.h"
diff --git a/src/airport.cpp b/src/airport.cpp
index 5872cc422..d099cc34b 100644
--- a/src/airport.cpp
+++ b/src/airport.cpp
@@ -3,7 +3,6 @@
/** @file airport.cpp Functions related to airports. */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
#include "airport.h"
#include "airport_movement.h"
diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp
index eefc1f1f5..ff6a70627 100644
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -3,12 +3,9 @@
/** @file airport_gui.cpp The GUI for airports. */
#include "stdafx.h"
-#include "openttd.h"
#include "window_gui.h"
-#include "gui.h"
#include "station_gui.h"
#include "terraform_gui.h"
-#include "command_func.h"
#include "airport.h"
#include "sound_func.h"
#include "window_func.h"
@@ -17,7 +14,6 @@
#include "viewport_func.h"
#include "gfx_func.h"
#include "company_func.h"
-#include "order_func.h"
#include "station_type.h"
#include "tilehighlight_func.h"
#include "company_base.h"
diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp
index fd3fc12f8..5f499ace8 100644
--- a/src/animated_tile.cpp
+++ b/src/animated_tile.cpp
@@ -3,8 +3,6 @@
/** @file animated_tile.cpp Everything related to animated tiles. */
#include "stdafx.h"
-#include "openttd.h"
-#include "landscape.h"
#include "core/alloc_func.hpp"
#include "functions.h"
diff --git a/src/articulated_vehicles.cpp b/src/articulated_vehicles.cpp
index bb21b49f8..0c4eeec8e 100644
--- a/src/articulated_vehicles.cpp
+++ b/src/articulated_vehicles.cpp
@@ -3,11 +3,8 @@
/** @file articulated_vehicles.cpp Implementation of articulated vehicles. */
#include "stdafx.h"
-#include "openttd.h"
-#include "articulated_vehicles.h"
#include "train.h"
#include "roadveh.h"
-#include "newgrf_callbacks.h"
#include "newgrf_engine.h"
#include "vehicle_func.h"
diff --git a/src/autoreplace.cpp b/src/autoreplace.cpp
index 830236019..f37731d14 100644
--- a/src/autoreplace.cpp
+++ b/src/autoreplace.cpp
@@ -3,8 +3,6 @@
/** @file autoreplace.cpp Management of replacement lists. */
#include "stdafx.h"
-#include "openttd.h"
-#include "debug.h"
#include "command_func.h"
#include "group.h"
#include "autoreplace_base.h"
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index c0483ff1c..3cad32e25 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -3,13 +3,9 @@
/** @file autoreplace_cmd.cpp Deals with autoreplace execution but not the setup */
#include "stdafx.h"
-#include "openttd.h"
#include "company_func.h"
-#include "debug.h"
#include "vehicle_gui.h"
#include "train.h"
-#include "aircraft.h"
-#include "roadveh.h"
#include "rail.h"
#include "command_func.h"
#include "engine_base.h"
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 2e6558956..c36142bc9 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -3,29 +3,21 @@
/** @file autoreplace_gui.cpp GUI for autoreplace handling. */
#include "stdafx.h"
-#include "openttd.h"
-#include "debug.h"
-#include "gui.h"
#include "command_func.h"
-#include "variables.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
#include "group.h"
#include "rail.h"
#include "strings_func.h"
#include "window_func.h"
-#include "vehicle_func.h"
#include "autoreplace_func.h"
#include "gfx_func.h"
#include "company_func.h"
#include "widgets/dropdown_type.h"
-#include "widgets/dropdown_func.h"
-#include "engine_func.h"
#include "engine_base.h"
#include "window_gui.h"
#include "engine_gui.h"
-#include "table/sprites.h"
#include "table/strings.h"
void DrawEngineList(VehicleType type, int x, int r, int y, const GUIEngineList *eng_list, uint16 min, uint16 max, EngineID selected_id, int count_location, GroupID selected_group);
diff --git a/src/aystar.cpp b/src/aystar.cpp
index be1e6aaf8..d34e9911d 100644
--- a/src/aystar.cpp
+++ b/src/aystar.cpp
@@ -19,7 +19,6 @@
*/
#include "stdafx.h"
-#include "openttd.h"
#include "aystar.h"
#include "core/alloc_func.hpp"
diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp
index d9e8eea45..2b7887855 100644
--- a/src/blitter/32bpp_anim.cpp
+++ b/src/blitter/32bpp_anim.cpp
@@ -6,8 +6,6 @@
#include "../core/alloc_func.hpp"
#include "../core/math_func.hpp"
#include "../gfx_func.h"
-#include "../zoom_func.h"
-#include "../debug.h"
#include "../video/video_driver.hpp"
#include "32bpp_anim.hpp"
diff --git a/src/blitter/32bpp_optimized.cpp b/src/blitter/32bpp_optimized.cpp
index 717701bce..d37615448 100644
--- a/src/blitter/32bpp_optimized.cpp
+++ b/src/blitter/32bpp_optimized.cpp
@@ -5,7 +5,6 @@
#include "../stdafx.h"
#include "../zoom_func.h"
#include "../gfx_func.h"
-#include "../debug.h"
#include "../core/math_func.hpp"
#include "../core/alloc_func.hpp"
#include "32bpp_optimized.hpp"
diff --git a/src/blitter/32bpp_simple.cpp b/src/blitter/32bpp_simple.cpp
index 0d60a7234..7b46af10f 100644
--- a/src/blitter/32bpp_simple.cpp
+++ b/src/blitter/32bpp_simple.cpp
@@ -5,7 +5,6 @@
#include "../stdafx.h"
#include "../gfx_func.h"
#include "../zoom_func.h"
-#include "../debug.h"
#include "32bpp_simple.hpp"
#include "../table/sprites.h"
diff --git a/src/blitter/8bpp_optimized.cpp b/src/blitter/8bpp_optimized.cpp
index 656f910f2..f002dc070 100644
--- a/src/blitter/8bpp_optimized.cpp
+++ b/src/blitter/8bpp_optimized.cpp
@@ -4,7 +4,6 @@
#include "../stdafx.h"
#include "../zoom_func.h"
-#include "../debug.h"
#include "../core/alloc_func.hpp"
#include "../core/math_func.hpp"
#include "8bpp_optimized.hpp"
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index d27d1589b..21f3c5528 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -3,18 +3,15 @@
/** @file bridge_gui.cpp Graphical user interface for bridge construction */
#include "stdafx.h"
-#include "openttd.h"
#include "gui.h"
#include "window_gui.h"
#include "command_func.h"
#include "economy_func.h"
-#include "variables.h"
#include "bridge.h"
#include "strings_func.h"
#include "window_func.h"
#include "sound_func.h"
#include "map_func.h"
-#include "viewport_func.h"
#include "gfx_func.h"
#include "tunnelbridge.h"
#include "sortlist_type.h"
diff --git a/src/bridge_map.cpp b/src/bridge_map.cpp
index 8509f305f..6ebd33348 100644
--- a/src/bridge_map.cpp
+++ b/src/bridge_map.cpp
@@ -3,10 +3,7 @@
/** @file bridge_map.cpp Map accessor functions for bridges. */
#include "stdafx.h"
-#include "openttd.h"
#include "bridge_map.h"
-#include "bridge.h"
-#include "variables.h"
#include "landscape.h"
#include "tunnelbridge_map.h"
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index a7840150f..a3e104a0c 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -2,34 +2,26 @@
/** @file build_vehicle_gui.cpp GUI for building vehicles. */
-#include "stdafx.h"
-#include "openttd.h"
#include "train.h"
#include "roadveh.h"
#include "ship.h"
#include "aircraft.h"
-#include "debug.h"
-#include "gui.h"
#include "articulated_vehicles.h"
#include "textbuf_gui.h"
#include "command_func.h"
#include "company_func.h"
-#include "airport.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
-#include "cargotype.h"
#include "group.h"
-#include "road_map.h"
#include "strings_func.h"
#include "window_func.h"
#include "date_func.h"
#include "vehicle_func.h"
-#include "settings_type.h"
#include "gfx_func.h"
#include "widgets/dropdown_func.h"
-#include "string_func.h"
#include "window_gui.h"
#include "engine_gui.h"
+#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/callback_table.cpp b/src/callback_table.cpp
index 0bab10759..f1da41847 100644
--- a/src/callback_table.cpp
+++ b/src/callback_table.cpp
@@ -3,8 +3,8 @@
/** @file callback_table.cpp All command callbacks. */
#include "stdafx.h"
-#include "openttd.h"
#include "callback_table.h"
+#include "command_type.h"
/* If you add a callback for DoCommandP, also add the callback in here
* see below for the full list!
diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp
index 3c043829a..f94363fd9 100644
--- a/src/cargopacket.cpp
+++ b/src/cargopacket.cpp
@@ -4,7 +4,6 @@
#include "stdafx.h"
#include "station_base.h"
-#include "cargopacket.h"
#include "oldpool_func.h"
/* Initialize the cargopacket-pool */
diff --git a/src/cargotype.cpp b/src/cargotype.cpp
index 7f9cd956b..7c533b527 100644
--- a/src/cargotype.cpp
+++ b/src/cargotype.cpp
@@ -3,7 +3,6 @@
/** @file cargotype.cpp Implementation of cargos. */
#include "stdafx.h"
-#include "openttd.h"
#include "newgrf_cargo.h"
#include "cargotype.h"
#include "core/bitmath_func.hpp"
diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp
index 1ddb1c662..bfb9a2b6f 100644
--- a/src/cheat_gui.cpp
+++ b/src/cheat_gui.cpp
@@ -3,9 +3,8 @@
/** @file cheat_gui.cpp GUI related to cheating. */
#include "stdafx.h"
-#include "openttd.h"
#include "command_func.h"
-#include "cheat_func.h"
+#include "cheat_type.h"
#include "company_base.h"
#include "company_func.h"
#include "gfx_func.h"
diff --git a/src/clear_cmd.cpp b/src/clear_cmd.cpp
index 81d45bbaa..9892fe0b1 100644
--- a/src/clear_cmd.cpp
+++ b/src/clear_cmd.cpp
@@ -6,19 +6,15 @@
#include "openttd.h"
#include "clear_map.h"
#include "command_func.h"
-#include "bridge.h"
#include "landscape.h"
#include "variables.h"
-#include "unmovable_map.h"
#include "genworld.h"
#include "industry.h"
-#include "water_map.h"
-#include "tile_cmd.h"
#include "functions.h"
#include "economy_func.h"
#include "viewport_func.h"
-#include "settings_type.h"
#include "water.h"
+#include "settings_type.h"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/command.cpp b/src/command.cpp
index aa0d48e42..73d44393b 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -9,7 +9,6 @@
#include "gui.h"
#include "command_func.h"
#include "network/network.h"
-#include "variables.h"
#include "genworld.h"
#include "newgrf_storage.h"
#include "strings_func.h"
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 31e9bcef0..a5ebc3e36 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -4,7 +4,6 @@
#include "stdafx.h"
#include "openttd.h"
-#include "engine_func.h"
#include "engine_base.h"
#include "company_func.h"
#include "company_gui.h"
@@ -22,23 +21,18 @@
#include "tile_map.h"
#include "strings_func.h"
#include "gfx_func.h"
-#include "functions.h"
#include "date_func.h"
-#include "vehicle_func.h"
#include "sound_func.h"
#include "core/alloc_func.hpp"
-#include "core/sort_func.hpp"
#include "autoreplace_func.h"
#include "autoreplace_gui.h"
#include "string_func.h"
#include "road_func.h"
#include "rail.h"
#include "sprite.h"
-#include "debug.h"
#include "oldpool_func.h"
#include "table/strings.h"
-#include "table/sprites.h"
CompanyByte _local_company;
CompanyByte _current_company;
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 9f9339f05..913331d6f 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -9,29 +9,22 @@
#include "viewport_func.h"
#include "gfx_func.h"
#include "company_func.h"
-#include "company_base.h"
#include "command_func.h"
#include "network/network.h"
#include "network/network_gui.h"
#include "network/network_func.h"
-#include "variables.h"
#include "roadveh.h"
#include "train.h"
#include "aircraft.h"
#include "newgrf.h"
#include "company_manager_face.h"
#include "strings_func.h"
-#include "functions.h"
-#include "window_func.h"
#include "date_func.h"
#include "string_func.h"
-#include "settings_type.h"
-#include "widgets/dropdown_func.h"
#include "widgets/dropdown_type.h"
#include "tilehighlight_func.h"
-#include "highscore.h"
+#include "settings_type.h"
-#include "table/sprites.h"
#include "table/strings.h"
enum {
diff --git a/src/console.cpp b/src/console.cpp
index b0a5191a1..e9d0286d1 100644
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -4,18 +4,14 @@
#include "stdafx.h"
#include "core/alloc_func.hpp"
-#include "string_func.h"
-#include "strings_type.h"
#include "core/math_func.hpp"
+#include "string_func.h"
#include "console_internal.h"
#include "network/network.h"
#include "network/network_func.h"
-#include "rev.h"
#include <stdarg.h>
-#include "table/strings.h"
-
#define ICON_BUFFER 79
#define ICON_HISTORY_SIZE 20
#define ICON_LINE_HEIGHT 12
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp
index fdd620a8c..3fb5d8234 100644
--- a/src/console_cmds.cpp
+++ b/src/console_cmds.cpp
@@ -22,7 +22,6 @@
#include "strings_func.h"
#include "viewport_func.h"
#include "window_func.h"
-#include "functions.h"
#include "map_func.h"
#include "date_func.h"
#include "vehicle_func.h"
diff --git a/src/console_gui.cpp b/src/console_gui.cpp
index d06833820..e2bbf11f6 100644
--- a/src/console_gui.cpp
+++ b/src/console_gui.cpp
@@ -3,12 +3,9 @@
/** @file console_gui.cpp Handling the GUI of the in-game console. */
#include "stdafx.h"
-#include "openttd.h"
#include "textbuf_gui.h"
#include "window_gui.h"
#include "console_gui.h"
-#include <stdarg.h>
-#include <string.h>
#include "console_internal.h"
#include "window_func.h"
#include "string_func.h"
diff --git a/src/core/bitmath_func.cpp b/src/core/bitmath_func.cpp
index 1b8662386..12df3c780 100644
--- a/src/core/bitmath_func.cpp
+++ b/src/core/bitmath_func.cpp
@@ -6,14 +6,14 @@
#include "bitmath_func.hpp"
const uint8 _ffb_64[64] = {
- 0, 0, 1, 0, 2, 0, 1, 0,
- 3, 0, 1, 0, 2, 0, 1, 0,
- 4, 0, 1, 0, 2, 0, 1, 0,
- 3, 0, 1, 0, 2, 0, 1, 0,
- 5, 0, 1, 0, 2, 0, 1, 0,
- 3, 0, 1, 0, 2, 0, 1, 0,
- 4, 0, 1, 0, 2, 0, 1, 0,
- 3, 0, 1, 0, 2, 0, 1, 0,
+ 0, 0, 1, 0, 2, 0, 1, 0,
+ 3, 0, 1, 0, 2, 0, 1, 0,
+ 4, 0, 1, 0, 2, 0, 1, 0,
+ 3, 0, 1, 0, 2, 0, 1, 0,
+ 5, 0, 1, 0, 2, 0, 1, 0,
+ 3, 0, 1, 0, 2, 0, 1, 0,
+ 4, 0, 1, 0, 2, 0, 1, 0,
+ 3, 0, 1, 0, 2, 0, 1, 0,
};
/**
diff --git a/src/currency.cpp b/src/currency.cpp
index c40c6ec9c..73b2dd7b1 100644
--- a/src/currency.cpp
+++ b/src/currency.cpp
@@ -3,7 +3,6 @@
/** @file currency.cpp Support for different currencies. */
#include "stdafx.h"
-#include "openttd.h"
#include "currency.h"
#include "news_func.h"
#include "settings_type.h"
diff --git a/src/debug.cpp b/src/debug.cpp
index 62f75e157..7717749f0 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -5,7 +5,6 @@
#include "stdafx.h"
#include <stdio.h>
#include <stdarg.h>
-#include "openttd.h"
#include "console_func.h"
#include "debug.h"
#include "string_func.h"
diff --git a/src/dedicated.cpp b/src/dedicated.cpp
index cb760c208..42f885da9 100644
--- a/src/dedicated.cpp
+++ b/src/dedicated.cpp
@@ -8,10 +8,8 @@
#if defined(UNIX) && !defined(__MORPHOS__)
-#include "openttd.h"
#include "variables.h"
-#include <sys/types.h>
#include <unistd.h>
#if defined(SUNOS) && !defined(_LP64) && !defined(_I32LPx)
diff --git a/src/depot.cpp b/src/depot.cpp
index cf6ec603a..e8b6b3e5c 100644
--- a/src/depot.cpp
+++ b/src/depot.cpp
@@ -4,13 +4,10 @@
#include "stdafx.h"
#include "depot_base.h"
-#include "landscape.h"
#include "order_func.h"
#include "window_func.h"
#include "oldpool_func.h"
-#include "table/strings.h"
-
DEFINE_OLD_POOL_GENERIC(Depot, Depot)
/**
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index c33ab9404..c964d4298 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -2,10 +2,7 @@
/** @file depot_gui.cpp The GUI for depots. */
-#include "stdafx.h"
-#include "openttd.h"
#include "train.h"
-#include "roadveh.h"
#include "ship.h"
#include "aircraft.h"
#include "gui.h"
@@ -15,14 +12,12 @@
#include "command_func.h"
#include "depot_base.h"
#include "vehicle_gui.h"
-#include "station_map.h"
#include "newgrf_engine.h"
#include "spritecache.h"
#include "strings_func.h"
#include "window_func.h"
#include "vehicle_func.h"
#include "company_func.h"
-#include "order_func.h"
#include "tilehighlight_func.h"
#include "window_gui.h"
#include "vehiclelist.h"
diff --git a/src/disaster_cmd.cpp b/src/disaster_cmd.cpp
index 221e59962..709e73c71 100644
--- a/src/disaster_cmd.cpp
+++ b/src/disaster_cmd.cpp
@@ -17,27 +17,19 @@
#include "stdafx.h"
-#include "openttd.h"
#include "landscape.h"
#include "industry_map.h"
#include "station_map.h"
#include "command_func.h"
-#include "tile_cmd.h"
#include "news_func.h"
-#include "station_base.h"
-#include "waypoint.h"
#include "town.h"
-#include "industry.h"
#include "company_func.h"
-#include "airport.h"
#include "variables.h"
-#include "settings_type.h"
#include "strings_func.h"
#include "date_func.h"
#include "functions.h"
#include "vehicle_func.h"
-#include "vehicle_base.h"
#include "sound_func.h"
#include "effectvehicle_func.h"
#include "roadveh.h"
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp
index 7cc13acdb..433d4c34a 100644
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -6,12 +6,10 @@
#include "openttd.h"
#include "tile_map.h"
#include "station_type.h"
-#include "gui.h"
#include "terraform_gui.h"
#include "window_gui.h"
#include "station_gui.h"
#include "command_func.h"
-#include "settings_type.h"
#include "water.h"
#include "window_func.h"
#include "vehicle_func.h"
@@ -22,6 +20,7 @@
#include "slope_func.h"
#include "tilehighlight_func.h"
#include "company_base.h"
+#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/driver.cpp b/src/driver.cpp
index f1b2d5927..5d5a86cd9 100644
--- a/src/driver.cpp
+++ b/src/driver.cpp
@@ -3,10 +3,7 @@
/** @file driver.cpp Base for all driver handling. */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
-#include "driver.h"
-
#include "sound/sound_driver.hpp"
#include "music/music_driver.hpp"
#include "video/video_driver.hpp"
diff --git a/src/driver.h b/src/driver.h
index 727e9875f..61fede9c4 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -5,7 +5,6 @@
#ifndef DRIVER_H
#define DRIVER_H
-#include "debug.h"
#include "core/enum_type.hpp"
#include "string_func.h"
#include <map>
diff --git a/src/dummy_land.cpp b/src/dummy_land.cpp
index de244f99b..c28952fea 100644
--- a/src/dummy_land.cpp
+++ b/src/dummy_land.cpp
@@ -3,7 +3,6 @@
/** @file dummy_land.cpp Handling of void (or dummy) tiles. */
#include "stdafx.h"
-#include "openttd.h"
#include "tile_cmd.h"
#include "command_func.h"
#include "viewport_func.h"
diff --git a/src/economy.cpp b/src/economy.cpp
index a10b54e8f..4c5fe53cd 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -4,49 +4,34 @@
#include "stdafx.h"
#include "openttd.h"
-#include "currency.h"
-#include "landscape.h"
-#include "company_base.h"
+#include "tile_cmd.h"
#include "company_func.h"
#include "command_func.h"
-#include "industry.h"
#include "industry_map.h"
#include "town.h"
#include "news_func.h"
#include "network/network.h"
#include "network/network_func.h"
-#include "variables.h"
#include "vehicle_gui.h"
#include "ai/ai.hpp"
-#include "train.h"
-#include "roadveh.h"
#include "aircraft.h"
#include "newgrf_engine.h"
#include "newgrf_sound.h"
-#include "newgrf_callbacks.h"
#include "newgrf_industries.h"
#include "newgrf_industrytiles.h"
#include "newgrf_station.h"
#include "unmovable.h"
-#include "cargotype.h"
#include "group.h"
#include "strings_func.h"
-#include "tile_cmd.h"
#include "functions.h"
#include "window_func.h"
#include "date_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
-#include "track_type.h"
-#include "track_func.h"
-#include "road_func.h"
-#include "rail_map.h"
-#include "signal_func.h"
#include "gfx_func.h"
#include "autoreplace_func.h"
#include "company_gui.h"
#include "signs_base.h"
-#include "core/smallvec_type.hpp"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/effectvehicle.cpp b/src/effectvehicle.cpp
index 4d13684f1..9ad90f120 100644
--- a/src/effectvehicle.cpp
+++ b/src/effectvehicle.cpp
@@ -3,54 +3,15 @@
/** @file effectvehicle.cpp Implementation of everything generic to vehicles. */
#include "stdafx.h"
-#include "openttd.h"
-#include "road_map.h"
-#include "roadveh.h"
-#include "ship.h"
-#include "spritecache.h"
-#include "tile_cmd.h"
#include "landscape.h"
-#include "timetable.h"
-#include "viewport_func.h"
-#include "gfx_func.h"
-#include "news_func.h"
-#include "command_func.h"
-#include "company_func.h"
-#include "debug.h"
-#include "vehicle_gui.h"
-#include "rail_type.h"
-#include "train.h"
-#include "aircraft.h"
#include "industry_map.h"
-#include "station_map.h"
-#include "water_map.h"
-#include "yapf/yapf.h"
-#include "newgrf_callbacks.h"
-#include "newgrf_engine.h"
-#include "newgrf_sound.h"
-#include "group.h"
-#include "order_func.h"
-#include "strings_func.h"
-#include "zoom_func.h"
-#include "functions.h"
-#include "date_func.h"
-#include "window_func.h"
#include "vehicle_func.h"
-#include "signal_func.h"
#include "sound_func.h"
-#include "variables.h"
-#include "autoreplace_func.h"
-#include "autoreplace_gui.h"
-#include "string_func.h"
-#include "settings_type.h"
-#include "oldpool_func.h"
-#include "depot_map.h"
#include "animated_tile_func.h"
#include "effectvehicle_base.h"
#include "effectvehicle_func.h"
#include "table/sprites.h"
-#include "table/strings.h"
static void ChimneySmokeInit(Vehicle *v)
{
diff --git a/src/elrail.cpp b/src/elrail.cpp
index 8188c8b49..08bd0f653 100644
--- a/src/elrail.cpp
+++ b/src/elrail.cpp
@@ -50,23 +50,12 @@
#include "openttd.h"
#include "station_map.h"
#include "viewport_func.h"
-#include "settings_type.h"
#include "landscape.h"
-#include "rail_type.h"
-#include "debug.h"
-#include "tunnel_map.h"
-#include "road_map.h"
-#include "bridge_map.h"
-#include "bridge.h"
-#include "rail_map.h"
#include "train.h"
#include "rail_gui.h"
-#include "transparency.h"
#include "tunnelbridge_map.h"
#include "vehicle_func.h"
-#include "company_base.h"
#include "tunnelbridge.h"
-#include "engine_func.h"
#include "elrail_func.h"
#include "engine_base.h"
diff --git a/src/engine.cpp b/src/engine.cpp
index 37886699d..1e388a3e1 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -3,30 +3,25 @@
/** @file engine.cpp Base for all engine handling. */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
-#include "company_base.h"
#include "company_func.h"
#include "command_func.h"
#include "news_func.h"
#include "variables.h"
-#include "train.h"
#include "aircraft.h"
-#include "newgrf_cargo.h"
#include "newgrf_engine.h"
#include "group.h"
#include "strings_func.h"
#include "gfx_func.h"
-#include "functions.h"
+#include "core/random_func.hpp"
#include "window_func.h"
#include "date_func.h"
#include "autoreplace_gui.h"
#include "string_func.h"
-#include "settings_type.h"
#include "oldpool_func.h"
#include "ai/ai.hpp"
-#include "core/alloc_func.hpp"
#include "vehicle_func.h"
+#include "settings_type.h"
#include "table/strings.h"
#include "table/engines.h"
diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp
index 2593994b7..0cf3d99d3 100644
--- a/src/engine_gui.cpp
+++ b/src/engine_gui.cpp
@@ -3,16 +3,12 @@
/** @file engine_gui.cpp GUI to show engine related information. */
#include "stdafx.h"
-#include "openttd.h"
-#include "gui.h"
#include "window_gui.h"
#include "gfx_func.h"
#include "engine_func.h"
#include "engine_base.h"
#include "command_func.h"
-#include "economy_func.h"
-#include "news_func.h"
-#include "variables.h"
+#include "news_type.h"
#include "newgrf_engine.h"
#include "strings_func.h"
#include "engine_gui.h"
diff --git a/src/fileio.cpp b/src/fileio.cpp
index be6144160..19f4f4de1 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -3,20 +3,16 @@
/** @file fileio.cpp Standard In/Out file operations */
#include "stdafx.h"
-#include "openttd.h"
#include "fileio_func.h"
#include "variables.h"
#include "debug.h"
#include "fios.h"
-#include "core/alloc_func.hpp"
-#include "core/math_func.hpp"
#include "string_func.h"
#include "tar_type.h"
#ifdef WIN32
#include <windows.h>
#else
#include <pwd.h>
-#include <unistd.h>
#endif
#include <sys/stat.h>
#include <algorithm>
diff --git a/src/fios.cpp b/src/fios.cpp
index b822167b0..28d09a2a0 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -6,13 +6,9 @@
#include "stdafx.h"
#include "openttd.h"
-#include "variables.h"
-#include "heightmap.h"
#include "fios.h"
#include "fileio_func.h"
-#include "functions.h"
#include "string_func.h"
-#include <sys/types.h>
#include <sys/stat.h>
#ifdef WIN32
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index d76172a2e..bc28c1034 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -3,11 +3,8 @@
/** @file fontcache.cpp Cache for characters from fonts. */
#include "stdafx.h"
-#include "openttd.h"
-#include "debug.h"
#include "spritecache.h"
#include "fontcache.h"
-#include "spriteloader/spriteloader.hpp"
#include "blitter/factory.hpp"
#include "gfx_func.h"
#include "core/alloc_func.hpp"
diff --git a/src/gamelog.cpp b/src/gamelog.cpp
index 3f29aaec3..65340a2a5 100644
--- a/src/gamelog.cpp
+++ b/src/gamelog.cpp
@@ -6,20 +6,15 @@
#include "openttd.h"
#include "saveload/saveload.h"
#include "core/alloc_func.hpp"
-#include "core/bitmath_func.hpp"
-#include "core/math_func.hpp"
-#include "network/core/config.h"
#include "variables.h"
#include "string_func.h"
#include "settings_type.h"
-#include "newgrf_config.h"
#include "gamelog.h"
#include "gamelog_internal.h"
#include "console_func.h"
#include "debug.h"
#include "rev.h"
-#include <string.h>
#include <stdarg.h>
extern const uint16 SAVEGAME_VERSION; ///< current savegame version
diff --git a/src/genworld.cpp b/src/genworld.cpp
index a238853a1..cf50e8eb3 100644
--- a/src/genworld.cpp
+++ b/src/genworld.cpp
@@ -13,22 +13,19 @@
#include "gfxinit.h"
#include "window_func.h"
#include "network/network.h"
-#include "debug.h"
-#include "settings_func.h"
#include "heightmap.h"
#include "viewport_func.h"
#include "gfx_func.h"
-#include "map_func.h"
#include "date_func.h"
#include "core/random_func.hpp"
#include "engine_func.h"
-#include "settings_type.h"
#include "newgrf_storage.h"
#include "water.h"
#include "blitter/factory.hpp"
#include "tilehighlight_func.h"
#include "saveload/saveload.h"
#include "void_map.h"
+#include "settings_type.h"
#include "table/sprites.h"
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 056d58b9f..4be385a72 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -6,16 +6,11 @@
#include "openttd.h"
#include "heightmap.h"
#include "gui.h"
-#include "window_gui.h"
-#include "textbuf_gui.h"
-#include "gfxinit.h"
-#include "command_func.h"
#include "variables.h"
#include "settings_func.h"
#include "debug.h"
#include "genworld.h"
#include "network/network.h"
-#include "thread.h"
#include "newgrf_config.h"
#include "strings_func.h"
#include "window_func.h"
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 81bbe69c6..af699c665 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -3,19 +3,15 @@
/** @file gfx.cpp Handling of drawing text and other gfx related stuff. */
#include "stdafx.h"
-#include "openttd.h"
#include "gfx_func.h"
-#include "spritecache.h"
#include "variables.h"
+#include "spritecache.h"
#include "fontcache.h"
#include "genworld.h"
-#include "debug.h"
#include "zoom_func.h"
-#include "texteff.hpp"
#include "blitter/factory.hpp"
#include "video/video_driver.hpp"
#include "strings_func.h"
-#include "core/math_func.hpp"
#include "settings_type.h"
#include "core/alloc_func.hpp"
#include "core/sort_func.hpp"
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index f0c529d4d..2db1a4c16 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -3,21 +3,14 @@
/** @file gfxinit.cpp Initializing of the (GRF) graphics. */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
-#include "gfxinit.h"
#include "spritecache.h"
#include "fileio_func.h"
#include "fios.h"
#include "newgrf.h"
#include "md5.h"
-#include "variables.h"
#include "fontcache.h"
#include "gfx_func.h"
-#include "core/alloc_func.hpp"
-#include "core/bitmath_func.hpp"
-#include "core/smallvec_type.hpp"
-#include <string.h>
#include "settings_type.h"
#include "string_func.h"
#include "ini_type.h"
diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp
index 704b84e4e..acd220a2e 100644
--- a/src/graph_gui.cpp
+++ b/src/graph_gui.cpp
@@ -9,17 +9,14 @@
#include "company_base.h"
#include "company_gui.h"
#include "economy_func.h"
-#include "variables.h"
#include "cargotype.h"
#include "strings_func.h"
-#include "core/alloc_func.hpp"
#include "window_func.h"
#include "date_func.h"
#include "gfx_func.h"
#include "sortlist_type.h"
#include "table/strings.h"
-#include "table/sprites.h"
/* Bitmasks of company and cargo indices that shouldn't be drawn. */
static uint _legend_excluded_companies;
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index dc32e2f5a..6ec8f5f29 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -3,23 +3,17 @@
/** @file group_cmd.cpp Handling of the engine groups */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
#include "command_func.h"
-#include "debug.h"
#include "group.h"
#include "train.h"
-#include "aircraft.h"
+#include "engine_base.h"
#include "vehicle_gui.h"
-#include "strings_func.h"
-#include "functions.h"
#include "window_func.h"
#include "vehicle_func.h"
#include "autoreplace_base.h"
#include "autoreplace_func.h"
#include "string_func.h"
#include "company_func.h"
-#include "order_func.h"
#include "oldpool_func.h"
#include "core/alloc_func.hpp"
diff --git a/src/group_gui.cpp b/src/group_gui.cpp
index 7fde5ddc3..3ec866801 100644
--- a/src/group_gui.cpp
+++ b/src/group_gui.cpp
@@ -4,22 +4,17 @@
#include "stdafx.h"
#include "openttd.h"
-#include "gui.h"
#include "window_gui.h"
#include "textbuf_gui.h"
#include "command_func.h"
#include "vehicle_gui.h"
#include "vehicle_gui_base.h"
-#include "train.h"
+#include "vehicle_base.h"
#include "group.h"
-#include "debug.h"
#include "strings_func.h"
-#include "core/alloc_func.hpp"
#include "window_func.h"
#include "vehicle_func.h"
#include "autoreplace_gui.h"
-#include "string_func.h"
-#include "viewport_func.h"
#include "gfx_func.h"
#include "company_func.h"
#include "widgets/dropdown_type.h"
diff --git a/src/heightmap.cpp b/src/heightmap.cpp
index 2a4186aa6..27d247bfa 100644
--- a/src/heightmap.cpp
+++ b/src/heightmap.cpp
@@ -3,17 +3,13 @@
/** @file heightmap.cpp Creating of maps from heightmaps. */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
#include "heightmap.h"
#include "clear_map.h"
#include "void_map.h"
-#include "debug.h"
#include "gui.h"
#include "saveload/saveload.h"
#include "bmp.h"
#include "gfx_func.h"
-#include "core/alloc_func.hpp"
#include "fios.h"
#include "settings_type.h"
diff --git a/src/highscore.cpp b/src/highscore.cpp
index c109c7539..34447a2c3 100644
--- a/src/highscore.cpp
+++ b/src/highscore.cpp
@@ -3,7 +3,6 @@
/** @file highscore.cpp Definition of functions used for highscore handling */
#include "highscore.h"
-#include "table/strings.h"
#include "settings_type.h"
#include "company_base.h"
#include "company_func.h"
diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp
index ed6c23f4e..d6400bb6a 100644
--- a/src/highscore_gui.cpp
+++ b/src/highscore_gui.cpp
@@ -10,7 +10,6 @@
#include "window_func.h"
#include "network/network.h"
#include "command_func.h"
-#include "command_type.h"
#include "company_func.h"
#include "company_base.h"
#include "settings_type.h"
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 45def31e5..e656ce033 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -11,38 +11,31 @@
#include "landscape.h"
#include "viewport_func.h"
#include "command_func.h"
-#include "industry.h"
#include "town.h"
#include "news_func.h"
#include "variables.h"
-#include "cheat_func.h"
+#include "cheat_type.h"
#include "genworld.h"
-#include "water_map.h"
#include "tree_map.h"
-#include "cargotype.h"
#include "newgrf.h"
#include "newgrf_commons.h"
#include "newgrf_industries.h"
#include "newgrf_industrytiles.h"
-#include "newgrf_callbacks.h"
#include "autoslope.h"
#include "transparency.h"
#include "water.h"
#include "strings_func.h"
-#include "tile_cmd.h"
#include "functions.h"
#include "window_func.h"
#include "date_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
-#include "station_base.h"
#include "oldpool_func.h"
#include "animated_tile_func.h"
#include "effectvehicle_func.h"
#include "ai/ai.hpp"
#include "table/strings.h"
-#include "table/sprites.h"
#include "table/industry_land.h"
#include "table/build_industry.h"
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 721f7e5e5..d63002674 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -14,16 +14,13 @@
#include "industry.h"
#include "town.h"
#include "variables.h"
-#include "cheat_func.h"
-#include "cargotype.h"
+#include "cheat_type.h"
#include "newgrf.h"
-#include "newgrf_callbacks.h"
#include "newgrf_industries.h"
#include "newgrf_text.h"
#include "strings_func.h"
#include "map_func.h"
#include "company_func.h"
-#include "settings_type.h"
#include "tilehighlight_func.h"
#include "string_func.h"
#include "sortlist_type.h"
diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp
index 45786bbb0..e3f100bef 100644
--- a/src/intro_gui.cpp
+++ b/src/intro_gui.cpp
@@ -9,17 +9,16 @@
#include "textbuf_gui.h"
#include "network/network.h"
#include "variables.h"
-#include "heightmap.h"
#include "genworld.h"
#include "network/network_gui.h"
#include "network/network_content.h"
-#include "newgrf.h"
+#include "landscape_type.h"
#include "strings_func.h"
#include "window_func.h"
#include "fios.h"
-#include "gfx_func.h"
#include "settings_type.h"
#include "functions.h"
+#include "newgrf_config.h"
#include "ai/ai_gui.hpp"
#include "table/strings.h"
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 900ec71fd..d9a17e4ef 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -5,31 +5,23 @@
/** @defgroup SnowLineGroup Snowline functions and data structures */
#include "stdafx.h"
-#include "openttd.h"
-#include "bridge_map.h"
#include "heightmap.h"
#include "clear_map.h"
#include "spritecache.h"
-#include <stdarg.h>
#include "viewport_func.h"
#include "command_func.h"
#include "landscape.h"
#include "variables.h"
#include "void_map.h"
-#include "water_map.h"
#include "tgp.h"
#include "genworld.h"
-#include "tile_cmd.h"
-#include "core/alloc_func.hpp"
#include "fios.h"
-#include "window_func.h"
#include "functions.h"
#include "date_func.h"
-#include "vehicle_func.h"
-#include "settings_type.h"
#include "water.h"
#include "effectvehicle_func.h"
#include "landscape_type.h"
+#include "settings_type.h"
#include "table/sprites.h"
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index c2e9255c9..e4e6913f2 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -6,31 +6,25 @@
#include "openttd.h"
#include "currency.h"
#include "spritecache.h"
-#include "gui.h"
#include "window_gui.h"
#include "window_func.h"
#include "textbuf_gui.h"
#include "viewport_func.h"
#include "command_func.h"
-#include "news_gui.h"
#include "console_gui.h"
-#include "waypoint.h"
+#include "map_func.h"
#include "genworld.h"
#include "transparency_gui.h"
-#include "date_func.h"
#include "functions.h"
#include "sound_func.h"
#include "transparency.h"
#include "strings_func.h"
#include "zoom_func.h"
-#include "string_func.h"
#include "company_base.h"
#include "company_func.h"
-#include "company_gui.h"
#include "settings_type.h"
#include "toolbar_gui.h"
#include "statusbar_gui.h"
-#include "variables.h"
#include "tilehighlight_func.h"
#include "network/network.h"
diff --git a/src/map.cpp b/src/map.cpp
index 76ff175e4..77952cc2f 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -4,7 +4,6 @@
#include "stdafx.h"
#include "debug.h"
-#include "direction_func.h"
#include "core/bitmath_func.hpp"
#include "core/alloc_func.hpp"
#include "core/math_func.hpp"
diff --git a/src/misc.cpp b/src/misc.cpp
index daa437b6f..ce527cb4b 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -4,35 +4,27 @@
#include "stdafx.h"
#include "openttd.h"
-#include "currency.h"
#include "landscape.h"
#include "news_func.h"
-#include "vehicle_gui.h"
#include "variables.h"
-#include "cheat_func.h"
#include "ai/ai.hpp"
#include "newgrf_house.h"
#include "cargotype.h"
#include "group.h"
-#include "viewport_func.h"
#include "economy_func.h"
-#include "zoom_func.h"
#include "functions.h"
#include "map_func.h"
#include "date_func.h"
#include "vehicle_func.h"
#include "texteff.hpp"
#include "gfx_func.h"
-#include "core/alloc_type.hpp"
#include "gamelog.h"
#include "animated_tile_func.h"
#include "settings_type.h"
#include "tilehighlight_func.h"
-#include "core/bitmath_func.hpp"
#include "network/network_func.h"
#include "window_func.h"
-#include "table/strings.h"
#include "table/sprites.h"
extern TileIndex _cur_tileloop_tile;
diff --git a/src/misc/dbg_helpers.cpp b/src/misc/dbg_helpers.cpp
index 11fdaf19b..305f7361e 100644
--- a/src/misc/dbg_helpers.cpp
+++ b/src/misc/dbg_helpers.cpp
@@ -3,10 +3,6 @@
/** @file dbg_helpers.cpp Helpers for outputting debug information. */
#include "../stdafx.h"
-#include "../openttd.h"
-#include "../direction_type.h"
-#include "../strings_type.h"
-#include "../rail.h"
#include "../rail_map.h"
#include "dbg_helpers.h"
diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp
index 1ea5ef2c3..6a3077230 100644
--- a/src/misc_cmd.cpp
+++ b/src/misc_cmd.cpp
@@ -6,12 +6,9 @@
#include "openttd.h"
#include "command_func.h"
#include "economy_func.h"
-#include "gui.h"
#include "window_func.h"
#include "textbuf_gui.h"
#include "network/network.h"
-#include "variables.h"
-#include "livery.h"
#include "company_manager_face.h"
#include "strings_func.h"
#include "gfx_func.h"
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 333a6fc19..e4c622368 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -4,49 +4,35 @@
#include "stdafx.h"
#include "openttd.h"
-#include "heightmap.h"
#include "debug.h"
#include "landscape.h"
-#include "newgrf.h"
#include "newgrf_text.h"
#include "saveload/saveload.h"
#include "tile_map.h"
#include "gui.h"
-#include "window_gui.h"
#include "station_gui.h"
-#include "textbuf_gui.h"
#include "viewport_func.h"
#include "gfx_func.h"
#include "station_func.h"
#include "command_func.h"
#include "company_func.h"
-#include "company_base.h"
#include "town.h"
#include "network/network.h"
#include "variables.h"
-#include "cheat_func.h"
-#include "train.h"
-#include "tgp.h"
+#include "company_base.h"
+#include "texteff.hpp"
#include "cargotype.h"
#include "company_manager_face.h"
#include "strings_func.h"
#include "fileio_func.h"
#include "fios.h"
-#include "tile_cmd.h"
#include "zoom_func.h"
-#include "functions.h"
#include "window_func.h"
-#include "date_func.h"
-#include "sound_func.h"
#include "string_func.h"
-#include "company_gui.h"
-#include "settings_type.h"
#include "newgrf_cargo.h"
-#include "rail_gui.h"
#include "tilehighlight_func.h"
#include "querystring_gui.h"
-#include "table/sprites.h"
#include "table/strings.h"
/* Variables to display file lists */
diff --git a/src/mixer.cpp b/src/mixer.cpp
index 4314e3ddf..3a55b7fad 100644
--- a/src/mixer.cpp
+++ b/src/mixer.cpp
@@ -3,7 +3,6 @@
/** @file mixer.cpp Mixing of sound samples. */
#include "stdafx.h"
-#include "openttd.h"
#include "mixer.h"
#include "core/math_func.hpp"
diff --git a/src/music/extmidi.cpp b/src/music/extmidi.cpp
index 0e0a427d5..c3af20140 100644
--- a/src/music/extmidi.cpp
+++ b/src/music/extmidi.cpp
@@ -4,9 +4,6 @@
#ifndef __MORPHOS__
#include "../stdafx.h"
-#include "../openttd.h"
-#include "../sound_func.h"
-#include "../variables.h"
#include "../debug.h"
#include "extmidi.h"
#include <fcntl.h>
diff --git a/src/music_gui.cpp b/src/music_gui.cpp
index a79f1429d..904914b3f 100644
--- a/src/music_gui.cpp
+++ b/src/music_gui.cpp
@@ -5,7 +5,6 @@
#include "stdafx.h"
#include "openttd.h"
#include "fileio_func.h"
-#include "variables.h"
#include "music.h"
#include "music/music_driver.hpp"
#include "window_gui.h"
diff --git a/src/namegen.cpp b/src/namegen.cpp
index e02228fc6..6ed465644 100644
--- a/src/namegen.cpp
+++ b/src/namegen.cpp
@@ -3,8 +3,6 @@
/** @file namegen.cpp Town name generators. */
#include "stdafx.h"
-#include "openttd.h"
-#include "debug.h"
#include "namegen_func.h"
#include "string_func.h"
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 237dbd57a..99b63cf4a 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -8,13 +8,10 @@
#ifdef ENABLE_NETWORK
#include "../openttd.h"
-#include "../debug.h"
#include "../strings_func.h"
-#include "../map_func.h"
#include "../command_func.h"
#include "../variables.h"
#include "../date_func.h"
-#include "../newgrf_config.h"
#include "network_internal.h"
#include "network_client.h"
#include "network_server.h"
@@ -22,18 +19,15 @@
#include "network_udp.h"
#include "network_gamelist.h"
#include "core/udp.h"
-#include "core/tcp.h"
-#include "core/core.h"
#include "core/host.h"
#include "network_gui.h"
#include "../console_func.h"
-#include <stdarg.h> /* va_list */
#include "../md5.h"
-#include "../texteff.hpp"
#include "../core/random_func.hpp"
#include "../window_func.h"
#include "../string_func.h"
#include "../company_func.h"
+#include "../company_base.h"
#include "../settings_type.h"
#include "../landscape_type.h"
#include "../rev.h"
@@ -42,7 +36,6 @@
#include "../fileio_func.h"
#endif /* DEBUG_DUMP_COMMANDS */
#include "table/strings.h"
-#include "../company_base.h"
#include "../oldpool_func.h"
DECLARE_POSTFIX_INCREMENT(ClientID);
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp
index 8968007ea..e53a8dbf3 100644
--- a/src/network/network_chat_gui.cpp
+++ b/src/network/network_chat_gui.cpp
@@ -7,8 +7,6 @@
#ifdef ENABLE_NETWORK
#include "../stdafx.h"
-#include "network.h"
-#include "network_type.h"
#include "../date_func.h"
#include "../gfx_func.h"
#include "../strings_func.h"
@@ -16,12 +14,9 @@
#include "../console_func.h"
#include "../video/video_driver.hpp"
#include "../table/sprites.h"
-#include "../window_gui.h"
-#include "../textbuf_gui.h"
#include "../querystring_gui.h"
#include "../town.h"
#include "../window_func.h"
-#include "../settings_type.h"
#include "network_internal.h"
#include "network_client.h"
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp
index 59a0b3922..52cc42e8f 100644
--- a/src/network/network_client.cpp
+++ b/src/network/network_client.cpp
@@ -9,15 +9,10 @@
#include "../openttd.h"
#include "../gfx_func.h"
#include "network_internal.h"
-#include "core/tcp.h"
-#include "network_client.h"
-#include "network_gamelist.h"
#include "network_gui.h"
#include "../saveload/saveload.h"
#include "../command_func.h"
#include "../console_func.h"
-#include "../variables.h"
-#include "../core/alloc_func.hpp"
#include "../fileio_func.h"
#include "../md5.h"
#include "../strings_func.h"
@@ -26,7 +21,6 @@
#include "../company_func.h"
#include "../company_base.h"
#include "../company_gui.h"
-#include "../company_type.h"
#include "../settings_type.h"
#include "../rev.h"
diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp
index 4adeb92f6..36a3a1136 100644
--- a/src/network/network_command.cpp
+++ b/src/network/network_command.cpp
@@ -12,7 +12,6 @@
#include "../callback_table.h"
#include "../core/alloc_func.hpp"
#include "../string_func.h"
-#include "../date_func.h"
#include "../company_func.h"
/** Local queue of packets */
diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp
index fa7f83624..6f918f2e3 100644
--- a/src/network/network_content.cpp
+++ b/src/network/network_content.cpp
@@ -5,18 +5,13 @@
#if defined(ENABLE_NETWORK)
#include "../stdafx.h"
-#include "../debug.h"
#include "../rev.h"
-#include "../core/alloc_func.hpp"
-#include "../core/math_func.hpp"
-#include "../newgrf_config.h"
#include "../fileio_func.h"
#include "../string_func.h"
#include "../ai/ai.hpp"
#include "../window_func.h"
#include "../gui.h"
#include "../variables.h"
-#include "core/host.h"
#include "network_content.h"
#include "table/strings.h"
diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp
index c5ccd933b..633db8687 100644
--- a/src/network/network_content_gui.cpp
+++ b/src/network/network_content_gui.cpp
@@ -10,7 +10,6 @@
#include "../window_func.h"
#include "../window_gui.h"
#include "../gui.h"
-#include "../core/smallvec_type.hpp"
#include "../ai/ai.hpp"
#include "../gfxinit.h"
#include "../sortlist_type.h"
diff --git a/src/network/network_gamelist.cpp b/src/network/network_gamelist.cpp
index e50f5cc38..8d897d9bd 100644
--- a/src/network/network_gamelist.cpp
+++ b/src/network/network_gamelist.cpp
@@ -9,15 +9,12 @@
#include "../stdafx.h"
#include "../debug.h"
-#include "../newgrf_config.h"
#include "../core/alloc_func.hpp"
#include "../thread.h"
#include "../string_func.h"
#include "network_internal.h"
-#include "core/game.h"
#include "network_udp.h"
#include "network_gamelist.h"
-#include "network_gui.h"
NetworkGameList *_network_game_list = NULL;
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 712e800d5..6a59e1a6c 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -6,26 +6,18 @@
#include "../stdafx.h"
#include "../openttd.h"
#include "../strings_func.h"
-#include "network.h"
#include "../date_func.h"
#include "../fios.h"
#include "network_internal.h"
#include "network_client.h"
-#include "network_content.h"
#include "network_gui.h"
#include "network_gamelist.h"
#include "../gui.h"
-#include "../window_gui.h"
-#include "../variables.h"
#include "network_server.h"
#include "network_udp.h"
-#include "../newgrf.h"
-#include "../functions.h"
#include "../window_func.h"
-#include "../core/alloc_func.hpp"
#include "../string_func.h"
#include "../gfx_func.h"
-#include "../company_func.h"
#include "../settings_type.h"
#include "../widgets/dropdown_func.h"
#include "../querystring_gui.h"
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index f33714f0b..20820c4ab 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -5,13 +5,10 @@
#ifdef ENABLE_NETWORK
#include "../stdafx.h"
-#include "../openttd.h" // XXX StringID
#include "../debug.h"
#include "../strings_func.h"
#include "network_internal.h"
-#include "core/tcp.h"
#include "../vehicle_base.h"
-#include "../vehicle_func.h"
#include "../date_func.h"
#include "network_server.h"
#include "network_udp.h"
@@ -19,12 +16,9 @@
#include "../command_func.h"
#include "../saveload/saveload.h"
#include "../station_base.h"
-#include "../variables.h"
#include "../genworld.h"
-#include "../core/alloc_func.hpp"
#include "../fileio_func.h"
#include "../string_func.h"
-#include "../company_base.h"
#include "../company_func.h"
#include "../company_gui.h"
#include "../settings_type.h"
diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp
index 193b21b68..00c5410db 100644
--- a/src/network/network_udp.cpp
+++ b/src/network/network_udp.cpp
@@ -10,20 +10,16 @@
#ifdef ENABLE_NETWORK
#include "../stdafx.h"
-#include "../debug.h"
#include "../date_func.h"
#include "../map_func.h"
#include "network_gamelist.h"
#include "network_internal.h"
#include "network_udp.h"
#include "core/host.h"
-#include "../variables.h"
-#include "../newgrf_config.h"
#include "../core/endian_func.hpp"
#include "../core/alloc_func.hpp"
#include "../string_func.h"
#include "../company_base.h"
-#include "../company_func.h"
#include "../settings_type.h"
#include "../thread.h"
#include "../rev.h"
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 99774c397..7163e0147 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -12,8 +12,6 @@
#include "engine_func.h"
#include "engine_base.h"
#include "spritecache.h"
-#include "sprite.h"
-#include "newgrf.h"
#include "variables.h"
#include "bridge.h"
#include "town.h"
@@ -22,18 +20,14 @@
#include "fontcache.h"
#include "currency.h"
#include "landscape.h"
-#include "newgrf_config.h"
#include "newgrf_house.h"
#include "newgrf_sound.h"
-#include "newgrf_spritegroup.h"
#include "newgrf_station.h"
-#include "cargotype.h"
#include "industry.h"
#include "newgrf_canal.h"
#include "newgrf_commons.h"
#include "newgrf_townname.h"
#include "newgrf_industries.h"
-#include "gfxinit.h"
#include "rev.h"
#include "fios.h"
#include "rail.h"
@@ -43,16 +37,11 @@
#include "vehicle_func.h"
#include "sound_func.h"
#include "string_func.h"
-#include "road_func.h"
-#include "company_base.h"
-#include "settings_type.h"
#include "network/network.h"
#include "map_func.h"
#include <map>
#include "table/strings.h"
-#include "table/sprites.h"
-#include "table/town_land.h"
#include "table/build_industry.h"
/* TTDPatch extended GRF format codec
diff --git a/src/newgrf_canal.cpp b/src/newgrf_canal.cpp
index 3d0af0b61..c74bfd4d1 100644
--- a/src/newgrf_canal.cpp
+++ b/src/newgrf_canal.cpp
@@ -3,12 +3,9 @@
/** @file newgrf_canal.cpp Implementation of NewGRF canals. */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
-#include "landscape.h"
+#include "core/overflowsafe_type.hpp"
+#include "tile_type.h"
#include "debug.h"
-#include "newgrf.h"
-#include "newgrf_callbacks.h"
#include "newgrf_commons.h"
#include "newgrf_spritegroup.h"
#include "newgrf_canal.h"
diff --git a/src/newgrf_cargo.cpp b/src/newgrf_cargo.cpp
index 06c6caedf..5e322a9ec 100644
--- a/src/newgrf_cargo.cpp
+++ b/src/newgrf_cargo.cpp
@@ -3,15 +3,11 @@
/** @file newgrf_cargo.cpp Implementation of NewGRF cargoes. */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
-#include "cargotype.h"
#include "newgrf.h"
-#include "newgrf_callbacks.h"
#include "newgrf_spritegroup.h"
#include "newgrf_cargo.h"
-
static uint32 CargoGetRandomBits(const ResolverObject *object)
{
return 0;
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp
index fce5afe0b..0b1e26a58 100644
--- a/src/newgrf_commons.cpp
+++ b/src/newgrf_commons.cpp
@@ -5,16 +5,12 @@
*/
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
#include "landscape.h"
#include "town.h"
#include "industry.h"
#include "newgrf.h"
#include "newgrf_commons.h"
-#include "tile_map.h"
#include "station_map.h"
-#include "settings_type.h"
#include "tree_map.h"
/** Constructor of generic class
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp
index 6902fcdb5..b752200e7 100644
--- a/src/newgrf_config.cpp
+++ b/src/newgrf_config.cpp
@@ -3,13 +3,9 @@
/** @file newgrf_config.cpp Finding NewGRFs and configuring them. */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
-#include "variables.h"
#include "md5.h"
#include "newgrf.h"
-#include "newgrf_config.h"
-#include "core/alloc_func.hpp"
#include "string_func.h"
#include "gamelog.h"
#include "network/network_type.h"
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index 2b8746ff1..bde2fd56e 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -3,33 +3,17 @@
/** @file newgrf_engine.cpp NewGRF handling of engines. */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
#include "debug.h"
-#include "engine_func.h"
-#include "engine_base.h"
#include "train.h"
#include "company_func.h"
-#include "company_base.h"
-#include "station_base.h"
-#include "airport.h"
-#include "newgrf.h"
-#include "newgrf_callbacks.h"
#include "newgrf_engine.h"
-#include "newgrf_station.h"
#include "newgrf_spritegroup.h"
-#include "newgrf_cargo.h"
-#include "cargotype.h"
#include "date_func.h"
#include "vehicle_func.h"
#include "core/random_func.hpp"
-#include "direction_func.h"
-#include "rail_map.h"
-#include "rail.h"
-#include "settings_type.h"
#include "aircraft.h"
#include "core/smallmap_type.hpp"
-
+#include "settings_type.h"
int _traininfo_vehicle_pitch = 0;
int _traininfo_vehicle_width = 29;
diff --git a/src/newgrf_generic.cpp b/src/newgrf_generic.cpp
index c2dd2734e..465c75266 100644
--- a/src/newgrf_generic.cpp
+++ b/src/newgrf_generic.cpp
@@ -3,16 +3,9 @@
/** @file newgrf_generic.cpp Handling of generic feature callbacks. */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
-#include "landscape.h"
#include "debug.h"
#include "newgrf.h"
-#include "newgrf_callbacks.h"
-#include "newgrf_commons.h"
#include "newgrf_spritegroup.h"
-#include "newgrf_generic.h"
-#include "tile_map.h"
#include <list>
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index e41de64d1..f1fbf2082 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -3,16 +3,12 @@
/** @file newgrf_gui.cpp GUI to change NewGRF settings. */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
#include "gui.h"
#include "window_gui.h"
#include "textbuf_gui.h"
#include "newgrf.h"
-#include "newgrf_config.h"
#include "strings_func.h"
#include "window_func.h"
-#include "core/alloc_func.hpp"
#include "string_func.h"
#include "gfx_func.h"
#include "gamelog.h"
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index c02e0e42b..5f318cf96 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -8,13 +8,11 @@
#include "debug.h"
#include "viewport_func.h"
#include "landscape.h"
-#include "town.h"
#include "town_map.h"
#include "sprite.h"
#include "newgrf.h"
#include "newgrf_house.h"
#include "newgrf_spritegroup.h"
-#include "newgrf_callbacks.h"
#include "newgrf_town.h"
#include "newgrf_sound.h"
#include "newgrf_commons.h"
@@ -22,13 +20,8 @@
#include "functions.h"
#include "company_func.h"
#include "animated_tile_func.h"
-#include "date_func.h"
#include "company_base.h"
-#include "table/strings.h"
-#include "table/sprites.h"
-#include "table/town_land.h"
-
static BuildingCounts _building_counts;
static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX];
diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp
index d65570c93..6a61d59d8 100644
--- a/src/newgrf_industries.cpp
+++ b/src/newgrf_industries.cpp
@@ -3,23 +3,18 @@
/** @file newgrf_industries.cpp Handling of NewGRF industries. */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
-#include "variables.h"
-#include "landscape.h"
-#include "industry.h"
+#include "tile_type.h"
+#include "strings_type.h"
+#include "company_type.h"
#include "industry_map.h"
#include "newgrf.h"
-#include "newgrf_callbacks.h"
-#include "newgrf_spritegroup.h"
#include "newgrf_industries.h"
-#include "newgrf_industrytiles.h"
#include "newgrf_commons.h"
#include "newgrf_text.h"
#include "newgrf_town.h"
#include "window_func.h"
#include "town.h"
-#include "company_func.h"
#include "company_base.h"
#include "command_func.h"
diff --git a/src/newgrf_industrytiles.cpp b/src/newgrf_industrytiles.cpp
index 97706038c..2619a143b 100644
--- a/src/newgrf_industrytiles.cpp
+++ b/src/newgrf_industrytiles.cpp
@@ -9,16 +9,13 @@
#include "viewport_func.h"
#include "landscape.h"
#include "newgrf.h"
-#include "industry.h"
+#include "core/random_func.hpp"
#include "newgrf_commons.h"
-#include "newgrf_spritegroup.h"
-#include "newgrf_callbacks.h"
#include "newgrf_industries.h"
#include "newgrf_industrytiles.h"
#include "newgrf_sound.h"
#include "newgrf_text.h"
#include "industry_map.h"
-#include "clear_map.h"
#include "sprite.h"
#include "transparency.h"
#include "functions.h"
@@ -27,7 +24,6 @@
#include "animated_tile_func.h"
#include "water.h"
-#include "table/sprites.h"
#include "table/strings.h"
/**
diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp
index bc36bfd8a..7f8f31179 100644
--- a/src/newgrf_sound.cpp
+++ b/src/newgrf_sound.cpp
@@ -3,11 +3,7 @@
/** @file newgrf_sound.cpp Handling NewGRF provided sounds. */
#include "stdafx.h"
-#include "openttd.h"
-#include "oldpool.h"
-#include "engine_func.h"
#include "engine_base.h"
-#include "newgrf_callbacks.h"
#include "newgrf_engine.h"
#include "newgrf_sound.h"
#include "vehicle_base.h"
diff --git a/src/newgrf_spritegroup.cpp b/src/newgrf_spritegroup.cpp
index d730d5017..c0c3f44ec 100644
--- a/src/newgrf_spritegroup.cpp
+++ b/src/newgrf_spritegroup.cpp
@@ -3,16 +3,10 @@
/** @file newgrf_spritegroup.cpp Handling of primarily NewGRF action 2. */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
-#include "landscape.h"
#include "oldpool.h"
#include "newgrf.h"
-#include "newgrf_callbacks.h"
#include "newgrf_spritegroup.h"
#include "sprite.h"
-#include "date_func.h"
-#include "settings_type.h"
static void SpriteGroupPoolCleanBlock(uint start_item, uint end_item);
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index dd5473953..9cec024dc 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -3,21 +3,14 @@
/** @file newgrf_station.cpp Functions for dealing with station classes and custom stations. */
#include "stdafx.h"
-#include "openttd.h"
#include "variables.h"
-#include "tile_cmd.h"
#include "landscape.h"
#include "debug.h"
-#include "sprite.h"
-#include "station_base.h"
#include "station_map.h"
-#include "newgrf.h"
-#include "newgrf_callbacks.h"
#include "newgrf_commons.h"
#include "newgrf_station.h"
#include "newgrf_spritegroup.h"
#include "newgrf_sound.h"
-#include "cargotype.h"
#include "town.h"
#include "newgrf_town.h"
#include "gfx_func.h"
@@ -26,10 +19,8 @@
#include "animated_tile_func.h"
#include "functions.h"
#include "tunnelbridge_map.h"
-#include "rail_map.h"
#include "spritecache.h"
-#include "table/sprites.h"
#include "table/strings.h"
StationClass _station_classes[STAT_CLASS_MAX];
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp
index c62d2c445..d630b01dc 100644
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -10,13 +10,8 @@
*/
#include "stdafx.h"
-#include "debug.h"
-#include "openttd.h"
-#include "variables.h"
#include "newgrf.h"
-#include "newgrf_text.h"
#include "strings_func.h"
-#include "core/alloc_func.hpp"
#include "newgrf_storage.h"
#include "string_func.h"
#include "date_type.h"
diff --git a/src/newgrf_town.cpp b/src/newgrf_town.cpp
index e198a0b02..4d24cce68 100644
--- a/src/newgrf_town.cpp
+++ b/src/newgrf_town.cpp
@@ -3,11 +3,7 @@
/** @file newgrf_town.cpp Implementation of the town part of NewGRF houses. */
#include "stdafx.h"
-#include "openttd.h"
-#include "settings_type.h"
#include "debug.h"
-#include "core/bitmath_func.hpp"
-#include "core/math_func.hpp"
#include "town.h"
/** This function implements the town variables that newGRF defines.
diff --git a/src/newgrf_townname.cpp b/src/newgrf_townname.cpp
index f06915b91..3b3eca57b 100644
--- a/src/newgrf_townname.cpp
+++ b/src/newgrf_townname.cpp
@@ -7,13 +7,10 @@
*/
#include "stdafx.h"
-#include "openttd.h"
#include "newgrf_townname.h"
#include "core/alloc_func.hpp"
#include "string_func.h"
-#include "table/strings.h"
-
static GRFTownName *_grf_townnames = NULL;
GRFTownName *GetGRFTownName(uint32 grfid)
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 5ba424d5c..06273e127 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -7,7 +7,7 @@
#include "gui.h"
#include "window_gui.h"
#include "viewport_func.h"
-#include "news_func.h"
+#include "news_type.h"
#include "settings_type.h"
#include "transparency.h"
#include "strings_func.h"
@@ -17,11 +17,9 @@
#include "sound_func.h"
#include "string_func.h"
#include "widgets/dropdown_func.h"
-#include "map_func.h"
#include "statusbar_gui.h"
#include "company_manager_face.h"
-#include "table/sprites.h"
#include "table/strings.h"
#define NB_WIDG_PER_SETTING 4
diff --git a/src/npf.cpp b/src/npf.cpp
index 021426a9a..9fbad2798 100644
--- a/src/npf.cpp
+++ b/src/npf.cpp
@@ -3,28 +3,18 @@
/** @file npf.cpp Implementation of the NPF pathfinder. */
#include "stdafx.h"
-#include "openttd.h"
#include "npf.h"
-#include "bridge_map.h"
#include "debug.h"
-#include "tile_cmd.h"
-#include "bridge.h"
#include "landscape.h"
-#include "aystar.h"
-#include "pathfind.h"
-#include "station_base.h"
-#include "station_map.h"
#include "depot_base.h"
#include "depot_map.h"
-#include "tunnel_map.h"
#include "network/network.h"
-#include "water_map.h"
#include "tunnelbridge_map.h"
#include "functions.h"
#include "vehicle_base.h"
-#include "settings_type.h"
#include "tunnelbridge.h"
#include "pbs.h"
+#include "settings_type.h"
static AyStar _npf_aystar;
diff --git a/src/oldpool.cpp b/src/oldpool.cpp
index 856bfdd17..50b1635f6 100644
--- a/src/oldpool.cpp
+++ b/src/oldpool.cpp
@@ -3,7 +3,6 @@
/** @file oldpool.cpp Implementation of the old pool. */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
#include "oldpool.h"
#include "core/alloc_func.hpp"
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 101c7316c..583815fdb 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -10,7 +10,6 @@
#include "openttd.h"
-#include "driver.h"
#include "blitter/factory.hpp"
#include "sound/sound_driver.hpp"
#include "music/music_driver.hpp"
@@ -18,75 +17,46 @@
#include "fontcache.h"
#include "gfxinit.h"
-#include "gfx_func.h"
#include "gui.h"
#include "mixer.h"
#include "sound_func.h"
#include "window_func.h"
-#include "debug.h"
#include "saveload/saveload.h"
#include "landscape.h"
#include "company_func.h"
-#include "company_base.h"
#include "command_func.h"
-#include "town.h"
-#include "industry.h"
#include "news_func.h"
#include "fileio_func.h"
#include "fios.h"
-#include "airport.h"
#include "aircraft.h"
#include "console_func.h"
#include "screenshot.h"
#include "network/network.h"
#include "network/network_func.h"
#include "signs_base.h"
-#include "signs_func.h"
-#include "waypoint.h"
#include "ai/ai.hpp"
#include "ai/ai_config.hpp"
-#include "train.h"
-#include "yapf/yapf.h"
#include "settings_func.h"
#include "genworld.h"
-#include "company_manager_face.h"
#include "group.h"
#include "strings_func.h"
#include "date_func.h"
#include "vehicle_func.h"
#include "gamelog.h"
-#include "cheat_func.h"
+#include "cheat_type.h"
#include "animated_tile_func.h"
#include "functions.h"
#include "elrail_func.h"
#include "rev.h"
#include "highscore.h"
-#include "newgrf.h"
-#include "newgrf_config.h"
-#include "newgrf_house.h"
#include "newgrf_commons.h"
-#include "newgrf_station.h"
-
-#include "clear_map.h"
-#include "tree_map.h"
-#include "rail_map.h"
-#include "road_map.h"
-#include "road_cmd.h"
-#include "station_map.h"
-#include "town_map.h"
-#include "industry_map.h"
-#include "unmovable_map.h"
-#include "tunnel_map.h"
-#include "bridge_map.h"
-#include "water_map.h"
-#include "tunnelbridge_map.h"
-#include "void_map.h"
-#include "water.h"
+
+#include "town.h"
+#include "industry.h"
#include <stdarg.h>
-#include <signal.h>
#include "table/strings.h"
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 5e6f95d3d..4eabc94c4 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -3,29 +3,23 @@
/** @file order_cmd.cpp Handling of orders. */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
-#include "order_base.h"
-#include "order_func.h"
-#include "airport.h"
-#include "waypoint.h"
#include "command_func.h"
#include "company_func.h"
#include "news_func.h"
#include "vehicle_gui.h"
#include "cargotype.h"
-#include "aircraft.h"
+#include "station_map.h"
+#include "vehicle_base.h"
#include "strings_func.h"
-#include "core/alloc_func.hpp"
#include "functions.h"
#include "window_func.h"
-#include "settings_type.h"
-#include "string_func.h"
#include "newgrf_cargo.h"
#include "timetable.h"
#include "vehicle_func.h"
#include "oldpool_func.h"
#include "depot_base.h"
+#include "settings_type.h"
#include "table/strings.h"
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index a854cff21..43978edb2 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -3,27 +3,19 @@
/** @file order_gui.cpp GUI related to orders. */
#include "stdafx.h"
-#include "openttd.h"
-#include "road_map.h"
#include "station_map.h"
-#include "gui.h"
#include "window_gui.h"
-#include "station_base.h"
-#include "town.h"
#include "command_func.h"
#include "viewport_func.h"
#include "gfx_func.h"
#include "depot_base.h"
-#include "waypoint.h"
-#include "train.h"
-#include "water_map.h"
+#include "vehicle_base.h"
#include "vehicle_gui.h"
#include "timetable.h"
#include "cargotype.h"
#include "strings_func.h"
#include "window_func.h"
#include "vehicle_func.h"
-#include "settings_type.h"
#include "company_func.h"
#include "newgrf_cargo.h"
#include "widgets/dropdown_func.h"
@@ -31,6 +23,7 @@
#include "string_func.h"
#include "tilehighlight_func.h"
#include "network/network.h"
+#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp
index 1dfce4cfb..99c25a041 100644
--- a/src/osk_gui.cpp
+++ b/src/osk_gui.cpp
@@ -3,10 +3,6 @@
/** @file osk_gui.cpp The On Screen Keyboard GUI */
#include "stdafx.h"
-#include "openttd.h"
-
-#include "textbuf_gui.h"
-#include "window_gui.h"
#include "string_func.h"
#include "strings_func.h"
#include "debug.h"
diff --git a/src/pathfind.cpp b/src/pathfind.cpp
index eb43d7d85..9152e88a0 100644
--- a/src/pathfind.cpp
+++ b/src/pathfind.cpp
@@ -3,16 +3,10 @@
/** @file pathfind.cpp Implementation of the oldest supported pathfinder. */
#include "stdafx.h"
-#include "openttd.h"
-#include "bridge_map.h"
#include "station_map.h"
-#include "tile_cmd.h"
-#include "landscape.h"
+#include "settings_type.h"
#include "pathfind.h"
-#include "rail_type.h"
#include "debug.h"
-#include "tunnel_map.h"
-#include "settings_type.h"
#include "tunnelbridge_map.h"
#include "core/random_func.hpp"
#include "core/alloc_type.hpp"
diff --git a/src/pbs.cpp b/src/pbs.cpp
index b07bbecd6..5adccaea6 100644
--- a/src/pbs.cpp
+++ b/src/pbs.cpp
@@ -2,18 +2,8 @@
/** @file pbs.cpp */
#include "stdafx.h"
-#include "openttd.h"
#include "pbs.h"
-#include "rail_map.h"
-#include "road_map.h"
-#include "station_map.h"
-#include "tunnelbridge_map.h"
#include "functions.h"
-#include "debug.h"
-#include "direction_func.h"
-#include "settings_type.h"
-#include "road_func.h"
-#include "vehicle_base.h"
#include "vehicle_func.h"
#include "yapf/follow_track.hpp"
diff --git a/src/queue.cpp b/src/queue.cpp
index 0c736994a..d84efb1ba 100644
--- a/src/queue.cpp
+++ b/src/queue.cpp
@@ -3,7 +3,6 @@
/** @file queue.cpp Implementation of the Queue/Hash. */
#include "stdafx.h"
-#include "openttd.h"
#include "queue.h"
#include "core/alloc_func.hpp"
diff --git a/src/rail.cpp b/src/rail.cpp
index 377397d97..ddc716206 100644
--- a/src/rail.cpp
+++ b/src/rail.cpp
@@ -3,19 +3,13 @@
/** @file rail.cpp Implementation of rail specific functions. */
#include "stdafx.h"
-#include "openttd.h"
-#include "bridge_map.h"
-#include "rail.h"
#include "station_map.h"
-#include "tunnel_map.h"
#include "tunnelbridge_map.h"
-#include "settings_type.h"
#include "date_func.h"
#include "company_func.h"
#include "company_base.h"
-#include "engine_func.h"
#include "engine_base.h"
-
+#include "settings_type.h"
/* XXX: Below 3 tables store duplicate data. Maybe remove some? */
/* Maps a trackdir to the bit that stores its status in the map arrays, in the
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index a8eb5c6dc..1f94a72a0 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -4,53 +4,31 @@
#include "stdafx.h"
#include "openttd.h"
-#include "bridge_map.h"
-#include "bridge.h"
#include "cmd_helper.h"
-#include "debug.h"
-#include "tile_cmd.h"
-#include "rail_map.h"
-#include "road_map.h"
#include "landscape.h"
#include "town_map.h"
-#include "tunnel_map.h"
#include "viewport_func.h"
#include "command_func.h"
-#include "pathfind.h"
-#include "engine_func.h"
#include "engine_base.h"
-#include "town.h"
-#include "sprite.h"
#include "depot_base.h"
-#include "depot_func.h"
#include "waypoint.h"
-#include "rail.h"
-#include "newgrf.h"
#include "yapf/yapf.h"
#include "newgrf_engine.h"
-#include "newgrf_callbacks.h"
#include "newgrf_station.h"
#include "newgrf_commons.h"
#include "train.h"
#include "variables.h"
#include "autoslope.h"
-#include "transparency.h"
#include "water.h"
#include "tunnelbridge_map.h"
#include "window_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
-#include "signal_func.h"
#include "tunnelbridge.h"
#include "station_map.h"
-#include "water_map.h"
#include "functions.h"
#include "elrail_func.h"
-#include "oldpool_func.h"
-#include "pbs.h"
-#include "core/smallvec_type.hpp"
-#include "table/sprites.h"
#include "table/strings.h"
#include "table/railtypes.h"
#include "table/track_land.h"
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 87e8901e0..fbb4d1c42 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -3,10 +3,6 @@
/** @file rail_gui.cpp File for dealing with rail construction user interface */
#include "stdafx.h"
-#include "direction_type.h"
-#include "openttd.h"
-#include "tile_cmd.h"
-#include "landscape.h"
#include "gui.h"
#include "window_gui.h"
#include "station_gui.h"
@@ -14,30 +10,21 @@
#include "viewport_func.h"
#include "gfx_func.h"
#include "command_func.h"
-#include "town_type.h"
#include "waypoint.h"
-#include "debug.h"
-#include "variables.h"
-#include "newgrf_callbacks.h"
#include "newgrf_station.h"
-#include "train.h"
+#include "company_base.h"
#include "strings_func.h"
#include "functions.h"
#include "window_func.h"
#include "date_func.h"
#include "sound_func.h"
#include "company_func.h"
-#include "settings_type.h"
#include "widgets/dropdown_type.h"
-#include "widgets/dropdown_func.h"
#include "tunnelbridge.h"
#include "tilehighlight_func.h"
+#include "settings_type.h"
-#include "bridge_map.h"
-#include "rail_map.h"
-#include "road_map.h"
#include "station_map.h"
-#include "tunnel_map.h"
#include "tunnelbridge_map.h"
#include "table/sprites.h"
diff --git a/src/road.cpp b/src/road.cpp
index 4680911c3..d8c3d0e43 100644
--- a/src/road.cpp
+++ b/src/road.cpp
@@ -6,15 +6,13 @@
#include "openttd.h"
#include "rail_map.h"
#include "road_map.h"
-#include "road_internal.h"
#include "water_map.h"
#include "genworld.h"
#include "company_func.h"
#include "company_base.h"
-#include "engine_func.h"
#include "engine_base.h"
-#include "settings_type.h"
#include "date_func.h"
+#include "settings_type.h"
bool IsPossibleCrossing(const TileIndex tile, Axis ax)
{
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index 71f917272..44079d4a4 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -4,42 +4,29 @@
#include "stdafx.h"
#include "openttd.h"
-#include "map_func.h"
-#include "bridge_map.h"
-#include "bridge.h"
#include "cmd_helper.h"
-#include "rail_map.h"
-#include "road_map.h"
#include "road_internal.h"
-#include "sprite.h"
-#include "tile_cmd.h"
#include "landscape.h"
#include "town_map.h"
#include "viewport_func.h"
#include "command_func.h"
-#include "town.h"
#include "yapf/yapf.h"
#include "depot_base.h"
-#include "depot_func.h"
#include "newgrf.h"
#include "station_map.h"
-#include "tunnel_map.h"
#include "variables.h"
#include "autoslope.h"
-#include "transparency.h"
#include "tunnelbridge_map.h"
#include "window_func.h"
#include "strings_func.h"
#include "vehicle_func.h"
#include "vehicle_base.h"
#include "sound_func.h"
-#include "road_func.h"
#include "tunnelbridge.h"
-#include "cheat_func.h"
+#include "cheat_type.h"
#include "functions.h"
#include "effectvehicle_func.h"
#include "elrail_func.h"
-#include "oldpool_func.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index 447cd7c42..ad9357d99 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -11,20 +11,19 @@
#include "viewport_func.h"
#include "gfx_func.h"
#include "command_func.h"
-#include "variables.h"
#include "road_type.h"
#include "road_cmd.h"
#include "road_map.h"
-#include "station_map.h"
+#include "station_func.h"
#include "functions.h"
#include "window_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
#include "company_func.h"
-#include "settings_type.h"
#include "tunnelbridge.h"
#include "tilehighlight_func.h"
#include "company_base.h"
+#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/road_map.cpp b/src/road_map.cpp
index b0d6d60a2..83a247c48 100644
--- a/src/road_map.cpp
+++ b/src/road_map.cpp
@@ -3,11 +3,6 @@
/** @file road_map.cpp Complex road accessors. */
#include "stdafx.h"
-#include "openttd.h"
-#include "bridge_map.h"
-#include "tile_cmd.h"
-#include "road_map.h"
-#include "tunnel_map.h"
#include "station_map.h"
#include "tunnelbridge_map.h"
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 209801d18..36b15df67 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -3,31 +3,19 @@
/** @file roadveh_cmd.cpp Handling of road vehicles. */
#include "stdafx.h"
-#include "openttd.h"
-#include "debug.h"
-#include "tile_cmd.h"
#include "landscape.h"
-#include "road_map.h"
#include "roadveh.h"
#include "station_map.h"
#include "command_func.h"
-#include "station_base.h"
#include "news_func.h"
#include "pathfind.h"
#include "npf.h"
#include "company_func.h"
-#include "company_base.h"
-#include "bridge.h"
-#include "tunnel_map.h"
-#include "bridge_map.h"
#include "vehicle_gui.h"
#include "articulated_vehicles.h"
-#include "newgrf_callbacks.h"
#include "newgrf_engine.h"
-#include "newgrf_text.h"
#include "newgrf_sound.h"
#include "yapf/yapf.h"
-#include "cargotype.h"
#include "strings_func.h"
#include "tunnelbridge_map.h"
#include "functions.h"
@@ -39,12 +27,9 @@
#include "autoreplace_gui.h"
#include "gfx_func.h"
#include "ai/ai.hpp"
-#include "settings_type.h"
-#include "order_func.h"
#include "depot_base.h"
-#include "depot_func.h"
#include "effectvehicle_func.h"
-#include "core/alloc_func.hpp"
+#include "settings_type.h"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp
index 7dd2239f5..439151eca 100644
--- a/src/roadveh_gui.cpp
+++ b/src/roadveh_gui.cpp
@@ -3,20 +3,13 @@
/** @file roadveh_gui.cpp GUI for road vehicles. */
#include "stdafx.h"
-#include "openttd.h"
-#include "debug.h"
#include "roadveh.h"
-#include "gui.h"
#include "window_gui.h"
-#include "viewport_func.h"
#include "gfx_func.h"
-#include "command_func.h"
#include "vehicle_gui.h"
-#include "newgrf_engine.h"
#include "strings_func.h"
#include "vehicle_func.h"
#include "string_func.h"
-#include "order_func.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp
index af22f844c..2b34622fc 100644
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -3,38 +3,24 @@
/** @file afterload.cpp Code updating data after game load */
#include "../stdafx.h"
-#include "../strings_type.h"
-#include "../tile_type.h"
-#include "../tile_map.h"
-#include "../map_type.h"
-#include "../town.h"
#include "../void_map.h"
#include "../signs_base.h"
#include "../window_func.h"
#include "../fios.h"
-#include "../date_func.h"
#include "../train.h"
#include "../string_func.h"
-#include "../newgrf_config.h"
#include "../gamelog.h"
-#include "../waypoint.h"
-#include "../station_map.h"
-#include "../tunnelbridge_map.h"
-#include "../debug.h"
#include "../network/network.h"
-#include "../openttd.h"
#include "../gfxinit.h"
#include "../functions.h"
#include "../industry_map.h"
#include "../town_map.h"
#include "../clear_map.h"
-#include "../engine_base.h"
#include "../vehicle_func.h"
#include "../newgrf_station.h"
#include "../yapf/yapf.hpp"
#include "../elrail_func.h"
#include "../signs_func.h"
-#include "../newgrf_house.h"
#include "../aircraft.h"
#include "../unmovable_map.h"
#include "../tree_map.h"
@@ -44,7 +30,6 @@
#include "table/strings.h"
-#include "saveload.h"
#include "saveload_internal.h"
#include <signal.h>
diff --git a/src/saveload/ai_sl.cpp b/src/saveload/ai_sl.cpp
index c88dcbc32..69f05d7fd 100644
--- a/src/saveload/ai_sl.cpp
+++ b/src/saveload/ai_sl.cpp
@@ -3,12 +3,10 @@
/** @file ai_sl.cpp Handles the saveload part of the AIs */
#include "../stdafx.h"
-#include "../openttd.h"
#include "../company_base.h"
#include "../company_func.h"
#include "../debug.h"
#include "saveload.h"
-#include "../settings_type.h"
#include "../string_func.h"
#include "../ai/ai.hpp"
#include "../ai/ai_config.hpp"
diff --git a/src/saveload/autoreplace_sl.cpp b/src/saveload/autoreplace_sl.cpp
index d24c290a8..7ed3a2051 100644
--- a/src/saveload/autoreplace_sl.cpp
+++ b/src/saveload/autoreplace_sl.cpp
@@ -3,7 +3,6 @@
/** @file autoreplace_sl.cpp Code handling saving and loading of autoreplace rules */
#include "../stdafx.h"
-#include "../autoreplace_type.h"
#include "../engine_type.h"
#include "../group_type.h"
#include "../autoreplace_base.h"
diff --git a/src/saveload/cargopacket_sl.cpp b/src/saveload/cargopacket_sl.cpp
index d38e4e22e..c871d66c8 100644
--- a/src/saveload/cargopacket_sl.cpp
+++ b/src/saveload/cargopacket_sl.cpp
@@ -3,7 +3,6 @@
/** @file cargopacket_sl.cpp Code handling saving and loading of cargo packets */
#include "../stdafx.h"
-#include "../openttd.h"
#include "../cargopacket.h"
#include "saveload.h"
diff --git a/src/saveload/company_sl.cpp b/src/saveload/company_sl.cpp
index 8231e9f3d..22930f765 100644
--- a/src/saveload/company_sl.cpp
+++ b/src/saveload/company_sl.cpp
@@ -5,8 +5,6 @@
#include "../stdafx.h"
#include "../company_base.h"
#include "../company_func.h"
-#include "../network/network.h"
-#include "../ai/ai.hpp"
#include "../company_manager_face.h"
#include "saveload.h"
diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp
index 6dc47c56a..29772c625 100644
--- a/src/saveload/engine_sl.cpp
+++ b/src/saveload/engine_sl.cpp
@@ -3,7 +3,6 @@
/** @file engine_sl.cpp Code handling saving and loading of engines */
#include "../stdafx.h"
-#include "saveload.h"
#include "saveload_internal.h"
#include "../engine_base.h"
#include <map>
diff --git a/src/saveload/map_sl.cpp b/src/saveload/map_sl.cpp
index 00139dde9..005960582 100644
--- a/src/saveload/map_sl.cpp
+++ b/src/saveload/map_sl.cpp
@@ -3,7 +3,6 @@
/** @file map_sl.cpp Code handling saving and loading of map */
#include "../stdafx.h"
-#include "../tile_type.h"
#include "../map_func.h"
#include "../core/alloc_type.hpp"
#include "../core/bitmath_func.hpp"
diff --git a/src/saveload/misc_sl.cpp b/src/saveload/misc_sl.cpp
index 5dd650c80..74086f934 100644
--- a/src/saveload/misc_sl.cpp
+++ b/src/saveload/misc_sl.cpp
@@ -7,7 +7,6 @@
#include "../variables.h"
#include "../core/random_func.hpp"
#include "../openttd.h"
-#include "../tile_type.h"
#include "../zoom_func.h"
#include "../vehicle_func.h"
#include "../window_gui.h"
diff --git a/src/saveload/oldloader.cpp b/src/saveload/oldloader.cpp
index 5c1dd39ef..dd55a9e29 100644
--- a/src/saveload/oldloader.cpp
+++ b/src/saveload/oldloader.cpp
@@ -12,7 +12,6 @@
#include "table/strings.h"
-#include "saveload.h"
#include "saveload_internal.h"
#include "oldloader.h"
diff --git a/src/saveload/oldloader_sl.cpp b/src/saveload/oldloader_sl.cpp
index 1de407082..6052312b0 100644
--- a/src/saveload/oldloader_sl.cpp
+++ b/src/saveload/oldloader_sl.cpp
@@ -3,7 +3,6 @@
/** @file oldloader_sl.cpp Chunks and fix-ups for TTO/TTD/TTDP savegames. TTO loader code is based on SVXConverter by Roman Vetter. */
#include "../stdafx.h"
-#include "../station_map.h"
#include "../town.h"
#include "../industry.h"
#include "../company_func.h"
@@ -19,9 +18,7 @@
#include "../date_func.h"
#include "../vehicle_func.h"
#include "../variables.h"
-#include "../strings_func.h"
#include "../effectvehicle_base.h"
-#include "../string_func.h"
#include "../core/mem_func.hpp"
#include "../core/alloc_type.hpp"
#include "saveload_internal.h"
diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp
index 466a67d53..43b0616f5 100644
--- a/src/saveload/saveload.cpp
+++ b/src/saveload/saveload.cpp
@@ -25,7 +25,6 @@
#include "../strings_func.h"
#include "../gfx_func.h"
#include "../core/alloc_func.hpp"
-#include "../functions.h"
#include "../core/endian_func.hpp"
#include "../vehicle_base.h"
#include "../company_func.h"
@@ -37,11 +36,8 @@
#include "table/strings.h"
-#include "saveload.h"
#include "saveload_internal.h"
-#include <list>
-
extern const uint16 SAVEGAME_VERSION = 112;
SavegameType _savegame_type; ///< type of savegame we are loading
@@ -1160,7 +1156,6 @@ static void UninitNoComp()
********** START OF MEMORY CODE (in ram)****
********************************************/
-#include "../table/sprites.h"
#include "../gui.h"
struct ThreadedSave {
diff --git a/src/saveload/signs_sl.cpp b/src/saveload/signs_sl.cpp
index 7dbb9e355..3006a50de 100644
--- a/src/saveload/signs_sl.cpp
+++ b/src/saveload/signs_sl.cpp
@@ -3,12 +3,9 @@
/** @file signs_sl.cpp Code handling saving and loading of economy data */
#include "../stdafx.h"
-#include "../strings_func.h"
#include "../company_func.h"
#include "../signs_base.h"
-#include "../signs_func.h"
-#include "saveload_internal.h"
#include "saveload.h"
static const SaveLoad _sign_desc[] = {
diff --git a/src/saveload/strings_sl.cpp b/src/saveload/strings_sl.cpp
index e220d687a..cd5cd187d 100644
--- a/src/saveload/strings_sl.cpp
+++ b/src/saveload/strings_sl.cpp
@@ -3,17 +3,12 @@
/** @file strings_sl.cpp Code handling saving and loading of strings */
#include "../stdafx.h"
-#include "../strings_type.h"
-#include "../core/math_func.hpp"
-#include "../core/bitmath_func.hpp"
#include "../core/alloc_func.hpp"
#include "../string_func.h"
#include "saveload_internal.h"
#include "table/strings.h"
-#include "saveload.h"
-
/**
* Remap a string ID from the old format to the new format
* @param s StringID that requires remapping
diff --git a/src/saveload/town_sl.cpp b/src/saveload/town_sl.cpp
index eaa3edaa3..dac520181 100644
--- a/src/saveload/town_sl.cpp
+++ b/src/saveload/town_sl.cpp
@@ -3,11 +3,9 @@
/** @file town_sl.cpp Code handling saving and loading of towns and houses */
#include "../stdafx.h"
-#include "../town.h"
#include "../newgrf_house.h"
#include "../newgrf_commons.h"
#include "../variables.h"
-#include "../tile_map.h"
#include "../town_map.h"
#include "saveload.h"
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index 90d7ef312..1bde737d6 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -3,7 +3,6 @@
/** @file vehicle_sl.cpp Code handling saving and loading of vehicles */
#include "../stdafx.h"
-#include "../vehicle_base.h"
#include "../vehicle_func.h"
#include "../train.h"
#include "../roadveh.h"
diff --git a/src/screenshot.cpp b/src/screenshot.cpp
index 4fd62c4dd..86fedccf5 100644
--- a/src/screenshot.cpp
+++ b/src/screenshot.cpp
@@ -4,15 +4,12 @@
#include "stdafx.h"
#include "openttd.h"
-#include "debug.h"
#include "fileio_func.h"
#include "viewport_func.h"
#include "gfx_func.h"
-#include "core/math_func.hpp"
#include "screenshot.h"
#include "variables.h"
#include "blitter/factory.hpp"
-#include "strings_func.h"
#include "zoom_func.h"
#include "core/alloc_func.hpp"
#include "core/endian_func.hpp"
@@ -20,7 +17,6 @@
#include "saveload/saveload.h"
#include "company_func.h"
-#include "table/strings.h"
char _screenshot_format_name[8];
uint _num_screenshot_formats;
diff --git a/src/settings.cpp b/src/settings.cpp
index 477801bf5..a103b7f96 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -31,26 +31,19 @@
#include "console_func.h"
#include "npf.h"
#include "yapf/yapf.h"
-#include "newgrf.h"
-#include "newgrf_config.h"
#include "genworld.h"
-#include "rail.h"
#include "train.h"
#include "news_func.h"
#include "window_func.h"
#include "strings_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
-#include "core/alloc_func.hpp"
#include "company_func.h"
#include "rev.h"
#ifdef WITH_FREETYPE
#include "fontcache.h"
#endif
-#include "spritecache.h"
-#include "transparency.h"
#include "textbuf_gui.h"
-#include "string_func.h"
#include "rail_gui.h"
#include "elrail_func.h"
#include "gui.h"
@@ -64,11 +57,8 @@
#include "station_func.h"
#include "settings_func.h"
#include "ini_type.h"
-#include "ai/ai.hpp"
#include "ai/ai_config.hpp"
-#include "ai/ai_info.hpp"
-#include "tile_map.h"
#include "void_map.h"
#include "station_base.h"
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 7cada8411..1fd57f93d 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -11,16 +11,13 @@
#include "command_func.h"
#include "engine_func.h"
#include "screenshot.h"
-#include "newgrf.h"
#include "network/network.h"
#include "town.h"
#include "variables.h"
#include "settings_internal.h"
#include "newgrf_townname.h"
#include "strings_func.h"
-#include "functions.h"
#include "window_func.h"
-#include "core/alloc_func.hpp"
#include "string_func.h"
#include "gfx_func.h"
#include "waypoint.h"
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index e675ebd77..275b9b9dc 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -3,30 +3,19 @@
/** @file ship_cmd.cpp Handling of ships. */
#include "stdafx.h"
-#include "openttd.h"
#include "ship.h"
-#include "tile_cmd.h"
#include "landscape.h"
#include "timetable.h"
#include "command_func.h"
#include "pathfind.h"
#include "station_map.h"
-#include "station_base.h"
#include "news_func.h"
-#include "engine_func.h"
-#include "engine_base.h"
#include "company_func.h"
-#include "company_base.h"
#include "npf.h"
#include "depot_base.h"
-#include "depot_func.h"
#include "vehicle_gui.h"
#include "newgrf_engine.h"
-#include "water_map.h"
#include "yapf/yapf.h"
-#include "debug.h"
-#include "newgrf_callbacks.h"
-#include "newgrf_text.h"
#include "newgrf_sound.h"
#include "spritecache.h"
#include "strings_func.h"
@@ -38,9 +27,8 @@
#include "variables.h"
#include "autoreplace_gui.h"
#include "gfx_func.h"
-#include "settings_type.h"
-#include "order_func.h"
#include "effectvehicle_func.h"
+#include "settings_type.h"
#include "ai/ai.hpp"
#include "table/strings.h"
diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp
index 2a57c3aeb..dd1ca03fd 100644
--- a/src/ship_gui.cpp
+++ b/src/ship_gui.cpp
@@ -3,21 +3,14 @@
/** @file ship_gui.cpp GUI for ships. */
#include "stdafx.h"
-#include "openttd.h"
-#include "debug.h"
-#include "ship.h"
-#include "gui.h"
+#include "vehicle_base.h"
#include "window_gui.h"
-#include "viewport_func.h"
#include "gfx_func.h"
#include "vehicle_gui.h"
-#include "newgrf_engine.h"
#include "strings_func.h"
#include "vehicle_func.h"
-#include "order_func.h"
#include "table/strings.h"
-#include "table/sprites.h"
void DrawShipImage(const Vehicle *v, int x, int y, VehicleID selection)
{
diff --git a/src/signal.cpp b/src/signal.cpp
index 98881c7f0..826992370 100644
--- a/src/signal.cpp
+++ b/src/signal.cpp
@@ -3,21 +3,12 @@
/** @file signal.cpp functions related to rail signals updating */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
-#include "tile_cmd.h"
-#include "rail_map.h"
-#include "road_map.h"
#include "station_map.h"
#include "tunnelbridge_map.h"
#include "vehicle_func.h"
-#include "train.h"
-#include "newgrf_station.h"
+#include "vehicle_base.h"
#include "functions.h"
-#include "track_type.h"
-#include "track_func.h"
-#include "signal_func.h"
-#include "company_func.h"
/** these are the maximums used for updating signal blocks */
diff --git a/src/signs.cpp b/src/signs.cpp
index 22fe2a421..267fa5e24 100644
--- a/src/signs.cpp
+++ b/src/signs.cpp
@@ -3,13 +3,11 @@
/** @file signs.cpp Handling of signs. */
#include "stdafx.h"
-#include "openttd.h"
#include "landscape.h"
#include "company_func.h"
#include "signs_base.h"
#include "signs_func.h"
#include "command_func.h"
-#include "variables.h"
#include "strings_func.h"
#include "viewport_func.h"
#include "tilehighlight_func.h"
diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp
index 23366cf50..0d3830d63 100644
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -3,19 +3,13 @@
/** @file signs_gui.cpp The GUI for signs. */
#include "stdafx.h"
-#include "openttd.h"
-#include "gui.h"
-#include "textbuf_gui.h"
-#include "window_gui.h"
#include "company_gui.h"
#include "company_func.h"
#include "signs_base.h"
#include "signs_func.h"
#include "debug.h"
-#include "variables.h"
#include "command_func.h"
#include "strings_func.h"
-#include "core/alloc_func.hpp"
#include "window_func.h"
#include "map_func.h"
#include "gfx_func.h"
@@ -25,7 +19,6 @@
#include "string_func.h"
#include "table/strings.h"
-#include "table/sprites.h"
struct SignList {
typedef GUIList<const Sign *> GUISignList;
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 6e76a43ee..0248083fe 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -3,22 +3,15 @@
/** @file smallmap_gui.cpp GUI that shows a small map of the world with metadata like owner or height. */
#include "stdafx.h"
-#include "openttd.h"
-#include "bridge_map.h"
#include "clear_map.h"
#include "industry_map.h"
-#include "industry.h"
#include "station_map.h"
#include "landscape.h"
-#include "gui.h"
#include "window_gui.h"
#include "tree_map.h"
-#include "tunnel_map.h"
#include "viewport_func.h"
#include "gfx_func.h"
-#include "company_base.h"
#include "town.h"
-#include "variables.h"
#include "blitter/factory.hpp"
#include "tunnelbridge_map.h"
#include "strings_func.h"
@@ -26,7 +19,6 @@
#include "core/endian_func.hpp"
#include "vehicle_base.h"
#include "sound_func.h"
-#include "settings_type.h"
#include "window_func.h"
#include "table/strings.h"
diff --git a/src/sound.cpp b/src/sound.cpp
index 429710f66..586d12c1a 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -3,15 +3,12 @@
/** @file sound.cpp Handling of playing sounds. */
#include "stdafx.h"
-#include "openttd.h"
#include "landscape.h"
#include "mixer.h"
-#include "sound_func.h"
#include "fileio_func.h"
#include "newgrf_sound.h"
#include "fios.h"
#include "window_gui.h"
-#include "core/alloc_func.hpp"
#include "map_func.h"
#include "vehicle_base.h"
#include "debug.h"
diff --git a/src/sound/sdl_s.cpp b/src/sound/sdl_s.cpp
index 753bce764..d111ac8ed 100644
--- a/src/sound/sdl_s.cpp
+++ b/src/sound/sdl_s.cpp
@@ -6,7 +6,6 @@
#include "../stdafx.h"
-#include "../driver.h"
#include "../mixer.h"
#include "../sdl.h"
#include "sdl_s.h"
diff --git a/src/spritecache.cpp b/src/spritecache.cpp
index e26029a1b..d38090255 100644
--- a/src/spritecache.cpp
+++ b/src/spritecache.cpp
@@ -3,21 +3,16 @@
/** @file spritecache.cpp Caching of sprites. */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
-#include "debug.h"
-#include "spritecache.h"
+#include "gfx_type.h"
#include "fileio_func.h"
#include "spriteloader/grf.hpp"
#include "core/alloc_func.hpp"
-#include "core/math_func.hpp"
#include "gfx_func.h"
#ifdef WITH_PNG
#include "spriteloader/png.hpp"
#endif /* WITH_PNG */
#include "blitter/factory.hpp"
#include "core/math_func.hpp"
-#include "core/enum_type.hpp"
#include "table/sprites.h"
diff --git a/src/station.cpp b/src/station.cpp
index bb961b07f..2480fb1aa 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -3,20 +3,9 @@
/** @file station.cpp Implementation of the station base class. */
#include "stdafx.h"
-#include "openttd.h"
-#include "bridge_map.h"
-#include "debug.h"
-#include "station_map.h"
-#include "station_base.h"
-#include "town.h"
#include "company_func.h"
-#include "airport.h"
-#include "sprite.h"
-#include "train.h"
-#include "water_map.h"
-#include "industry_map.h"
-#include "newgrf_callbacks.h"
-#include "newgrf_station.h"
+#include "industry.h"
+#include "newgrf_cargo.h"
#include "yapf/yapf.h"
#include "cargotype.h"
#include "roadveh.h"
@@ -26,15 +15,12 @@
#include "functions.h"
#include "window_func.h"
#include "date_func.h"
-#include "variables.h"
-#include "settings_type.h"
#include "command_func.h"
-#include "order_func.h"
#include "news_func.h"
#include "aircraft.h"
#include "vehicle_gui.h"
+#include "settings_type.h"
-#include "table/sprites.h"
#include "table/strings.h"
Station::Station(TileIndex tile)
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 67f1dbab6..74a8147d1 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -7,30 +7,20 @@
#include "aircraft.h"
#include "bridge_map.h"
#include "cmd_helper.h"
-#include "debug.h"
-#include "tile_cmd.h"
#include "landscape.h"
-#include "station_map.h"
#include "viewport_func.h"
#include "command_func.h"
#include "town.h"
#include "news_func.h"
-#include "airport.h"
-#include "sprite.h"
#include "train.h"
#include "roadveh.h"
-#include "water_map.h"
#include "industry_map.h"
-#include "newgrf_callbacks.h"
#include "newgrf_station.h"
#include "newgrf_commons.h"
#include "yapf/yapf.h"
-#include "road_type.h"
#include "road_internal.h" /* For drawing catenary/checking road removal */
-#include "cargotype.h"
#include "variables.h"
#include "autoslope.h"
-#include "transparency.h"
#include "water.h"
#include "station_gui.h"
#include "strings_func.h"
@@ -39,14 +29,10 @@
#include "date_func.h"
#include "vehicle_func.h"
#include "string_func.h"
-#include "signal_func.h"
#include "oldpool_func.h"
#include "animated_tile_func.h"
#include "elrail_func.h"
-#include "newgrf.h"
-#include "core/smallvec_type.hpp"
-#include "table/sprites.h"
#include "table/strings.h"
DEFINE_OLD_POOL_GENERIC(Station, Station)
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 4cfdb6b90..62d3d642d 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -8,33 +8,23 @@
#include "gui.h"
#include "window_gui.h"
#include "textbuf_gui.h"
-#include "station_base.h"
#include "company_func.h"
-#include "economy_func.h"
-#include "town.h"
#include "command_func.h"
-#include "variables.h"
#include "vehicle_gui.h"
#include "cargotype.h"
#include "station_gui.h"
-#include "station_func.h"
#include "strings_func.h"
-#include "core/alloc_func.hpp"
#include "window_func.h"
#include "viewport_func.h"
#include "gfx_func.h"
#include "widgets/dropdown_func.h"
#include "newgrf_cargo.h"
-#include "map_func.h"
-#include "settings_type.h"
-#include "tile_map.h"
#include "station_map.h"
#include "tilehighlight_func.h"
-#include "core/smallvec_type.hpp"
#include "core/smallmap_type.hpp"
-#include "string_func.h"
#include "company_base.h"
#include "sortlist_type.h"
+#include "settings_type.h"
#include "table/strings.h"
#include "table/sprites.h"
diff --git a/src/string.cpp b/src/string.cpp
index f3ab41623..7a2f1aabb 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -3,7 +3,6 @@
/** @file string.cpp Handling of C-type strings (char*). */
#include "stdafx.h"
-#include "openttd.h"
#include "debug.h"
#include "core/alloc_func.hpp"
#include "core/math_func.hpp"
diff --git a/src/strings.cpp b/src/strings.cpp
index 78cd652c6..83231b2ce 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -5,38 +5,29 @@
#include "stdafx.h"
#include "openttd.h"
#include "currency.h"
+#include "spritecache.h"
#include "namegen_func.h"
#include "station_base.h"
#include "town.h"
#include "screenshot.h"
#include "waypoint.h"
#include "industry.h"
-#include "variables.h"
#include "newgrf_text.h"
#include "music.h"
#include "fileio_func.h"
-#include "cargotype.h"
#include "group.h"
-#include "debug.h"
#include "newgrf_townname.h"
#include "signs_base.h"
-#include "newgrf_engine.h"
-#include "spritecache.h"
+#include "cargotype.h"
#include "fontcache.h"
#include "gui.h"
#include "strings_func.h"
-#include "functions.h"
#include "rev.h"
#include "core/endian_func.hpp"
#include "date_func.h"
#include "vehicle_base.h"
-#include "string_func.h"
#include "company_func.h"
-#include "company_base.h"
-#include "fios.h"
-#include "settings_type.h"
#include "video/video_driver.hpp"
-#include "engine_func.h"
#include "engine_base.h"
#include "strgen/strgen.h"
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp
index 53fe13647..8f0c344d7 100644
--- a/src/subsidy_gui.cpp
+++ b/src/subsidy_gui.cpp
@@ -3,12 +3,10 @@
/** @file subsidy_gui.cpp GUI for subsidies. */
#include "stdafx.h"
-#include "openttd.h"
#include "station_base.h"
#include "industry.h"
#include "town.h"
#include "economy_func.h"
-#include "variables.h"
#include "cargotype.h"
#include "window_gui.h"
#include "strings_func.h"
diff --git a/src/terraform_cmd.cpp b/src/terraform_cmd.cpp
index bdcc49fab..c67312973 100644
--- a/src/terraform_cmd.cpp
+++ b/src/terraform_cmd.cpp
@@ -4,14 +4,13 @@
#include "stdafx.h"
#include "openttd.h"
-#include "strings_type.h"
#include "command_func.h"
-#include "tile_map.h"
#include "tunnel_map.h"
#include "bridge_map.h"
#include "variables.h"
#include "functions.h"
#include "economy_func.h"
+#include "settings_type.h"
#include "table/strings.h"
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 5a9a1cf40..f60d92cf7 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -4,7 +4,6 @@
#include "stdafx.h"
#include "openttd.h"
-#include "bridge_map.h"
#include "clear_map.h"
#include "company_func.h"
#include "company_base.h"
@@ -22,10 +21,10 @@
#include "unmovable_map.h"
#include "textbuf_gui.h"
#include "genworld.h"
-#include "settings_type.h"
#include "tree_map.h"
#include "landscape_type.h"
#include "tilehighlight_func.h"
+#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/texteff.cpp b/src/texteff.cpp
index cf71d9c5d..ef8ba25fc 100644
--- a/src/texteff.cpp
+++ b/src/texteff.cpp
@@ -4,9 +4,7 @@
#include "stdafx.h"
#include "openttd.h"
-#include "landscape.h"
-#include "gfx_func.h"
-#include "variables.h"
+#include "strings_type.h"
#include "texteff.hpp"
#include "core/bitmath_func.hpp"
#include "transparency.h"
diff --git a/src/tgp.cpp b/src/tgp.cpp
index 12bfbf69b..4916e97a4 100644
--- a/src/tgp.cpp
+++ b/src/tgp.cpp
@@ -4,18 +4,13 @@
#include "stdafx.h"
#include <math.h>
-#include "openttd.h"
#include "clear_map.h"
-#include "variables.h"
#include "void_map.h"
-#include "tgp.h"
#include "genworld.h"
#include "core/alloc_func.hpp"
#include "core/random_func.hpp"
-#include "settings_type.h"
#include "landscape_type.h"
-
-#include "table/strings.h"
+#include "settings_type.h"
/*
*
diff --git a/src/thread_pthread.cpp b/src/thread_pthread.cpp
index 2ab3d43f7..bcfaf8c85 100644
--- a/src/thread_pthread.cpp
+++ b/src/thread_pthread.cpp
@@ -4,12 +4,7 @@
#include "stdafx.h"
#include "thread.h"
-#include "debug.h"
-#include "core/alloc_func.hpp"
-#include <stdlib.h>
#include <pthread.h>
-#include <semaphore.h>
-#include <unistd.h>
/**
* POSIX pthread version for ThreadObject.
diff --git a/src/tile_map.cpp b/src/tile_map.cpp
index c8977d6d1..201328b8e 100644
--- a/src/tile_map.cpp
+++ b/src/tile_map.cpp
@@ -3,9 +3,9 @@
/** @file tile_map.cpp Global tile accessors. */
#include "stdafx.h"
-#include "openttd.h"
#include "tile_map.h"
#include "core/math_func.hpp"
+#include "settings_type.h"
/**
* Return the slope of a given tile
diff --git a/src/timetable_cmd.cpp b/src/timetable_cmd.cpp
index 3d35ceb12..7ff52684c 100644
--- a/src/timetable_cmd.cpp
+++ b/src/timetable_cmd.cpp
@@ -3,12 +3,9 @@
/** @file timetable_cmd.cpp Commands related to time tabling. */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
#include "command_func.h"
#include "functions.h"
#include "window_func.h"
-#include "vehicle_func.h"
#include "vehicle_base.h"
#include "settings_type.h"
diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp
index 6920d2a1e..7d1b463e4 100644
--- a/src/timetable_gui.cpp
+++ b/src/timetable_gui.cpp
@@ -3,20 +3,16 @@
/** @file timetable_gui.cpp GUI for time tabling. */
#include "stdafx.h"
-#include "openttd.h"
-#include "variables.h"
#include "command_func.h"
#include "gui.h"
#include "window_gui.h"
#include "window_func.h"
#include "textbuf_gui.h"
-#include "cargotype.h"
#include "strings_func.h"
#include "vehicle_base.h"
#include "string_func.h"
#include "gfx_func.h"
#include "company_func.h"
-#include "order_func.h"
#include "settings_type.h"
#include "table/strings.h"
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 2ba49dab3..29d5c62e6 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -10,8 +10,6 @@
#include "viewport_func.h"
#include "command_func.h"
#include "variables.h"
-#include "train.h"
-#include "roadveh.h"
#include "vehicle_gui.h"
#include "rail_gui.h"
#include "road_gui.h"
@@ -21,17 +19,12 @@
#include "terraform_gui.h"
#include "transparency.h"
#include "strings_func.h"
-#include "company_base.h"
#include "company_func.h"
#include "company_gui.h"
-#include "settings_type.h"
-#include "toolbar_gui.h"
#include "vehicle_base.h"
-#include "gfx_func.h"
#include "cheat_func.h"
#include "transparency_gui.h"
#include "screenshot.h"
-#include "newgrf_config.h"
#include "signs_func.h"
#include "fios.h"
#include "functions.h"
@@ -40,8 +33,9 @@
#include "ai/ai_gui.hpp"
#include "tilehighlight_func.h"
#include "rail.h"
-#include "widgets/dropdown_func.h"
#include "widgets/dropdown_type.h"
+#include "settings_type.h"
+#include "newgrf_config.h"
#include "network/network.h"
#include "network/network_gui.h"
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp
index 7be47fa6a..4d00a9e91 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -4,16 +4,12 @@
#include "stdafx.h"
#include "openttd.h"
-#include "tile_cmd.h"
-#include "debug.h"
-#include "road_map.h"
+#include "road_type.h"
#include "road_internal.h" /* Cleaning up road bits */
#include "road_cmd.h"
#include "landscape.h"
#include "town_map.h"
-#include "tunnel_map.h"
#include "viewport_func.h"
-#include "town.h"
#include "command_func.h"
#include "industry.h"
#include "station_base.h"
@@ -23,11 +19,9 @@
#include "unmovable_map.h"
#include "water_map.h"
#include "variables.h"
-#include "bridge.h"
-#include "bridge_map.h"
+#include "slope_func.h"
#include "genworld.h"
#include "newgrf.h"
-#include "newgrf_callbacks.h"
#include "newgrf_house.h"
#include "newgrf_commons.h"
#include "newgrf_townname.h"
@@ -41,17 +35,15 @@
#include "string_func.h"
#include "newgrf_cargo.h"
#include "oldpool_func.h"
-#include "sprite.h"
#include "economy_func.h"
#include "station_func.h"
-#include "cheat_func.h"
+#include "cheat_type.h"
#include "functions.h"
#include "animated_tile_func.h"
#include "date_func.h"
#include "core/smallmap_type.hpp"
#include "table/strings.h"
-#include "table/sprites.h"
#include "table/town_land.h"
uint _total_towns;
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 9a97b0b9c..20f68492f 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -4,7 +4,6 @@
#include "stdafx.h"
#include "openttd.h"
-#include "debug.h"
#include "town.h"
#include "viewport_func.h"
#include "gfx_func.h"
@@ -20,10 +19,7 @@
#include "strings_func.h"
#include "sound_func.h"
#include "economy_func.h"
-#include "core/alloc_func.hpp"
-#include "settings_type.h"
#include "tilehighlight_func.h"
-#include "string_func.h"
#include "sortlist_type.h"
#include "road_cmd.h"
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 68711db40..f6927164a 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3,59 +3,36 @@
/** @file train_cmd.cpp Handling of trains. */
#include "stdafx.h"
-#include "openttd.h"
-#include "bridge_map.h"
-#include "debug.h"
-#include "tile_cmd.h"
-#include "landscape.h"
#include "gui.h"
-#include "station_map.h"
-#include "tunnel_map.h"
#include "articulated_vehicles.h"
#include "command_func.h"
-#include "pathfind.h"
#include "npf.h"
-#include "station_base.h"
#include "news_func.h"
#include "engine_func.h"
#include "engine_base.h"
#include "company_func.h"
-#include "company_base.h"
#include "depot_base.h"
-#include "depot_func.h"
-#include "waypoint.h"
#include "vehicle_gui.h"
#include "train.h"
-#include "bridge.h"
-#include "newgrf_callbacks.h"
#include "newgrf_engine.h"
#include "newgrf_sound.h"
#include "newgrf_text.h"
-#include "direction_func.h"
-#include "yapf/yapf.h"
#include "yapf/follow_track.hpp"
-#include "cargotype.h"
#include "group.h"
#include "table/sprites.h"
-#include "tunnelbridge_map.h"
#include "strings_func.h"
#include "functions.h"
#include "window_func.h"
-#include "date_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
-#include "signal_func.h"
#include "variables.h"
#include "autoreplace_gui.h"
#include "gfx_func.h"
#include "ai/ai.hpp"
-#include "settings_type.h"
-#include "order_func.h"
#include "newgrf_station.h"
#include "effectvehicle_func.h"
#include "gamelog.h"
#include "network/network.h"
-#include "pbs.h"
#include "table/strings.h"
#include "table/train_cmd.h"
diff --git a/src/train_gui.cpp b/src/train_gui.cpp
index 57e96ce87..4956c2950 100644
--- a/src/train_gui.cpp
+++ b/src/train_gui.cpp
@@ -3,9 +3,6 @@
/** @file train_gui.cpp GUI for trains. */
#include "stdafx.h"
-#include "openttd.h"
-#include "debug.h"
-#include "gui.h"
#include "window_gui.h"
#include "gfx_func.h"
#include "command_func.h"
@@ -14,11 +11,9 @@
#include "newgrf_engine.h"
#include "strings_func.h"
#include "vehicle_func.h"
-#include "settings_type.h"
-#include "order_func.h"
-#include "engine_func.h"
#include "engine_base.h"
#include "window_func.h"
+#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp
index feff1c4ee..c8b9a6ae7 100644
--- a/src/transparency_gui.cpp
+++ b/src/transparency_gui.cpp
@@ -4,9 +4,7 @@
#include "stdafx.h"
#include "openttd.h"
-#include "gui.h"
#include "window_gui.h"
-#include "variables.h"
#include "transparency.h"
#include "sound_func.h"
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index 9526a4dff..887d2d819 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -4,9 +4,7 @@
#include "stdafx.h"
#include "openttd.h"
-#include "bridge_map.h"
#include "clear_map.h"
-#include "tile_cmd.h"
#include "landscape.h"
#include "tree_map.h"
#include "viewport_func.h"
@@ -19,7 +17,6 @@
#include "functions.h"
#include "company_func.h"
#include "sound_func.h"
-#include "settings_type.h"
#include "water_map.h"
#include "water.h"
#include "landscape_type.h"
diff --git a/src/tunnel_map.cpp b/src/tunnel_map.cpp
index 8400c9483..bbb6a27da 100644
--- a/src/tunnel_map.cpp
+++ b/src/tunnel_map.cpp
@@ -3,8 +3,6 @@
/** @file tunnel_map.cpp Map accessors for tunnels. */
#include "stdafx.h"
-#include "openttd.h"
-#include "tunnel_map.h"
#include "tunnelbridge_map.h"
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 27667219f..9799a557d 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -7,38 +7,28 @@
#include "stdafx.h"
#include "openttd.h"
-#include "bridge_map.h"
#include "rail_map.h"
-#include "road_map.h"
-#include "tile_cmd.h"
#include "landscape.h"
-#include "tunnel_map.h"
+#include "town_type.h"
#include "unmovable_map.h"
#include "viewport_func.h"
#include "command_func.h"
#include "town.h"
#include "variables.h"
-#include "bridge.h"
#include "train.h"
#include "water_map.h"
#include "yapf/yapf.h"
#include "newgrf_sound.h"
#include "autoslope.h"
-#include "transparency.h"
#include "tunnelbridge_map.h"
#include "strings_func.h"
#include "date_func.h"
#include "functions.h"
#include "vehicle_func.h"
#include "sound_func.h"
-#include "signal_func.h"
#include "tunnelbridge.h"
-#include "company_base.h"
-#include "engine_func.h"
#include "engine_base.h"
-#include "economy_func.h"
-#include "rail.h"
-#include "cheat_func.h"
+#include "cheat_type.h"
#include "elrail_func.h"
#include "landscape_type.h"
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index adcc57bac..ce7e09d26 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -4,29 +4,23 @@
#include "stdafx.h"
#include "openttd.h"
-#include "tile_cmd.h"
#include "landscape.h"
#include "command_func.h"
#include "viewport_func.h"
-#include "company_func.h"
#include "company_base.h"
-#include "gui.h"
#include "town.h"
#include "sprite.h"
#include "bridge_map.h"
#include "unmovable_map.h"
-#include "variables.h"
#include "genworld.h"
-#include "bridge.h"
#include "autoslope.h"
#include "transparency.h"
#include "functions.h"
#include "window_func.h"
#include "vehicle_func.h"
#include "company_gui.h"
-#include "station_type.h"
#include "economy_func.h"
-#include "cheat_func.h"
+#include "cheat_type.h"
#include "landscape_type.h"
#include "table/strings.h"
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 3adee9121..0e77d83b1 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -4,59 +4,42 @@
#include "stdafx.h"
#include "openttd.h"
-#include "road_map.h"
#include "roadveh.h"
#include "ship.h"
#include "spritecache.h"
-#include "tile_cmd.h"
#include "landscape.h"
#include "timetable.h"
#include "viewport_func.h"
#include "gfx_func.h"
#include "news_func.h"
#include "command_func.h"
-#include "saveload/saveload.h"
#include "company_func.h"
-#include "debug.h"
#include "vehicle_gui.h"
-#include "rail_type.h"
#include "train.h"
#include "aircraft.h"
-#include "industry_map.h"
-#include "station_map.h"
-#include "water_map.h"
-#include "yapf/yapf.h"
-#include "newgrf_callbacks.h"
#include "newgrf_engine.h"
#include "newgrf_sound.h"
#include "newgrf_station.h"
#include "newgrf_text.h"
#include "group.h"
#include "group_gui.h"
-#include "order_func.h"
#include "strings_func.h"
#include "zoom_func.h"
#include "functions.h"
#include "date_func.h"
#include "window_func.h"
#include "vehicle_func.h"
-#include "signal_func.h"
-#include "sound_func.h"
-#include "variables.h"
#include "autoreplace_func.h"
#include "autoreplace_gui.h"
#include "string_func.h"
-#include "settings_type.h"
#include "oldpool_func.h"
#include "depot_map.h"
-#include "animated_tile_func.h"
-#include "effectvehicle_base.h"
#include "ai/ai.hpp"
-#include "core/alloc_func.hpp"
#include "core/smallmap_type.hpp"
#include "vehiclelist.h"
#include "core/mem_func.hpp"
#include "depot_func.h"
+#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 76a26f3fa..2bfe386bf 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -10,36 +10,25 @@
#include "window_gui.h"
#include "textbuf_gui.h"
#include "command_func.h"
-#include "variables.h"
#include "vehicle_gui.h"
#include "vehicle_gui_base.h"
#include "viewport_func.h"
#include "gfx_func.h"
-#include "train.h"
-#include "newgrf_callbacks.h"
#include "newgrf_engine.h"
#include "newgrf_text.h"
-#include "ship.h"
-#include "aircraft.h"
+#include "station_map.h"
#include "roadveh.h"
#include "depot_base.h"
-#include "cargotype.h"
-#include "group.h"
#include "group_gui.h"
#include "strings_func.h"
-#include "functions.h"
#include "window_func.h"
#include "vehicle_func.h"
#include "autoreplace_gui.h"
-#include "core/alloc_func.hpp"
-#include "core/mem_func.hpp"
-#include "core/sort_func.hpp"
#include "string_func.h"
-#include "settings_type.h"
#include "widgets/dropdown_func.h"
-#include "order_func.h"
#include "timetable.h"
#include "vehiclelist.h"
+#include "settings_type.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp
index af3da1b12..6ecdc5964 100644
--- a/src/vehiclelist.cpp
+++ b/src/vehiclelist.cpp
@@ -3,12 +3,7 @@
/** @file vehiclelist.cpp Lists of vehicles. */
#include "stdafx.h"
-#include "openttd.h"
-#include "vehicle_type.h"
-#include "vehicle_func.h"
-#include "vehicle_base.h"
#include "vehicle_gui.h"
-#include "core/alloc_func.hpp"
#include "train.h"
#include "vehiclelist.h"
diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp
index 57f936d98..21ce2bd1d 100644
--- a/src/video/dedicated_v.cpp
+++ b/src/video/dedicated_v.cpp
@@ -7,9 +7,7 @@
#ifdef ENABLE_NETWORK
#include "../openttd.h"
-#include "../debug.h"
#include "../gfx_func.h"
-#include "../network/network.h"
#include "../network/network_internal.h"
#include "../console_func.h"
#include "../variables.h"
@@ -17,7 +15,6 @@
#include "../fileio_type.h"
#include "../fios.h"
#include "../blitter/factory.hpp"
-#include "../core/alloc_func.hpp"
#include "../company_func.h"
#include "../core/random_func.hpp"
#include "dedicated_v.h"
diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp
index 85ea8f758..bce99e7c7 100644
--- a/src/video/null_v.cpp
+++ b/src/video/null_v.cpp
@@ -3,10 +3,7 @@
/** @file null_v.cpp The videio driver that doesn't blit. */
#include "../stdafx.h"
-#include "../openttd.h"
#include "../gfx_func.h"
-#include "../variables.h"
-#include "../debug.h"
#include "../blitter/factory.hpp"
#include "null_v.h"
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 380a3a857..e9068bd7e 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -6,17 +6,13 @@
#include "../stdafx.h"
#include "../openttd.h"
-#include "../debug.h"
#include "../gfx_func.h"
#include "../sdl.h"
#include "../variables.h"
#include "../rev.h"
#include "../blitter/factory.hpp"
#include "../network/network.h"
-#include "../core/math_func.hpp"
-#include "../core/random_func.hpp"
#include "../functions.h"
-#include "../texteff.hpp"
#include "sdl_v.h"
#include <SDL.h>
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 114db297e..b05c8694a 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -20,20 +20,14 @@
#include "stdafx.h"
#include "openttd.h"
-#include "debug.h"
-#include "tile_cmd.h"
-#include "gui.h"
-#include "spritecache.h"
#include "landscape.h"
#include "viewport_func.h"
#include "station_base.h"
#include "town.h"
#include "signs_base.h"
#include "signs_func.h"
-#include "waypoint.h"
#include "variables.h"
-#include "train.h"
-#include "roadveh.h"
+#include "vehicle_base.h"
#include "vehicle_gui.h"
#include "blitter/factory.hpp"
#include "transparency.h"
@@ -41,10 +35,7 @@
#include "zoom_func.h"
#include "vehicle_func.h"
#include "company_func.h"
-#include "settings_type.h"
#include "station_func.h"
-#include "core/alloc_type.hpp"
-#include "core/smallvec_type.hpp"
#include "window_func.h"
#include "tilehighlight_func.h"
#include "window_gui.h"
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index c24e8d500..9d6921c10 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -4,11 +4,7 @@
#include "stdafx.h"
#include "openttd.h"
-#include "bridge_map.h"
-#include "bridge.h"
#include "cmd_helper.h"
-#include "station_map.h"
-#include "tile_cmd.h"
#include "landscape.h"
#include "viewport_func.h"
#include "command_func.h"
@@ -20,9 +16,8 @@
#include "train.h"
#include "roadveh.h"
#include "water.h"
-#include "water_map.h"
#include "industry_map.h"
-#include "newgrf.h"
+#include "cargotype.h"
#include "newgrf_canal.h"
#include "transparency.h"
#include "strings_func.h"
@@ -30,17 +25,12 @@
#include "window_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
-#include "variables.h"
#include "company_func.h"
-#include "settings_type.h"
#include "clear_map.h"
#include "tree_map.h"
-#include "station_base.h"
-#include "airport.h"
#include "aircraft.h"
#include "newgrf_cargo.h"
#include "effectvehicle_func.h"
-#include "oldpool_func.h"
#include "tunnelbridge_map.h"
#include "table/sprites.h"
diff --git a/src/waypoint.cpp b/src/waypoint.cpp
index 6ae6aa6b1..c614a08e1 100644
--- a/src/waypoint.cpp
+++ b/src/waypoint.cpp
@@ -3,36 +3,26 @@
/** @file waypoint.cpp Handling of waypoints. */
#include "stdafx.h"
-#include "openttd.h"
#include "command_func.h"
#include "landscape.h"
-#include "order_func.h"
-#include "rail_map.h"
#include "rail.h"
#include "bridge_map.h"
#include "station_base.h"
#include "town.h"
#include "waypoint.h"
-#include "variables.h"
#include "yapf/yapf.h"
-#include "newgrf.h"
#include "strings_func.h"
#include "gfx_func.h"
#include "functions.h"
#include "window_func.h"
-#include "economy_func.h"
#include "date_func.h"
#include "vehicle_func.h"
-#include "vehicle_base.h"
#include "string_func.h"
-#include "signal_func.h"
#include "company_func.h"
-#include "settings_type.h"
#include "newgrf_station.h"
#include "oldpool_func.h"
#include "viewport_func.h"
-#include "pbs.h"
#include "train.h"
#include "table/strings.h"
diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp
index b4ec648ab..906cf5c4d 100644
--- a/src/waypoint_gui.cpp
+++ b/src/waypoint_gui.cpp
@@ -3,14 +3,11 @@
/** @file waypoint_gui.cpp Handling of waypoints gui. */
#include "stdafx.h"
-#include "openttd.h"
#include "window_gui.h"
#include "gui.h"
#include "textbuf_gui.h"
#include "vehicle_gui.h"
-#include "waypoint.h"
#include "viewport_func.h"
-#include "string_func.h"
#include "strings_func.h"
#include "gfx_func.h"
#include "command_func.h"
diff --git a/src/widget.cpp b/src/widget.cpp
index 0e0787043..dfab0c9b3 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -3,13 +3,9 @@
/** @file widget.cpp Handling of the default/simple widgets. */
#include "stdafx.h"
-#include "openttd.h"
-#include "core/math_func.hpp"
#include "company_func.h"
#include "gfx_func.h"
#include "window_gui.h"
-#include "window_func.h"
-#include "widgets/dropdown_func.h"
#include "table/sprites.h"
#include "table/strings.h"
diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp
index 63f1129ee..083f31f38 100644
--- a/src/widgets/dropdown.cpp
+++ b/src/widgets/dropdown.cpp
@@ -3,17 +3,13 @@
/** @file dropdown.cpp Implementation of the dropdown widget. */
#include "../stdafx.h"
-#include "../openttd.h"
-#include "../strings_type.h"
#include "../window_gui.h"
#include "../strings_func.h"
#include "../gfx_func.h"
#include "../window_func.h"
#include "../core/math_func.hpp"
#include "dropdown_type.h"
-#include "dropdown_func.h"
-#include "../table/sprites.h"
#include "table/strings.h"
void DropDownListItem::Draw(int x, int y, uint width, uint height, bool sel, int bg_colour) const
diff --git a/src/window.cpp b/src/window.cpp
index 5ee2e1bf3..50d93117a 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -5,7 +5,6 @@
#include "stdafx.h"
#include <stdarg.h>
#include "openttd.h"
-#include "debug.h"
#include "company_func.h"
#include "gfx_func.h"
#include "console_func.h"
@@ -14,13 +13,11 @@
#include "variables.h"
#include "genworld.h"
#include "blitter/factory.hpp"
-#include "window_gui.h"
#include "zoom_func.h"
-#include "core/alloc_func.hpp"
#include "map_func.h"
#include "vehicle_base.h"
#include "settings_type.h"
-#include "cheat_func.h"
+#include "cheat_type.h"
#include "window_func.h"
#include "tilehighlight_func.h"
#include "network/network.h"
diff --git a/src/yapf/yapf_rail.cpp b/src/yapf/yapf_rail.cpp
index f4988764c..50a33b68b 100644
--- a/src/yapf/yapf_rail.cpp
+++ b/src/yapf/yapf_rail.cpp
@@ -9,7 +9,6 @@
#include "yapf_costrail.hpp"
#include "yapf_destrail.hpp"
#include "../vehicle_func.h"
-#include "../pbs.h"
#include "../functions.h"
#define DEBUG_YAPF_CACHE 0