summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-07 09:07:19 +0000
committerrubidium <rubidium@openttd.org>2008-05-07 09:07:19 +0000
commit7ccda80b0bae730f17d6863df84e78ea455ff1db (patch)
tree4c92772a01d16e252b764639246b6727529d3b0f
parent8fea5a62c9190cb86128c89f92c89ea1c656c3f0 (diff)
downloadopenttd-7ccda80b0bae730f17d6863df84e78ea455ff1db.tar.xz
(svn r12986) -Codechange: move the landscape and transport related types from openttd.h to their own headers.
-rw-r--r--projects/openttd_vs80.vcproj8
-rw-r--r--projects/openttd_vs90.vcproj8
-rw-r--r--source.list2
-rw-r--r--src/bridge_map.h2
-rw-r--r--src/cargotype.h1
-rw-r--r--src/genworld_gui.cpp1
-rw-r--r--src/gfx.cpp1
-rw-r--r--src/gui.h1
-rw-r--r--src/industry.h1
-rw-r--r--src/landscape.cpp1
-rw-r--r--src/landscape_type.h20
-rw-r--r--src/network/network.cpp1
-rw-r--r--src/npf.h1
-rw-r--r--src/openttd.h30
-rw-r--r--src/settings_type.h1
-rw-r--r--src/terraform_gui.cpp1
-rw-r--r--src/tgp.cpp1
-rw-r--r--src/tile_cmd.h2
-rw-r--r--src/transport_type.h26
-rw-r--r--src/tree_cmd.cpp1
-rw-r--r--src/tunnel_map.h1
-rw-r--r--src/tunnelbridge_cmd.cpp1
-rw-r--r--src/tunnelbridge_map.h1
-rw-r--r--src/unmovable_cmd.cpp1
-rw-r--r--src/vehicle_base.h1
-rw-r--r--src/vehicle_func.h1
26 files changed, 84 insertions, 32 deletions
diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj
index 401c10587..35e17291d 100644
--- a/projects/openttd_vs80.vcproj
+++ b/projects/openttd_vs80.vcproj
@@ -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>
diff --git a/projects/openttd_vs90.vcproj b/projects/openttd_vs90.vcproj
index d9b070cf0..42a2292f5 100644
--- a/projects/openttd_vs90.vcproj
+++ b/projects/openttd_vs90.vcproj
@@ -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>
diff --git a/source.list b/source.list
index 65fbb0b09..79d112e44 100644
--- a/source.list
+++ b/source.list
@@ -194,6 +194,7 @@ heightmap.h
industry.h
industry_type.h
landscape.h
+landscape_type.h
livery.h
lzoconf.h
map_func.h
@@ -307,6 +308,7 @@ track_type.h
train.h
transparency.h
transparency_gui.h
+transport_type.h
ai/trolly/trolly.h
tunnelbridge.h
unmovable.h
diff --git a/src/bridge_map.h b/src/bridge_map.h
index a4f4f1e4d..fd82fbdab 100644
--- a/src/bridge_map.h
+++ b/src/bridge_map.h
@@ -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
diff --git a/src/cargotype.h b/src/cargotype.h
index a117fd613..e8498cc72 100644
--- a/src/cargotype.h
+++ b/src/cargotype.h
@@ -8,6 +8,7 @@
#include "cargo_type.h"
#include "gfx_type.h"
#include "strings_type.h"
+#include "landscape_type.h"
typedef uint32 CargoLabel;
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp
index 824e572ee..01fc43d31 100644
--- a/src/genworld_gui.cpp
+++ b/src/genworld_gui.cpp
@@ -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"
diff --git a/src/gfx.cpp b/src/gfx.cpp
index acfaa907c..a59bf568b 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -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"
diff --git a/src/gui.h b/src/gui.h
index fcaad3d3c..9e1bddf76 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -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);
diff --git a/src/industry.h b/src/industry.h
index 142f164fe..246c87c7c 100644
--- a/src/industry.h
+++ b/src/industry.h
@@ -15,6 +15,7 @@
#include "date_type.h"
#include "town_type.h"
#include "industry_type.h"
+#include "landscape_type.h"
enum {
INVALID_INDUSTRY = 0xFFFF,
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 3cbdaee98..3439a1825 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -27,6 +27,7 @@
#include "settings_type.h"
#include "water.h"
#include "effectvehicle_func.h"
+#include "landscape_type.h"
#include "table/sprites.h"
diff --git a/src/landscape_type.h b/src/landscape_type.h
new file mode 100644
index 000000000..eb6b9e7a6
--- /dev/null
+++ b/src/landscape_type.h
@@ -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 */
diff --git a/src/network/network.cpp b/src/network/network.cpp
index 9d596ae5b..30a0cc957 100644
--- a/src/network/network.cpp
+++ b/src/network/network.cpp
@@ -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"
diff --git a/src/npf.h b/src/npf.h
index 36a444b4f..5a70b6be0 100644
--- a/src/npf.h
+++ b/src/npf.h
@@ -13,6 +13,7 @@
#include "tile_type.h"
#include "track_type.h"
#include "core/bitmath_func.hpp"
+#include "transport_type.h"
/* mowing grass */
enum {
diff --git a/src/openttd.h b/src/openttd.h
index 3265bfb0c..de17ccd5d 100644
--- a/src/openttd.h
+++ b/src/openttd.h
@@ -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 @@ enum InitializeGameModes {
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 @@ enum {
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;
diff --git a/src/settings_type.h b/src/settings_type.h
index 46e6f6b39..c5a74d359 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -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
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 2c0def89d..969e21e1a 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -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"
diff --git a/src/tgp.cpp b/src/tgp.cpp
index c5d4f4101..28169b455 100644
--- a/src/tgp.cpp
+++ b/src/tgp.cpp
@@ -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"
diff --git a/src/tile_cmd.h b/src/tile_cmd.h
index 08a363b92..ce68f987c 100644
--- a/src/tile_cmd.h
+++ b/src/tile_cmd.h
@@ -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 {
diff --git a/src/transport_type.h b/src/transport_type.h
new file mode 100644
index 000000000..c23afbd7c
--- /dev/null
+++ b/src/transport_type.h
@@ -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 */
diff --git a/src/tree_cmd.cpp b/src/tree_cmd.cpp
index 0c7c8e9e0..f2cd302b5 100644
--- a/src/tree_cmd.cpp
+++ b/src/tree_cmd.cpp
@@ -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"
diff --git a/src/tunnel_map.h b/src/tunnel_map.h
index c3362765b..87abbea3c 100644
--- a/src/tunnel_map.h
+++ b/src/tunnel_map.h
@@ -8,6 +8,7 @@
#include "direction_func.h"
#include "rail_type.h"
#include "road_type.h"
+#include "transport_type.h"
#include "tile_map.h"
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index e6499e9bc..a95c3bfbc 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -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"
diff --git a/src/tunnelbridge_map.h b/src/tunnelbridge_map.h
index e5c94a6c0..bdc709944 100644
--- a/src/tunnelbridge_map.h
+++ b/src/tunnelbridge_map.h
@@ -10,6 +10,7 @@
#include "tile_map.h"
#include "bridge_map.h"
#include "tunnel_map.h"
+#include "transport_type.h"
/**
diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp
index 32a368f2b..b949736f3 100644
--- a/src/unmovable_cmd.cpp
+++ b/src/unmovable_cmd.cpp
@@ -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"
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index 83b1ee2c1..894890169 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -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 {
diff --git a/src/vehicle_func.h b/src/vehicle_func.h
index 371adc1c7..61ddc7e51 100644
--- a/src/vehicle_func.h
+++ b/src/vehicle_func.h
@@ -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)