diff options
32 files changed, 58 insertions, 45 deletions
diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index c2484f44c..0f0a7a399 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -1612,7 +1612,11 @@ > </File> <File - RelativePath=".\..\src\waypoint.h" + RelativePath=".\..\src\waypoint_base.h" + > + </File> + <File + RelativePath=".\..\src\waypoint_func.h" > </File> <File diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj index 325e2f926..c0882f493 100644 --- a/projects/openttd_vs90.vcproj +++ b/projects/openttd_vs90.vcproj @@ -1609,7 +1609,11 @@ > </File> <File - RelativePath=".\..\src\waypoint.h" + RelativePath=".\..\src\waypoint_base.h" + > + </File> + <File + RelativePath=".\..\src\waypoint_func.h" > </File> <File diff --git a/source.list b/source.list index ec6355303..ef804891a 100644 --- a/source.list +++ b/source.list @@ -331,7 +331,8 @@ vehiclelist.h viewport_func.h viewport_type.h water.h -waypoint.h +waypoint_base.h +waypoint_func.h waypoint_type.h widget_type.h win32.h diff --git a/src/ai/api/ai_buoylist.cpp b/src/ai/api/ai_buoylist.cpp index 1412c7860..2c963583b 100644 --- a/src/ai/api/ai_buoylist.cpp +++ b/src/ai/api/ai_buoylist.cpp @@ -3,7 +3,7 @@ /** @file ai_buoylist.cpp Implementation of AIBuoyList and friends. */ #include "ai_buoylist.hpp" -#include "../../waypoint.h" +#include "../../waypoint_base.h" AIBuoyList::AIBuoyList() { diff --git a/src/ai/api/ai_order.cpp b/src/ai/api/ai_order.cpp index 5069bcb5e..8028da8c0 100644 --- a/src/ai/api/ai_order.cpp +++ b/src/ai/api/ai_order.cpp @@ -11,7 +11,7 @@ #include "../../roadstop_base.h" #include "../../depot_base.h" #include "../../station_base.h" -#include "../../waypoint.h" +#include "../../waypoint_base.h" /** * Gets the order type given a tile diff --git a/src/ai/api/ai_rail.cpp b/src/ai/api/ai_rail.cpp index 7e686aac9..05dad3fb3 100644 --- a/src/ai/api/ai_rail.cpp +++ b/src/ai/api/ai_rail.cpp @@ -5,10 +5,10 @@ #include "ai_rail.hpp" #include "ai_map.hpp" #include "ai_station.hpp" +#include "../../command_type.h" #include "../../debug.h" #include "../../station_base.h" #include "../../company_func.h" -#include "../../waypoint.h" #include "../../newgrf_generic.h" #include "../../newgrf_station.h" diff --git a/src/ai/api/ai_waypoint.cpp b/src/ai/api/ai_waypoint.cpp index d7d3b396a..e2a7c3861 100644 --- a/src/ai/api/ai_waypoint.cpp +++ b/src/ai/api/ai_waypoint.cpp @@ -8,7 +8,7 @@ #include "../../string_func.h" #include "../../strings_func.h" #include "../../company_func.h" -#include "../../waypoint.h" +#include "../../waypoint_base.h" #include "../../core/alloc_func.hpp" #include "table/strings.h" diff --git a/src/ai/api/ai_waypointlist.cpp b/src/ai/api/ai_waypointlist.cpp index 20bc58544..1059f0ec5 100644 --- a/src/ai/api/ai_waypointlist.cpp +++ b/src/ai/api/ai_waypointlist.cpp @@ -7,7 +7,7 @@ #include "ai_waypoint.hpp" #include "../../company_func.h" #include "../../vehicle_base.h" -#include "../../waypoint.h" +#include "../../waypoint_base.h" AIWaypointList::AIWaypointList() { diff --git a/src/autoslope.h b/src/autoslope.h index 204536e87..e252c6523 100644 --- a/src/autoslope.h +++ b/src/autoslope.h @@ -8,6 +8,7 @@ #include "settings_type.h" #include "company_func.h" #include "depot_func.h" +#include "slope_func.h" /** * Autoslope check for tiles with an entrance on an edge. diff --git a/src/economy.cpp b/src/economy.cpp index 53d405e47..973e0754c 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -36,6 +36,7 @@ #include "subsidy_base.h" #include "subsidy_func.h" #include "station_base.h" +#include "waypoint_base.h" #include "economy_base.h" #include "core/pool_func.hpp" diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp index cb3cc0d8c..8b57b7c7b 100644 --- a/src/newgrf_station.cpp +++ b/src/newgrf_station.cpp @@ -7,7 +7,7 @@ #include "landscape.h" #include "debug.h" #include "station_base.h" -#include "waypoint.h" +#include "waypoint_base.h" #include "roadstop_base.h" #include "newgrf_commons.h" #include "newgrf_station.h" diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 7e3a890e1..3b1a319ee 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -24,6 +24,7 @@ #include "aircraft.h" #include "roadveh.h" #include "station_base.h" +#include "waypoint_base.h" #include "table/strings.h" diff --git a/src/order_func.h b/src/order_func.h index c8dffe1a3..92139c5b6 100644 --- a/src/order_func.h +++ b/src/order_func.h @@ -10,6 +10,7 @@ #include "tile_type.h" #include "group_type.h" #include "date_type.h" +#include "company_type.h" struct BackuppedOrders { BackuppedOrders() : order(NULL), name(NULL) { } diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 9413788a4..80faadf02 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -25,6 +25,7 @@ #include "network/network.h" #include "settings_type.h" #include "station_base.h" +#include "waypoint_base.h" #include "table/sprites.h" #include "table/strings.h" diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index d7632dd0d..88eea4f30 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -11,7 +11,6 @@ #include "command_func.h" #include "engine_base.h" #include "depot_base.h" -#include "waypoint.h" #include "yapf/yapf.h" #include "newgrf_engine.h" #include "newgrf_station.h" diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index bcb21d63d..6872a3355 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -10,7 +10,7 @@ #include "viewport_func.h" #include "gfx_func.h" #include "command_func.h" -#include "waypoint.h" +#include "waypoint_func.h" #include "newgrf_station.h" #include "company_base.h" #include "strings_func.h" diff --git a/src/saveload/station_sl.cpp b/src/saveload/station_sl.cpp index 603be9cfd..c367273bf 100644 --- a/src/saveload/station_sl.cpp +++ b/src/saveload/station_sl.cpp @@ -4,7 +4,7 @@ #include "../stdafx.h" #include "../station_base.h" -#include "../waypoint.h" +#include "../waypoint_base.h" #include "../roadstop_base.h" #include "../order_base.h" #include "../vehicle_base.h" diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index 94e88996f..04cbfd577 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -3,7 +3,7 @@ /** @file waypoint_sl.cpp Code handling saving and loading of waypoints */ #include "../stdafx.h" -#include "../waypoint.h" +#include "../waypoint_base.h" #include "../newgrf_station.h" #include "../vehicle_base.h" #include "../town.h" diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index d56537a04..359905db5 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -20,7 +20,6 @@ #include "window_func.h" #include "string_func.h" #include "gfx_func.h" -#include "waypoint.h" #include "widgets/dropdown_type.h" #include "widgets/dropdown_func.h" #include "station_func.h" diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index a38bf064b..72271a219 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -33,7 +33,8 @@ #include "elrail_func.h" #include "station_base.h" #include "roadstop_base.h" -#include "waypoint.h" +#include "waypoint_base.h" +#include "waypoint_func.h" #include "table/strings.h" diff --git a/src/strings.cpp b/src/strings.cpp index 4e48f74f1..f26bd60c5 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -10,7 +10,7 @@ #include "station_base.h" #include "town.h" #include "screenshot.h" -#include "waypoint.h" +#include "waypoint_base.h" #include "industry.h" #include "newgrf_text.h" #include "music.h" diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index ec5bc72f9..a0c0eadd3 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -26,7 +26,6 @@ #include "landscape_type.h" #include "tilehighlight_func.h" #include "settings_type.h" -#include "waypoint.h" #include "table/sprites.h" #include "table/strings.h" @@ -639,13 +638,7 @@ static void ResetLandscapeConfirmationCallback(Window *w, bool confirmed) FOR_ALL_BASE_STATIONS(st) { /* There can be buoys, remove them */ if (IsBuoyTile(st->xy)) DoCommand(st->xy, 0, 0, DC_EXEC | DC_BANKRUPT, CMD_LANDSCAPE_CLEAR); - if (st->facilities == 0) delete st; - } - - /* The same for waypoints */ - Waypoint *wp; - FOR_ALL_WAYPOINTS(wp) { - delete wp; + if ((st->facilities & ~FACIL_WAYPOINT) == 0) delete st; } MarkWholeScreenDirty(); diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 5b4c64185..13e93bfcf 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -27,7 +27,6 @@ #include "newgrf_townname.h" #include "newgrf_text.h" #include "autoslope.h" -#include "waypoint.h" #include "transparency.h" #include "tunnelbridge_map.h" #include "strings_func.h" diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index a555c64f9..69da41a0b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -17,6 +17,7 @@ #include "newgrf_engine.h" #include "newgrf_text.h" #include "station_base.h" +#include "waypoint_base.h" #include "roadveh.h" #include "train.h" #include "aircraft.h" diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h index 9ac62d506..b205db17e 100644 --- a/src/vehicle_gui.h +++ b/src/vehicle_gui.h @@ -10,7 +10,8 @@ #include "order_type.h" #include "station_type.h" #include "engine_type.h" -#include "waypoint.h" +#include "waypoint_type.h" +#include "tile_type.h" void DrawVehicleProfitButton(const Vehicle *v, int x, int y); void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order, Window *parent); diff --git a/src/viewport.cpp b/src/viewport.cpp index e62ce5be9..100d14c7b 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -23,6 +23,7 @@ #include "landscape.h" #include "viewport_func.h" #include "station_base.h" +#include "waypoint_base.h" #include "town.h" #include "signs_base.h" #include "signs_func.h" @@ -36,6 +37,7 @@ #include "vehicle_func.h" #include "company_func.h" #include "station_func.h" +#include "waypoint_func.h" #include "window_func.h" #include "tilehighlight_func.h" #include "window_gui.h" diff --git a/src/waypoint.cpp b/src/waypoint.cpp index 756fcd4c3..358d97dce 100644 --- a/src/waypoint.cpp +++ b/src/waypoint.cpp @@ -5,13 +5,10 @@ #include "stdafx.h" #include "strings_type.h" -#include "rail.h" -#include "station_base.h" -#include "town.h" -#include "waypoint.h" +#include "order_func.h" #include "window_func.h" #include "newgrf_station.h" -#include "order_func.h" +#include "waypoint_base.h" /** * Draw a waypoint diff --git a/src/waypoint.h b/src/waypoint_base.h index 62715de85..99efefa0d 100644 --- a/src/waypoint.h +++ b/src/waypoint_base.h @@ -1,18 +1,12 @@ /* $Id$ */ -/** @file waypoint.h Base of waypoints. */ +/** @file waypoint_base.h Base of waypoints. */ #ifndef WAYPOINT_H #define WAYPOINT_H #include "waypoint_type.h" -#include "rail_map.h" -#include "command_type.h" #include "station_base.h" -#include "town_type.h" -#include "viewport_type.h" -#include "date_type.h" -#include "core/pool_type.hpp" struct Waypoint : SpecializedStation<Waypoint, true> { uint16 town_cn; ///< The Nth waypoint for this town (consecutive number) @@ -34,9 +28,4 @@ struct Waypoint : SpecializedStation<Waypoint, true> { #define FOR_ALL_WAYPOINTS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Waypoint, var) -CommandCost RemoveTrainWaypoint(TileIndex tile, DoCommandFlag flags, bool justremove); -void ShowWaypointWindow(const Waypoint *wp); -void DrawWaypointSprite(int x, int y, int stat_id, RailType railtype); -void MakeDefaultWaypointName(Waypoint *wp); - #endif /* WAYPOINT_H */ diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp index b24b21982..0cc2718b2 100644 --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -9,7 +9,7 @@ #include "economy_func.h" #include "bridge_map.h" #include "town.h" -#include "waypoint.h" +#include "waypoint_base.h" #include "yapf/yapf.h" #include "strings_func.h" #include "gfx_func.h" diff --git a/src/waypoint_func.h b/src/waypoint_func.h new file mode 100644 index 000000000..480f690b5 --- /dev/null +++ b/src/waypoint_func.h @@ -0,0 +1,17 @@ +/* $Id$ */ + +/** @file waypoint_func.h Functions related to waypoints. */ + +#ifndef WAYPOINT_FUNC_H +#define WAYPOINT_FUNC_H + +#include "rail_type.h" +#include "command_type.h" +#include "station_base.h" + +CommandCost RemoveTrainWaypoint(TileIndex tile, DoCommandFlag flags, bool justremove); +void ShowWaypointWindow(const Waypoint *wp); +void DrawWaypointSprite(int x, int y, int stat_id, RailType railtype); +void MakeDefaultWaypointName(Waypoint *wp); + +#endif /* WAYPOINT_FUNC_H */ diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 1dc2175fa..bfe3f04e9 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -13,6 +13,7 @@ #include "command_func.h" #include "company_func.h" #include "window_func.h" +#include "waypoint_base.h" #include "table/strings.h" diff --git a/src/yapf/yapf.hpp b/src/yapf/yapf.hpp index 5b5a27c0e..f0c3f4990 100644 --- a/src/yapf/yapf.hpp +++ b/src/yapf/yapf.hpp @@ -18,7 +18,7 @@ #include "../landscape.h" #include "yapf.h" #include "../pathfind.h" -#include "../waypoint.h" +#include "../waypoint_base.h" #include "../debug.h" #include "../settings_type.h" #include "../tunnelbridge.h" |