Mercurial > hg > openttd
changeset 4330:0b698c3335ab draft
(svn r6005) -Cleanup: introduce IndustryID and use it
-Cleanup: use TownID and StationID for two instances of uint16
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 20 Aug 2006 19:31:58 +0000 |
parents | 802bb06b06cf |
children | a8568184c6c0 |
files | economy.c industry.h industry_cmd.c industry_map.h openttd.h town_cmd.c |
diffstat | 6 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/economy.c +++ b/economy.c @@ -844,7 +844,7 @@ return tp; } -void DeleteSubsidyWithIndustry(uint16 index) +void DeleteSubsidyWithIndustry(IndustryID index) { Subsidy *s; @@ -857,7 +857,7 @@ } } -void DeleteSubsidyWithStation(uint16 index) +void DeleteSubsidyWithStation(StationID index) { Subsidy *s; bool dirty = false;
--- a/industry.h +++ b/industry.h @@ -35,7 +35,7 @@ Year last_prod_year; byte was_cargo_delivered; - uint16 index; + IndustryID index; }; typedef struct IndustryTileTable {
--- a/industry_cmd.c +++ b/industry_cmd.c @@ -811,7 +811,7 @@ } while (--size); } -static void PlantFarmField(TileIndex tile, uint16 industry) +static void PlantFarmField(TileIndex tile, IndustryID industry) { uint size_x, size_y; uint32 r; @@ -1404,7 +1404,7 @@ FOR_ALL_INDUSTRIES(i) { if (i->xy == 0) { - uint index = i->index; + IndustryID index = i->index; if (i->index > _total_industries) _total_industries = i->index;
--- a/industry_map.h +++ b/industry_map.h @@ -28,7 +28,7 @@ GFX_TOY_FACTORY = 143 }; -static inline uint GetIndustryIndex(TileIndex t) +static inline IndustryID GetIndustryIndex(TileIndex t) { assert(IsTileType(t, MP_INDUSTRY)); return _m[t].m2; @@ -95,7 +95,7 @@ _m[t].m5 = gfx; } -static inline void MakeIndustry(TileIndex t, uint index, IndustryGfx gfx) +static inline void MakeIndustry(TileIndex t, IndustryID index, IndustryGfx gfx) { SetTileType(t, MP_INDUSTRY); _m[t].m1 = 0;