(svn r11801) -Codechange: remove some unneeded includes from some header files.
--- a/src/airport_gui.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/airport_gui.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -19,6 +19,7 @@
#include "variables.h"
#include "viewport_func.h"
#include "gfx_func.h"
+#include "player.h"
static byte _selected_airport_type;
--- a/src/autoslope.h Wed Jan 09 21:05:03 2008 +0000
+++ b/src/autoslope.h Wed Jan 09 21:27:39 2008 +0000
@@ -7,6 +7,7 @@
#include "depot.h"
#include "settings_type.h"
+#include "player.h"
/**
* Autoslope check for tiles with an entrance on an edge.
--- a/src/cargopacket.h Wed Jan 09 21:05:03 2008 +0000
+++ b/src/cargopacket.h Wed Jan 09 21:27:39 2008 +0000
@@ -6,6 +6,7 @@
#define CARGOPACKET_H
#include "economy_type.h"
+#include "tile_type.h"
#include <list>
typedef uint32 CargoPacketID;
--- a/src/depot_gui.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/depot_gui.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -23,6 +23,7 @@
#include "strings_func.h"
#include "window_func.h"
#include "vehicle_func.h"
+#include "player.h"
/*
* Since all depot window sizes aren't the same, we need to modify sizes a little.
--- a/src/dock_gui.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/dock_gui.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -20,6 +20,7 @@
#include "sound_func.h"
#include "viewport_func.h"
#include "gfx_func.h"
+#include "player.h"
static void ShowBuildDockStationPicker();
static void ShowBuildDocksDepotPicker();
--- a/src/elrail.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/elrail.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -65,6 +65,7 @@
#include "transparency.h"
#include "tunnelbridge_map.h"
#include "vehicle_func.h"
+#include "player.h"
static inline TLG GetTLG(TileIndex t)
--- a/src/engine.h Wed Jan 09 21:05:03 2008 +0000
+++ b/src/engine.h Wed Jan 09 21:27:39 2008 +0000
@@ -5,11 +5,9 @@
#ifndef ENGINE_H
#define ENGINE_H
-#include "oldpool.h"
#include "rail_type.h"
#include "cargo_type.h"
#include "vehicle_type.h"
-#include "command_type.h"
#include "gfx_type.h"
#include "date_type.h"
#include "sound_type.h"
--- a/src/group.h Wed Jan 09 21:05:03 2008 +0000
+++ b/src/group.h Wed Jan 09 21:27:39 2008 +0000
@@ -76,19 +76,7 @@
* @param id_e The EngineID of the engine to count
* @return The number of engines with EngineID id_e in the group
*/
-static inline uint GetGroupNumEngines(PlayerID p, GroupID id_g, EngineID id_e)
-{
- if (IsValidGroupID(id_g)) return GetGroup(id_g)->num_engines[id_e];
-
- uint num = GetPlayer(p)->num_engines[id_e];
- if (!IsDefaultGroupID(id_g)) return num;
-
- const Group *g;
- FOR_ALL_GROUPS(g) {
- if (g->owner == p) num -= g->num_engines[id_e];
- }
- return num;
-}
+uint GetGroupNumEngines(PlayerID p, GroupID id_g, EngineID id_e);
static inline void IncreaseGroupNumVehicle(GroupID id_g)
{
@@ -105,6 +93,6 @@
void SetTrainGroupID(Vehicle *v, GroupID grp);
void UpdateTrainGroupID(Vehicle *v);
void RemoveVehicleFromGroup(const Vehicle *v);
-void RemoveAllGroupsForPlayer(const Player *p);
+void RemoveAllGroupsForPlayer(const PlayerID p);
#endif /* GROUP_H */
--- a/src/group_cmd.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/group_cmd.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -409,13 +409,26 @@
InvalidateWindow(WC_REPLACE_VEHICLE, VEH_TRAIN);
}
+uint GetGroupNumEngines(PlayerID p, GroupID id_g, EngineID id_e)
+{
+ if (IsValidGroupID(id_g)) return GetGroup(id_g)->num_engines[id_e];
-void RemoveAllGroupsForPlayer(const Player *p)
+ uint num = GetPlayer(p)->num_engines[id_e];
+ if (!IsDefaultGroupID(id_g)) return num;
+
+ const Group *g;
+ FOR_ALL_GROUPS(g) {
+ if (g->owner == p) num -= g->num_engines[id_e];
+ }
+ return num;
+}
+
+void RemoveAllGroupsForPlayer(const PlayerID p)
{
Group *g;
FOR_ALL_GROUPS(g) {
- if (p->index == g->owner) delete g;
+ if (p == g->owner) delete g;
}
}
--- a/src/group_gui.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/group_gui.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -24,6 +24,7 @@
#include "string_func.h"
#include "viewport_func.h"
#include "gfx_func.h"
+#include "player.h"
struct Sorting {
--- a/src/industry_gui.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/industry_gui.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -23,6 +23,7 @@
#include "newgrf_text.h"
#include "strings_func.h"
#include "map_func.h"
+#include "player.h"
bool _ignore_restrictions;
--- a/src/newgrf.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/newgrf.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -47,6 +47,7 @@
#include "sound_func.h"
#include "string_func.h"
#include "road_func.h"
+#include "player.h"
/* TTDPatch extended GRF format codec
* (c) Petr Baudis 2004 (GPL'd)
--- a/src/newgrf_house.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/newgrf_house.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -23,6 +23,7 @@
#include "newgrf_commons.h"
#include "transparency.h"
#include "functions.h"
+#include "player.h"
static BuildingCounts _building_counts;
static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX];
--- a/src/newgrf_industries.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/newgrf_industries.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -20,6 +20,7 @@
#include "newgrf_town.h"
#include "window_func.h"
#include "town.h"
+#include "player.h"
/* Since the industry IDs defined by the GRF file don't necessarily correlate
* to those used by the game, the IDs used for overriding old industries must be
--- a/src/newgrf_station.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/newgrf_station.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -23,6 +23,7 @@
#include "newgrf_town.h"
#include "gfx_func.h"
#include "date_func.h"
+#include "player.h"
static StationClass station_classes[STAT_CLASS_MAX];
--- a/src/newgrf_station.h Wed Jan 09 21:05:03 2008 +0000
+++ b/src/newgrf_station.h Wed Jan 09 21:27:39 2008 +0000
@@ -8,6 +8,7 @@
#include "engine.h"
#include "newgrf_callbacks.h"
#include "newgrf_cargo.h"
+#include "tile_type.h"
enum StationClassID {
STAT_CLASS_BEGIN = 0, ///< the lowest valid value
--- a/src/order_gui.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/order_gui.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -27,6 +27,7 @@
#include "window_func.h"
#include "vehicle_func.h"
#include "settings_type.h"
+#include "player.h"
enum OrderWindowWidgets {
ORDER_WIDGET_CLOSEBOX = 0,
--- a/src/player.h Wed Jan 09 21:05:03 2008 +0000
+++ b/src/player.h Wed Jan 09 21:27:39 2008 +0000
@@ -11,6 +11,8 @@
#include "engine.h"
#include "livery.h"
#include "autoreplace_type.h"
+#include "economy_type.h"
+#include "tile_type.h"
struct PlayerEconomyEntry {
Money income;
--- a/src/players.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/players.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -889,7 +889,7 @@
p->is_active = false;
}
RemoveAllEngineReplacementForPlayer(p);
- RemoveAllGroupsForPlayer(p);
+ RemoveAllGroupsForPlayer(p->index);
} break;
--- a/src/rail.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/rail.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -11,6 +11,7 @@
#include "tunnelbridge_map.h"
#include "settings_type.h"
#include "date_func.h"
+#include "player.h"
/* XXX: Below 3 tables store duplicate data. Maybe remove some? */
--- a/src/rail_gui.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/rail_gui.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -27,6 +27,7 @@
#include "window_func.h"
#include "date_func.h"
#include "sound_func.h"
+#include "player.h"
#include "bridge_map.h"
#include "rail_map.h"
--- a/src/road_gui.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/road_gui.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -23,6 +23,7 @@
#include "window_func.h"
#include "vehicle_func.h"
#include "sound_func.h"
+#include "player.h"
static void ShowRVStationPicker(RoadStop::Type rs);
--- a/src/station.h Wed Jan 09 21:05:03 2008 +0000
+++ b/src/station.h Wed Jan 09 21:27:39 2008 +0000
@@ -6,7 +6,6 @@
#define STATION_H
#include "airport.h"
-#include "player.h"
#include "oldpool.h"
#include "sprite.h"
#include "road_type.h"
--- a/src/strings.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/strings.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -34,6 +34,7 @@
#include "date_func.h"
#include "vehicle_base.h"
#include "string_func.h"
+#include "player.h"
/* for opendir/readdir/closedir */
# include "fios.h"
--- a/src/timetable_gui.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/timetable_gui.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -17,6 +17,7 @@
#include "vehicle_base.h"
#include "string_func.h"
#include "gfx_func.h"
+#include "player.h"
static int GetOrderFromTimetableWndPt(Window *w, int y, const Vehicle *v)
{
--- a/src/viewport.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/viewport.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -25,6 +25,7 @@
#include "strings_func.h"
#include "zoom_func.h"
#include "vehicle_func.h"
+#include "player.h"
#define VIEWPORT_DRAW_MEM (65536 * 2)
--- a/src/water_cmd.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/water_cmd.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -33,6 +33,7 @@
#include "vehicle_func.h"
#include "sound_func.h"
#include "variables.h"
+#include "player.h"
static Vehicle *FindFloodableVehicleOnTile(TileIndex tile);
--- a/src/waypoint.cpp Wed Jan 09 21:05:03 2008 +0000
+++ b/src/waypoint.cpp Wed Jan 09 21:27:39 2008 +0000
@@ -29,6 +29,7 @@
#include "vehicle_func.h"
#include "vehicle_base.h"
#include "string_func.h"
+#include "player.h"
enum {
MAX_WAYPOINTS_PER_TOWN = 64,
--- a/src/waypoint.h Wed Jan 09 21:05:03 2008 +0000
+++ b/src/waypoint.h Wed Jan 09 21:27:39 2008 +0000
@@ -7,6 +7,7 @@
#include "oldpool.h"
#include "rail_map.h"
+#include "command_type.h"
struct Waypoint;
DECLARE_OLD_POOL(Waypoint, Waypoint, 3, 8000)