diff options
author | rubidium <rubidium@openttd.org> | 2007-03-07 12:11:48 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-03-07 12:11:48 +0000 |
commit | 24c4d5b06d231785db01500360c26815d8fe4d15 (patch) | |
tree | 757477dbdc02025cc29690a4e66e40f872cab02b /src/table | |
parent | 36bb92ae241403d61dc7a3e5a1696b615be61395 (diff) | |
download | openttd-24c4d5b06d231785db01500360c26815d8fe4d15.tar.xz |
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
Diffstat (limited to 'src/table')
-rw-r--r-- | src/table/ai_rail.h | 12 | ||||
-rw-r--r-- | src/table/build_industry.h | 4 | ||||
-rw-r--r-- | src/table/elrail_data.h | 16 | ||||
-rw-r--r-- | src/table/industry_land.h | 8 | ||||
-rw-r--r-- | src/table/namegen.h | 26 | ||||
-rw-r--r-- | src/table/palettes.h | 8 | ||||
-rw-r--r-- | src/table/sprites.h | 4 | ||||
-rw-r--r-- | src/table/town_land.h | 4 | ||||
-rw-r--r-- | src/table/tree_land.h | 4 | ||||
-rw-r--r-- | src/table/unicode.h | 4 | ||||
-rw-r--r-- | src/table/unmovable_land.h | 4 | ||||
-rw-r--r-- | src/table/water_land.h | 4 |
12 files changed, 50 insertions, 48 deletions
diff --git a/src/table/ai_rail.h b/src/table/ai_rail.h index 218f33f3d..bbb094728 100644 --- a/src/table/ai_rail.h +++ b/src/table/ai_rail.h @@ -1,24 +1,24 @@ /* $Id$ */ -typedef struct { +struct AiDefaultBlockData { byte mode; byte attr; TileIndexDiffC tileoffs; -} AiDefaultBlockData; +}; -typedef struct { +struct AiDefaultRailBlock { byte p0; byte p1; byte p2; byte p3; byte dir; const AiDefaultBlockData *data; -} AiDefaultRailBlock; +}; -typedef struct { +struct AiDefaultRoadBlock { byte dir; const AiDefaultBlockData *data; -} AiDefaultRoadBlock; +}; #define MKHDR(a,b,c,d,e) a,b,c,d,e, diff --git a/src/table/build_industry.h b/src/table/build_industry.h index a292a1cf4..729013973 100644 --- a/src/table/build_industry.h +++ b/src/table/build_industry.h @@ -1068,7 +1068,7 @@ static const IndustryTileTable * const _tile_table_sugar_mine[] = { /* Procedures that can be run to check whether an industry may * build at location the given to the procedure */ -typedef enum CheckProcs { +enum CheckProc { CHECK_NOTHING = 0, CHECK_FOREST = 1, CHECK_REFINERY = 2, @@ -1079,7 +1079,7 @@ typedef enum CheckProcs { CHECK_BUBBLEGEN = 7, CHECK_OIL_RIG = 8, CHECK_END, -} CheckProc; +}; #define MK(tbl, d, c1, c2, c3, proc, p1, r1, p2, r2, m, a1, a2, a3, pr, clim, in, s1, s2, s3) \ {tbl, lengthof(tbl), d, {c1, c2, c3}, proc, {p1, p2}, {r1, r2}, m, \ diff --git a/src/table/elrail_data.h b/src/table/elrail_data.h index 1ed5751b4..003da906d 100644 --- a/src/table/elrail_data.h +++ b/src/table/elrail_data.h @@ -7,23 +7,23 @@ /** Tile Location group. * This defines whether the X and or Y coordinate of a tile is even */ -typedef enum TLG { +enum TLG { XEVEN_YEVEN = 0, XEVEN_YODD = 1, XODD_YEVEN = 2, XODD_YODD = 3, TLG_END -} TLG; +}; /** When determining the pylon configuration on the edge, two tiles are taken * into account: the tile being drawn itself (the home tile, the one in * ti->tile), and the neighbouring tile */ -typedef enum { +enum TileSource { TS_HOME = 0, TS_NEIGHBOUR = 1, TS_END -} TileSource; +}; enum { NUM_TRACKS_AT_PCP = 6 @@ -253,7 +253,7 @@ static const SpriteID pylons_bridge[] = { SPR_PYLON_Y_SW }; -typedef struct { +struct SortableSpriteStruct { SpriteID image; int8 x_offset; int8 y_offset; @@ -261,7 +261,7 @@ typedef struct { int8 y_size; int8 z_size; int8 z_offset; -} SortableSpriteStruct; +}; enum { /** Distance between wire and rail */ @@ -351,7 +351,7 @@ static const SortableSpriteStruct CatenarySpriteData_Depot[] = { * <li>Position of the Pylon relative to the track</li> * <li>Position of the Pylon inside the tile</li></ol> */ -typedef enum { +enum CatenarySprite { WIRE_X_FLAT_SW, WIRE_X_FLAT_NE, WIRE_X_FLAT_BOTH, @@ -395,7 +395,7 @@ typedef enum { WIRE_EW_S_E, INVALID_CATENARY = 0xFF -} CatenarySprite; +}; /* Selects a Wire (with white and grey ends) depending on whether: * a) none (should never happen) diff --git a/src/table/industry_land.h b/src/table/industry_land.h index cb8174fa2..b98d9060c 100644 --- a/src/table/industry_land.h +++ b/src/table/industry_land.h @@ -1,17 +1,17 @@ /* $Id$ */ -typedef struct DrawIndustrySpec1Struct { +struct DrawIndustrySpec1Struct { byte x; byte image_1; byte image_2; byte image_3; -} DrawIndustrySpec1Struct; +}; -typedef struct DrawIndustrySpec4Struct { +struct DrawIndustrySpec4Struct { byte image_1; byte image_2; byte image_3; -} DrawIndustrySpec4Struct; +}; #define M(s1, p1, s2, p2, sx, sy, w, h, dz, p) { { s1, p1 }, { s2, p2 }, sx, sy, w - 1, h - 1, dz, p } diff --git a/src/table/namegen.h b/src/table/namegen.h index 6dea4008f..99845c8b0 100644 --- a/src/table/namegen.h +++ b/src/table/namegen.h @@ -1690,7 +1690,7 @@ static const char *name_czech_real[] = { * with cloning this for your own language. */ // Sing., pl. -typedef enum CzechGender { +enum CzechGender { CZG_SMASC, CZG_SFEM, CZG_SNEUT, @@ -1701,12 +1701,14 @@ typedef enum CzechGender { CZG_FREE, // Like CZG_FREE, but disallow CZG_SNEUT. CZG_NFREE -} CzechGender; -typedef enum CzechPattern { +}; + +enum CzechPattern { CZP_JARNI, CZP_MLADY, CZP_PRIVL -} CzechPattern; +}; + /* [CzechGender][CzechPattern] - replaces the last character of the adjective * by this. */ // XXX: [CZG_SMASC][CZP_PRIVL] needs special handling: -ovX -> -uv. @@ -1721,38 +1723,38 @@ static const char *name_czech_patmod[][3] = { // This way the substantives can choose only some adjectives/endings: // At least one of these flags must be satisfied: -typedef enum CzechAllow { +enum CzechAllow { CZA_SHORT = 1, CZA_MIDDLE = 2, CZA_LONG = 4, CZA_ALL = ~0 -} CzechAllow; +}; DECLARE_ENUM_AS_BIT_SET(CzechAllow); // All these flags must be satisfied (in the stem->others direction): -typedef enum CzechChoose { +enum CzechChoose { CZC_NONE = 0, // No requirements. CZC_COLOR = 1, CZC_POSTFIX = 2, // Matched if postfix was inserted. CZC_NOPOSTFIX = 4, // Matched if no postfix was inserted. CZC_ANY = ~0 -} CzechChoose; +}; DECLARE_ENUM_AS_BIT_SET(CzechChoose); -typedef struct CzechNameSubst { +struct CzechNameSubst { CzechGender gender; CzechAllow allow; CzechChoose choose; const char *name; -} CzechNameSubst; +}; -typedef struct CzechNameAdj { +struct CzechNameAdj { CzechPattern pattern; CzechChoose choose; const char *name; -} CzechNameAdj; +}; // Some of items which should be common are doubled. static const CzechNameAdj name_czech_adj[] = { diff --git a/src/table/palettes.h b/src/table/palettes.h index fc931c7c2..dd69085c7 100644 --- a/src/table/palettes.h +++ b/src/table/palettes.h @@ -141,7 +141,7 @@ static const Colour _palettes[][256] = { #define GET_PALETTE(x) _palettes[x] -typedef struct { +struct ExtraPaletteValues { Colour a[15]; // dark blue water Colour ac[15]; // dark blue water Toyland Colour lighthouse[12]; // lighthouse & stadium @@ -149,7 +149,7 @@ typedef struct { Colour e[15]; // ??? Colour b[45]; // glittery water Colour bc[45]; // glittery water Toyland -} ExtraPaletteValues; +}; static const ExtraPaletteValues _extra_palette_values = { { M( 32, 68, 112), M( 36, 72, 116), M( 40, 76, 120), M( 44, 80, 124), @@ -173,10 +173,10 @@ static const ExtraPaletteValues _extra_palette_values = { #undef M // Color table for colors in lang files (e.g. {BLACK}) -typedef struct StringColor { +struct StringColor { byte text; byte shadow; -} StringColor; +}; static const StringColor _string_colormap[] = { { 150, 215 }, // BLUE diff --git a/src/table/sprites.h b/src/table/sprites.h index 014d03130..1ea4f71cf 100644 --- a/src/table/sprites.h +++ b/src/table/sprites.h @@ -1191,7 +1191,7 @@ enum Sprites { }; /** Cursor sprite numbers */ -typedef enum CursorSprites { +enum CursorSprite { /* Terraform */ /* Cursors */ SPR_CURSOR_MOUSE = 0, @@ -1278,7 +1278,7 @@ typedef enum CursorSprites { SPR_CURSOR_CLONE_ROADVEH = SPR_OPENTTD_BASE + 110, SPR_CURSOR_CLONE_SHIP = SPR_OPENTTD_BASE + 112, SPR_CURSOR_CLONE_AIRPLANE = SPR_OPENTTD_BASE + 114, -} CursorSprite; +}; /// Animation macro in table/animcursors.h (_animcursors[]) enum AnimCursors { diff --git a/src/table/town_land.h b/src/table/town_land.h index caf2b3b2a..091b8926a 100644 --- a/src/table/town_land.h +++ b/src/table/town_land.h @@ -2017,9 +2017,9 @@ static const uint16 _housetype_remove_ratingmod[] = { assert_compile(lengthof(_housetype_remove_ratingmod) == HOUSE_MAX); -typedef struct { +struct HousetypeYear { Year min, max; -} HousetypeYear; +}; static const HousetypeYear _housetype_years[] = { { 1963, MAX_YEAR }, diff --git a/src/table/tree_land.h b/src/table/tree_land.h index de9e69e67..2d039de14 100644 --- a/src/table/tree_land.h +++ b/src/table/tree_land.h @@ -13,10 +13,10 @@ static const SpriteID _tree_sprites_1[] = { static const byte _tree_base_by_landscape[4] = {0, 12, 20, 32}; static const byte _tree_count_by_landscape[4] = {12, 8, 12, 9}; -typedef struct TreePos { +struct TreePos { uint8 x; uint8 y; -} TreePos; +}; static const TreePos _tree_layout_xy[][4] = { { { 9, 3 }, { 1, 8 }, { 0, 0 }, { 8, 9 } }, diff --git a/src/table/unicode.h b/src/table/unicode.h index 2bbd6624c..e94340d55 100644 --- a/src/table/unicode.h +++ b/src/table/unicode.h @@ -1,10 +1,10 @@ /* $Id$ */ -typedef struct DefaultUnicodeMapping { +struct DefaultUnicodeMapping { WChar code; ///< Unicode value byte key; ///< Character index of sprite -} DefaultUnicodeMapping; +}; /* Default unicode mapping table for sprite based glyphs. diff --git a/src/table/unmovable_land.h b/src/table/unmovable_land.h index 9b9f004a7..78585d5a7 100644 --- a/src/table/unmovable_land.h +++ b/src/table/unmovable_land.h @@ -1,6 +1,6 @@ /* $Id$ */ -typedef struct DrawTileUnmovableStruct { +struct DrawTileUnmovableStruct { uint16 image; byte subcoord_x; byte subcoord_y; @@ -8,7 +8,7 @@ typedef struct DrawTileUnmovableStruct { byte height; byte z_size; byte unused; -} DrawTileUnmovableStruct; +}; #define TILE_SEQ_END() { (byte)0x80, 0, 0, 0, 0, 0, 0, 0 } diff --git a/src/table/water_land.h b/src/table/water_land.h index a27eb3510..9562c1d02 100644 --- a/src/table/water_land.h +++ b/src/table/water_land.h @@ -1,6 +1,6 @@ /* $Id$ */ -typedef struct WaterDrawTileStruct { +struct WaterDrawTileStruct { byte delta_x; byte delta_y; byte delta_z; @@ -8,7 +8,7 @@ typedef struct WaterDrawTileStruct { byte height; byte unk; SpriteID image; -} WaterDrawTileStruct; +}; #define BEGIN(image) { 0, 0, 0, 0, 0, 0, image } #define END(y) { 0x80, y, 0, 0, 0, 0, 0 } |