1
0
Fork 0

(svn r12986) -Codechange: move the landscape and transport related types from openttd.h to their own headers.

release/0.7
rubidium 2008-05-07 09:07:19 +00:00
parent 8fea5a62c9
commit 7ccda80b0b
26 changed files with 84 additions and 32 deletions

View File

@ -1075,6 +1075,10 @@
RelativePath=".\..\src\landscape.h" RelativePath=".\..\src\landscape.h"
> >
</File> </File>
<File
RelativePath=".\..\src\landscape_type.h"
>
</File>
<File <File
RelativePath=".\..\src\livery.h" RelativePath=".\..\src\livery.h"
> >
@ -1527,6 +1531,10 @@
RelativePath=".\..\src\transparency_gui.h" RelativePath=".\..\src\transparency_gui.h"
> >
</File> </File>
<File
RelativePath=".\..\src\transport_type.h"
>
</File>
<File <File
RelativePath=".\..\src\ai\trolly\trolly.h" RelativePath=".\..\src\ai\trolly\trolly.h"
> >

View File

@ -1072,6 +1072,10 @@
RelativePath=".\..\src\landscape.h" RelativePath=".\..\src\landscape.h"
> >
</File> </File>
<File
RelativePath=".\..\src\landscape_type.h"
>
</File>
<File <File
RelativePath=".\..\src\livery.h" RelativePath=".\..\src\livery.h"
> >
@ -1524,6 +1528,10 @@
RelativePath=".\..\src\transparency_gui.h" RelativePath=".\..\src\transparency_gui.h"
> >
</File> </File>
<File
RelativePath=".\..\src\transport_type.h"
>
</File>
<File <File
RelativePath=".\..\src\ai\trolly\trolly.h" RelativePath=".\..\src\ai\trolly\trolly.h"
> >

View File

@ -194,6 +194,7 @@ heightmap.h
industry.h industry.h
industry_type.h industry_type.h
landscape.h landscape.h
landscape_type.h
livery.h livery.h
lzoconf.h lzoconf.h
map_func.h map_func.h
@ -307,6 +308,7 @@ track_type.h
train.h train.h
transparency.h transparency.h
transparency_gui.h transparency_gui.h
transport_type.h
ai/trolly/trolly.h ai/trolly/trolly.h
tunnelbridge.h tunnelbridge.h
unmovable.h unmovable.h

View File

@ -7,10 +7,10 @@
#include "direction_func.h" #include "direction_func.h"
#include "rail_type.h" #include "rail_type.h"
#include "transport_type.h"
#include "road_map.h" #include "road_map.h"
#include "bridge.h" #include "bridge.h"
/** /**
* Checks if this is a bridge, instead of a tunnel * Checks if this is a bridge, instead of a tunnel
* @param t The tile to analyze * @param t The tile to analyze

View File

@ -8,6 +8,7 @@
#include "cargo_type.h" #include "cargo_type.h"
#include "gfx_type.h" #include "gfx_type.h"
#include "strings_type.h" #include "strings_type.h"
#include "landscape_type.h"
typedef uint32 CargoLabel; typedef uint32 CargoLabel;

View File

@ -28,6 +28,7 @@
#include "widgets/dropdown_type.h" #include "widgets/dropdown_type.h"
#include "widgets/dropdown_func.h" #include "widgets/dropdown_func.h"
#include "core/random_func.hpp" #include "core/random_func.hpp"
#include "landscape_type.h"
#include "table/strings.h" #include "table/strings.h"
#include "table/sprites.h" #include "table/sprites.h"

View File

@ -18,6 +18,7 @@
#include "core/math_func.hpp" #include "core/math_func.hpp"
#include "settings_type.h" #include "settings_type.h"
#include "core/alloc_func.hpp" #include "core/alloc_func.hpp"
#include "landscape_type.h"
#include "table/palettes.h" #include "table/palettes.h"
#include "table/sprites.h" #include "table/sprites.h"

View File

@ -11,6 +11,7 @@
#include "economy_type.h" #include "economy_type.h"
#include "tile_type.h" #include "tile_type.h"
#include "strings_type.h" #include "strings_type.h"
#include "transport_type.h"
/* main_gui.cpp */ /* main_gui.cpp */
void CcPlaySound10(bool success, TileIndex tile, uint32 p1, uint32 p2); void CcPlaySound10(bool success, TileIndex tile, uint32 p1, uint32 p2);

View File

@ -15,6 +15,7 @@
#include "date_type.h" #include "date_type.h"
#include "town_type.h" #include "town_type.h"
#include "industry_type.h" #include "industry_type.h"
#include "landscape_type.h"
enum { enum {
INVALID_INDUSTRY = 0xFFFF, INVALID_INDUSTRY = 0xFFFF,

View File

@ -27,6 +27,7 @@
#include "settings_type.h" #include "settings_type.h"
#include "water.h" #include "water.h"
#include "effectvehicle_func.h" #include "effectvehicle_func.h"
#include "landscape_type.h"
#include "table/sprites.h" #include "table/sprites.h"

View File

@ -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 */

View File

@ -33,6 +33,7 @@
#include "../string_func.h" #include "../string_func.h"
#include "../player_func.h" #include "../player_func.h"
#include "../settings_type.h" #include "../settings_type.h"
#include "../landscape_type.h"
#include "../rev.h" #include "../rev.h"
#ifdef DEBUG_DUMP_COMMANDS #ifdef DEBUG_DUMP_COMMANDS
#include "../core/alloc_func.hpp" #include "../core/alloc_func.hpp"

View File

@ -13,6 +13,7 @@
#include "tile_type.h" #include "tile_type.h"
#include "track_type.h" #include "track_type.h"
#include "core/bitmath_func.hpp" #include "core/bitmath_func.hpp"
#include "transport_type.h"
/* mowing grass */ /* mowing grass */
enum { enum {

View File

@ -9,10 +9,6 @@
#define VARDEF extern #define VARDEF extern
#endif #endif
// Forward declarations of structs.
typedef byte LandscapeID;
typedef uint16 UnitID;
enum GameModes { enum GameModes {
GM_MENU, GM_MENU,
GM_NORMAL, GM_NORMAL,
@ -48,22 +44,6 @@ enum InitializeGameModes {
IG_DATE_RESET = 1, /* Reset the date when initializing a game */ 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 */ /* Display Options */
enum { enum {
DO_SHOW_TOWN_NAMES = 0, DO_SHOW_TOWN_NAMES = 0,
@ -74,16 +54,6 @@ enum {
DO_WAYPOINTS = 6, DO_WAYPOINTS = 6,
}; };
/* Landscape types */
enum {
LT_TEMPERATE = 0,
LT_ARCTIC = 1,
LT_TROPIC = 2,
LT_TOYLAND = 3,
NUM_LANDSCAPE = 4,
};
struct ViewportSign { struct ViewportSign {
int32 left; int32 left;
int32 top; int32 top;

View File

@ -8,6 +8,7 @@
#include "yapf/yapf_settings.h" #include "yapf/yapf_settings.h"
#include "date_type.h" #include "date_type.h"
#include "town_type.h" #include "town_type.h"
#include "transport_type.h"
#define GAME_DIFFICULTY_NUM 18 #define GAME_DIFFICULTY_NUM 18

View File

@ -23,6 +23,7 @@
#include "genworld.h" #include "genworld.h"
#include "settings_type.h" #include "settings_type.h"
#include "tree_map.h" #include "tree_map.h"
#include "landscape_type.h"
#include "table/sprites.h" #include "table/sprites.h"
#include "table/strings.h" #include "table/strings.h"

View File

@ -15,6 +15,7 @@
#include "core/alloc_func.hpp" #include "core/alloc_func.hpp"
#include "core/random_func.hpp" #include "core/random_func.hpp"
#include "settings_type.h" #include "settings_type.h"
#include "landscape_type.h"
#include "table/strings.h" #include "table/strings.h"

View File

@ -15,7 +15,7 @@
#include "player_type.h" #include "player_type.h"
#include "direction_type.h" #include "direction_type.h"
#include "track_type.h" #include "track_type.h"
#include "openttd.h" #include "transport_type.h"
/** The returned bits of VehicleEnterTile. */ /** The returned bits of VehicleEnterTile. */
enum VehicleEnterTileStatus { enum VehicleEnterTileStatus {

View File

@ -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 */

View File

@ -22,6 +22,7 @@
#include "settings_type.h" #include "settings_type.h"
#include "water_map.h" #include "water_map.h"
#include "water.h" #include "water.h"
#include "landscape_type.h"
#include "table/strings.h" #include "table/strings.h"
#include "table/sprites.h" #include "table/sprites.h"

View File

@ -8,6 +8,7 @@
#include "direction_func.h" #include "direction_func.h"
#include "rail_type.h" #include "rail_type.h"
#include "road_type.h" #include "road_type.h"
#include "transport_type.h"
#include "tile_map.h" #include "tile_map.h"

View File

@ -39,6 +39,7 @@
#include "economy_func.h" #include "economy_func.h"
#include "rail.h" #include "rail.h"
#include "cheat_func.h" #include "cheat_func.h"
#include "landscape_type.h"
#include "table/sprites.h" #include "table/sprites.h"
#include "table/strings.h" #include "table/strings.h"

View File

@ -10,6 +10,7 @@
#include "tile_map.h" #include "tile_map.h"
#include "bridge_map.h" #include "bridge_map.h"
#include "tunnel_map.h" #include "tunnel_map.h"
#include "transport_type.h"
/** /**

View File

@ -27,6 +27,7 @@
#include "station_type.h" #include "station_type.h"
#include "economy_func.h" #include "economy_func.h"
#include "cheat_func.h" #include "cheat_func.h"
#include "landscape_type.h"
#include "table/strings.h" #include "table/strings.h"
#include "table/sprites.h" #include "table/sprites.h"

View File

@ -23,6 +23,7 @@
#include "group_type.h" #include "group_type.h"
#include "engine_type.h" #include "engine_type.h"
#include "order_func.h" #include "order_func.h"
#include "transport_type.h"
/** Road vehicle states */ /** Road vehicle states */
enum RoadVehicleStates { enum RoadVehicleStates {

View File

@ -13,6 +13,7 @@
#include "command_type.h" #include "command_type.h"
#include "vehicle_type.h" #include "vehicle_type.h"
#include "engine_type.h" #include "engine_type.h"
#include "transport_type.h"
#define is_custom_sprite(x) (x >= 0xFD) #define is_custom_sprite(x) (x >= 0xFD)
#define IS_CUSTOM_FIRSTHEAD_SPRITE(x) (x == 0xFD) #define IS_CUSTOM_FIRSTHEAD_SPRITE(x) (x == 0xFD)