diff options
author | rubidium <rubidium@openttd.org> | 2010-05-13 09:44:44 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-05-13 09:44:44 +0000 |
commit | 398418b8fa23ab59f5fc027a7dd6aeba9da4d7bb (patch) | |
tree | 54de30f4702263ee1489af162d6da840e35c0a87 /src/table | |
parent | 793b0f0736ac543fb1f6a7e9a4bfd678891e7374 (diff) | |
download | openttd-398418b8fa23ab59f5fc027a7dd6aeba9da4d7bb.tar.xz |
(svn r19812) -Codechange: give some unnamed enums a name or, in case they consisted of unrelated values use static const (u)int
Diffstat (limited to 'src/table')
-rw-r--r-- | src/table/build_industry.h | 2 | ||||
-rw-r--r-- | src/table/elrail_data.h | 14 | ||||
-rw-r--r-- | src/table/landscape_sprite.h | 4 | ||||
-rw-r--r-- | src/table/palettes.h | 12 | ||||
-rw-r--r-- | src/table/unicode.h | 6 |
5 files changed, 14 insertions, 24 deletions
diff --git a/src/table/build_industry.h b/src/table/build_industry.h index c7e7870da..99165df37 100644 --- a/src/table/build_industry.h +++ b/src/table/build_industry.h @@ -1098,7 +1098,7 @@ static const uint8 _farm_sounds[] = { SND_24_SHEEP, SND_25_COW, SND_26_HORSE }; /** Array with... hem... a sound of toyland */ static const uint8 _plastic_mine_sounds[] = { SND_33_PLASTIC_MINE }; -enum { +enum IndustryTypes { IT_COAL_MINE = 0, IT_POWER_STATION = 1, IT_SAWMILL = 2, diff --git a/src/table/elrail_data.h b/src/table/elrail_data.h index 55725a249..4c008a773 100644 --- a/src/table/elrail_data.h +++ b/src/table/elrail_data.h @@ -33,9 +33,7 @@ enum TileSource { TS_END }; -enum { - NUM_TRACKS_AT_PCP = 6 -}; +static const uint NUM_TRACKS_AT_PCP = 6; /** Which PPPs are possible at all on a given PCP */ static const byte AllowedPPPonPCP[DIAGDIR_END] = { @@ -316,12 +314,10 @@ struct SortableSpriteStruct { int8 z_offset; }; -enum { - /** Distance between wire and rail */ - ELRAIL_ELEVATION = 10, - /** Wires that a draw one level higher than the north corner. */ - ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT -}; +/** Distance between wire and rail */ +static const uint ELRAIL_ELEVATION = 10; +/** Wires that a draw one level higher than the north corner. */ +static const uint ELRAIL_ELEVRAISE = ELRAIL_ELEVATION + TILE_HEIGHT; static const SortableSpriteStruct CatenarySpriteData[] = { /* X direction diff --git a/src/table/landscape_sprite.h b/src/table/landscape_sprite.h index 32f674e0a..13fe22c92 100644 --- a/src/table/landscape_sprite.h +++ b/src/table/landscape_sprite.h @@ -9,9 +9,7 @@ /** @file landscape_sprite.h Offsets of sprites to replace for non-temperate landscapes. */ -enum { - END = 0xFFFF -}; +static const SpriteID END = 0xFFFF; static const SpriteID _landscape_spriteindexes_1[] = { 0xF67, 0xF9F, diff --git a/src/table/palettes.h b/src/table/palettes.h index 5ab88df69..68f74377f 100644 --- a/src/table/palettes.h +++ b/src/table/palettes.h @@ -154,13 +154,11 @@ static const Colour _palettes[][256] = { #define GET_PALETTE(x) _palettes[x] /** Description of the length of the palette cycle animations */ -enum { - EPV_CYCLES_DARK_WATER = 5, ///< length of the dark blue water animation - EPV_CYCLES_LIGHTHOUSE = 4, ///< length of the lighthouse/stadium animation - EPV_CYCLES_OIL_REFINERY = 7, ///< length of the oil refinery's fire animation - EPV_CYCLES_FIZZY_DRINK = 5, ///< length of the fizzy drinks animation - EPV_CYCLES_GLITTER_WATER = 15, ///< length of the glittery water animation -}; +static const uint EPV_CYCLES_DARK_WATER = 5; ///< length of the dark blue water animation +static const uint EPV_CYCLES_LIGHTHOUSE = 4; ///< length of the lighthouse/stadium animation +static const uint EPV_CYCLES_OIL_REFINERY = 7; ///< length of the oil refinery's fire animation +static const uint EPV_CYCLES_FIZZY_DRINK = 5; ///< length of the fizzy drinks animation +static const uint EPV_CYCLES_GLITTER_WATER = 15; ///< length of the glittery water animation /** Description of tables for the palette animation */ struct ExtraPaletteValues { diff --git a/src/table/unicode.h b/src/table/unicode.h index 4c7f45107..862878e6f 100644 --- a/src/table/unicode.h +++ b/src/table/unicode.h @@ -14,10 +14,8 @@ struct DefaultUnicodeMapping { byte key; ///< Character index of sprite }; -enum { - CLRA = 0, ///< Identifier to clear all glyphs at this codepoint - CLRL = 1, ///< Identifier to clear glyphs for large font at this codepoint -}; +static const byte CLRA = 0; ///< Identifier to clear all glyphs at this codepoint +static const byte CLRL = 1; ///< Identifier to clear glyphs for large font at this codepoint /* Default unicode mapping table for sprite based glyphs. * This table allows us use unicode characters even though the glyphs don't |