(svn r12986) -Codechange: move the landscape and transport related types from openttd.h to their own headers.
--- a/projects/openttd_vs80.vcproj Wed May 07 08:38:56 2008 +0000
+++ b/projects/openttd_vs80.vcproj Wed May 07 09:07:19 2008 +0000
@@ -1076,6 +1076,10 @@
>
</File>
<File
+ RelativePath=".\..\src\landscape_type.h"
+ >
+ </File>
+ <File
RelativePath=".\..\src\livery.h"
>
</File>
@@ -1528,6 +1532,10 @@
>
</File>
<File
+ RelativePath=".\..\src\transport_type.h"
+ >
+ </File>
+ <File
RelativePath=".\..\src\ai\trolly\trolly.h"
>
</File>
--- a/projects/openttd_vs90.vcproj Wed May 07 08:38:56 2008 +0000
+++ b/projects/openttd_vs90.vcproj Wed May 07 09:07:19 2008 +0000
@@ -1073,6 +1073,10 @@
>
</File>
<File
+ RelativePath=".\..\src\landscape_type.h"
+ >
+ </File>
+ <File
RelativePath=".\..\src\livery.h"
>
</File>
@@ -1525,6 +1529,10 @@
>
</File>
<File
+ RelativePath=".\..\src\transport_type.h"
+ >
+ </File>
+ <File
RelativePath=".\..\src\ai\trolly\trolly.h"
>
</File>
--- a/source.list Wed May 07 08:38:56 2008 +0000
+++ b/source.list Wed May 07 09:07:19 2008 +0000
@@ -194,6 +194,7 @@
industry.h
industry_type.h
landscape.h
+landscape_type.h
livery.h
lzoconf.h
map_func.h
@@ -307,6 +308,7 @@
train.h
transparency.h
transparency_gui.h
+transport_type.h
ai/trolly/trolly.h
tunnelbridge.h
unmovable.h
--- a/src/bridge_map.h Wed May 07 08:38:56 2008 +0000
+++ b/src/bridge_map.h Wed May 07 09:07:19 2008 +0000
@@ -7,10 +7,10 @@
#include "direction_func.h"
#include "rail_type.h"
+#include "transport_type.h"
#include "road_map.h"
#include "bridge.h"
-
/**
* Checks if this is a bridge, instead of a tunnel
* @param t The tile to analyze
--- a/src/cargotype.h Wed May 07 08:38:56 2008 +0000
+++ b/src/cargotype.h Wed May 07 09:07:19 2008 +0000
@@ -8,6 +8,7 @@
#include "cargo_type.h"
#include "gfx_type.h"
#include "strings_type.h"
+#include "landscape_type.h"
typedef uint32 CargoLabel;
--- a/src/genworld_gui.cpp Wed May 07 08:38:56 2008 +0000
+++ b/src/genworld_gui.cpp Wed May 07 09:07:19 2008 +0000
@@ -28,6 +28,7 @@
#include "widgets/dropdown_type.h"
#include "widgets/dropdown_func.h"
#include "core/random_func.hpp"
+#include "landscape_type.h"
#include "table/strings.h"
#include "table/sprites.h"
--- a/src/gfx.cpp Wed May 07 08:38:56 2008 +0000
+++ b/src/gfx.cpp Wed May 07 09:07:19 2008 +0000
@@ -18,6 +18,7 @@
#include "core/math_func.hpp"
#include "settings_type.h"
#include "core/alloc_func.hpp"
+#include "landscape_type.h"
#include "table/palettes.h"
#include "table/sprites.h"
--- a/src/gui.h Wed May 07 08:38:56 2008 +0000
+++ b/src/gui.h Wed May 07 09:07:19 2008 +0000
@@ -11,6 +11,7 @@
#include "economy_type.h"
#include "tile_type.h"
#include "strings_type.h"
+#include "transport_type.h"
/* main_gui.cpp */
void CcPlaySound10(bool success, TileIndex tile, uint32 p1, uint32 p2);
--- a/src/industry.h Wed May 07 08:38:56 2008 +0000
+++ b/src/industry.h Wed May 07 09:07:19 2008 +0000
@@ -15,6 +15,7 @@
#include "date_type.h"
#include "town_type.h"
#include "industry_type.h"
+#include "landscape_type.h"
enum {
INVALID_INDUSTRY = 0xFFFF,
--- a/src/landscape.cpp Wed May 07 08:38:56 2008 +0000
+++ b/src/landscape.cpp Wed May 07 09:07:19 2008 +0000
@@ -27,6 +27,7 @@
#include "settings_type.h"
#include "water.h"
#include "effectvehicle_func.h"
+#include "landscape_type.h"
#include "table/sprites.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/landscape_type.h Wed May 07 09:07:19 2008 +0000
@@ -0,0 +1,20 @@
+/* $Id$ */
+
+/** @file landscape_type.h Types related to the landscape. */
+
+#ifndef LANDSCAPE_TYPE_H
+#define LANDSCAPE_TYPE_H
+
+typedef byte LandscapeID;
+
+/* Landscape types */
+enum {
+ LT_TEMPERATE = 0,
+ LT_ARCTIC = 1,
+ LT_TROPIC = 2,
+ LT_TOYLAND = 3,
+
+ NUM_LANDSCAPE = 4,
+};
+
+#endif /* LANDSCAPE_TYPE_H */
--- a/src/network/network.cpp Wed May 07 08:38:56 2008 +0000
+++ b/src/network/network.cpp Wed May 07 09:07:19 2008 +0000
@@ -33,6 +33,7 @@
#include "../string_func.h"
#include "../player_func.h"
#include "../settings_type.h"
+#include "../landscape_type.h"
#include "../rev.h"
#ifdef DEBUG_DUMP_COMMANDS
#include "../core/alloc_func.hpp"
--- a/src/npf.h Wed May 07 08:38:56 2008 +0000
+++ b/src/npf.h Wed May 07 09:07:19 2008 +0000
@@ -13,6 +13,7 @@
#include "tile_type.h"
#include "track_type.h"
#include "core/bitmath_func.hpp"
+#include "transport_type.h"
/* mowing grass */
enum {
--- a/src/openttd.h Wed May 07 08:38:56 2008 +0000
+++ b/src/openttd.h Wed May 07 09:07:19 2008 +0000
@@ -9,10 +9,6 @@
#define VARDEF extern
#endif
-// Forward declarations of structs.
-typedef byte LandscapeID;
-typedef uint16 UnitID;
-
enum GameModes {
GM_MENU,
GM_NORMAL,
@@ -48,22 +44,6 @@
IG_DATE_RESET = 1, /* Reset the date when initializing a game */
};
-enum TransportType {
- /* These constants are for now linked to the representation of bridges
- * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge.
- * In an ideal world, these constants would be used everywhere when
- * accessing tunnels and bridges. For now, you should just not change
- * the values for road and rail.
- */
- TRANSPORT_BEGIN = 0,
- TRANSPORT_RAIL = TRANSPORT_BEGIN,
- TRANSPORT_ROAD,
- TRANSPORT_WATER,
- TRANSPORT_AIR,
- TRANSPORT_END,
- INVALID_TRANSPORT = 0xff,
-};
-
/* Display Options */
enum {
DO_SHOW_TOWN_NAMES = 0,
@@ -74,16 +54,6 @@
DO_WAYPOINTS = 6,
};
-/* Landscape types */
-enum {
- LT_TEMPERATE = 0,
- LT_ARCTIC = 1,
- LT_TROPIC = 2,
- LT_TOYLAND = 3,
-
- NUM_LANDSCAPE = 4,
-};
-
struct ViewportSign {
int32 left;
int32 top;
--- a/src/settings_type.h Wed May 07 08:38:56 2008 +0000
+++ b/src/settings_type.h Wed May 07 09:07:19 2008 +0000
@@ -8,6 +8,7 @@
#include "yapf/yapf_settings.h"
#include "date_type.h"
#include "town_type.h"
+#include "transport_type.h"
#define GAME_DIFFICULTY_NUM 18
--- a/src/terraform_gui.cpp Wed May 07 08:38:56 2008 +0000
+++ b/src/terraform_gui.cpp Wed May 07 09:07:19 2008 +0000
@@ -23,6 +23,7 @@
#include "genworld.h"
#include "settings_type.h"
#include "tree_map.h"
+#include "landscape_type.h"
#include "table/sprites.h"
#include "table/strings.h"
--- a/src/tgp.cpp Wed May 07 08:38:56 2008 +0000
+++ b/src/tgp.cpp Wed May 07 09:07:19 2008 +0000
@@ -15,6 +15,7 @@
#include "core/alloc_func.hpp"
#include "core/random_func.hpp"
#include "settings_type.h"
+#include "landscape_type.h"
#include "table/strings.h"
--- a/src/tile_cmd.h Wed May 07 08:38:56 2008 +0000
+++ b/src/tile_cmd.h Wed May 07 09:07:19 2008 +0000
@@ -15,7 +15,7 @@
#include "player_type.h"
#include "direction_type.h"
#include "track_type.h"
-#include "openttd.h"
+#include "transport_type.h"
/** The returned bits of VehicleEnterTile. */
enum VehicleEnterTileStatus {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/transport_type.h Wed May 07 09:07:19 2008 +0000
@@ -0,0 +1,26 @@
+/* $Id$ */
+
+/** @file transport_type.h Base types related to transport. */
+
+#ifndef TRANSPORT_TYPE_H
+#define TRANSPORT_TYPE_H
+
+typedef uint16 UnitID;
+
+enum TransportType {
+ /* These constants are for now linked to the representation of bridges
+ * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge.
+ * In an ideal world, these constants would be used everywhere when
+ * accessing tunnels and bridges. For now, you should just not change
+ * the values for road and rail.
+ */
+ TRANSPORT_BEGIN = 0,
+ TRANSPORT_RAIL = TRANSPORT_BEGIN,
+ TRANSPORT_ROAD,
+ TRANSPORT_WATER,
+ TRANSPORT_AIR,
+ TRANSPORT_END,
+ INVALID_TRANSPORT = 0xff,
+};
+
+#endif /* TRANSPORT_TYPE_H */
--- a/src/tree_cmd.cpp Wed May 07 08:38:56 2008 +0000
+++ b/src/tree_cmd.cpp Wed May 07 09:07:19 2008 +0000
@@ -22,6 +22,7 @@
#include "settings_type.h"
#include "water_map.h"
#include "water.h"
+#include "landscape_type.h"
#include "table/strings.h"
#include "table/sprites.h"
--- a/src/tunnel_map.h Wed May 07 08:38:56 2008 +0000
+++ b/src/tunnel_map.h Wed May 07 09:07:19 2008 +0000
@@ -8,6 +8,7 @@
#include "direction_func.h"
#include "rail_type.h"
#include "road_type.h"
+#include "transport_type.h"
#include "tile_map.h"
--- a/src/tunnelbridge_cmd.cpp Wed May 07 08:38:56 2008 +0000
+++ b/src/tunnelbridge_cmd.cpp Wed May 07 09:07:19 2008 +0000
@@ -39,6 +39,7 @@
#include "economy_func.h"
#include "rail.h"
#include "cheat_func.h"
+#include "landscape_type.h"
#include "table/sprites.h"
#include "table/strings.h"
--- a/src/tunnelbridge_map.h Wed May 07 08:38:56 2008 +0000
+++ b/src/tunnelbridge_map.h Wed May 07 09:07:19 2008 +0000
@@ -10,6 +10,7 @@
#include "tile_map.h"
#include "bridge_map.h"
#include "tunnel_map.h"
+#include "transport_type.h"
/**
--- a/src/unmovable_cmd.cpp Wed May 07 08:38:56 2008 +0000
+++ b/src/unmovable_cmd.cpp Wed May 07 09:07:19 2008 +0000
@@ -27,6 +27,7 @@
#include "station_type.h"
#include "economy_func.h"
#include "cheat_func.h"
+#include "landscape_type.h"
#include "table/strings.h"
#include "table/sprites.h"
--- a/src/vehicle_base.h Wed May 07 08:38:56 2008 +0000
+++ b/src/vehicle_base.h Wed May 07 09:07:19 2008 +0000
@@ -23,6 +23,7 @@
#include "group_type.h"
#include "engine_type.h"
#include "order_func.h"
+#include "transport_type.h"
/** Road vehicle states */
enum RoadVehicleStates {
--- a/src/vehicle_func.h Wed May 07 08:38:56 2008 +0000
+++ b/src/vehicle_func.h Wed May 07 09:07:19 2008 +0000
@@ -13,6 +13,7 @@
#include "command_type.h"
#include "vehicle_type.h"
#include "engine_type.h"
+#include "transport_type.h"
#define is_custom_sprite(x) (x >= 0xFD)
#define IS_CUSTOM_FIRSTHEAD_SPRITE(x) (x == 0xFD)