From 812ad41f23b7ed52a161ed15b15a2af3a7edb41f Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 27 Jun 2009 18:26:50 +0000 Subject: (svn r16676) -Codechange: Rename AcceptedCargo to CargoArray and its instances to more meaningful names. --- src/industry_cmd.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/industry_cmd.cpp') diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 384ef4bd0..4e355c738 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -380,18 +380,18 @@ static Foundation GetFoundation_Industry(TileIndex tile, Slope tileh) return FlatteningFoundation(tileh); } -static void AddAcceptedCargo_Industry(TileIndex tile, AcceptedCargo ac) +static void AddAcceptedCargo_Industry(TileIndex tile, CargoArray acceptance) { IndustryGfx gfx = GetIndustryGfx(tile); const IndustryTileSpec *itspec = GetIndustryTileSpec(gfx); /* When we have to use a callback, we put our data in the next two variables */ CargoID raw_accepts_cargo[lengthof(itspec->accepts_cargo)]; - uint8 raw_acceptance[lengthof(itspec->acceptance)]; + uint8 raw_cargo_acceptance[lengthof(itspec->acceptance)]; /* And then these will always point to a same sized array with the required data */ const CargoID *accepts_cargo = itspec->accepts_cargo; - const uint8 *acceptance = itspec->acceptance; + const uint8 *cargo_acceptance = itspec->acceptance; if (HasBit(itspec->callback_flags, CBM_INDT_ACCEPT_CARGO)) { uint16 res = GetIndustryTileCallback(CBID_INDTILE_ACCEPT_CARGO, 0, 0, gfx, GetIndustryByTile(tile), tile); @@ -404,14 +404,14 @@ static void AddAcceptedCargo_Industry(TileIndex tile, AcceptedCargo ac) if (HasBit(itspec->callback_flags, CBM_INDT_CARGO_ACCEPTANCE)) { uint16 res = GetIndustryTileCallback(CBID_INDTILE_CARGO_ACCEPTANCE, 0, 0, gfx, GetIndustryByTile(tile), tile); if (res != CALLBACK_FAILED) { - acceptance = raw_acceptance; - for (uint i = 0; i < lengthof(itspec->accepts_cargo); i++) raw_acceptance[i] = GB(res, i * 4, 4); + cargo_acceptance = raw_cargo_acceptance; + for (uint i = 0; i < lengthof(itspec->accepts_cargo); i++) raw_cargo_acceptance[i] = GB(res, i * 4, 4); } } for (byte i = 0; i < lengthof(itspec->accepts_cargo); i++) { CargoID a = accepts_cargo[i]; - if (a != CT_INVALID) ac[a] += acceptance[i]; + if (a != CT_INVALID) acceptance[a] += cargo_acceptance[i]; } } @@ -868,13 +868,13 @@ static TrackStatus GetTileTrackStatus_Industry(TileIndex tile, TransportType mod return 0; } -static void AddProducedCargo_Industry(TileIndex tile, AcceptedCargo ac) +static void AddProducedCargo_Industry(TileIndex tile, CargoArray produced) { const Industry *i = GetIndustryByTile(tile); for (uint j = 0; j < lengthof(i->produced_cargo); j++) { CargoID cargo = i->produced_cargo[j]; - if (cargo != CT_INVALID) ac[cargo]++; + if (cargo != CT_INVALID) produced[cargo]++; } } -- cgit v1.2.3-54-g00ecf