Mercurial > hg > openttd
diff src/station_gui.cpp @ 12415:6a77d1df56e2 draft
(svn r16849) -Codechange: replace GetCargo() by CargoSpec::Get()
author | smatz <smatz@openttd.org> |
---|---|
date | Thu, 16 Jul 2009 19:00:13 +0000 |
parents | b55d6d8e8851 |
children | 0d8340a4c70e |
line wrap: on
line diff
--- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -49,7 +49,7 @@ static const uint units_full = 576; ///< number of units to show station as 'full' static const uint rating_full = 224; ///< rating needed so it is shown as 'full' - const CargoSpec *cs = GetCargo(type); + const CargoSpec *cs = CargoSpec::Get(type); if (!cs->IsValid()) return; int colour = cs->rating_colour; @@ -258,7 +258,7 @@ /* Add cargo filter buttons */ uint num_active = 0; for (CargoID c = 0; c < NUM_CARGO; c++) { - if (GetCargo(c)->IsValid()) num_active++; + if (CargoSpec::Get(c)->IsValid()) num_active++; } this->widget_count += num_active; @@ -267,7 +267,7 @@ uint i = 0; for (CargoID c = 0; c < NUM_CARGO; c++) { - if (!GetCargo(c)->IsValid()) continue; + if (!CargoSpec::Get(c)->IsValid()) continue; Widget *wi = &this->widget[SLW_CARGOSTART + i]; wi->type = WWT_PANEL; @@ -346,7 +346,7 @@ uint i = 0; for (CargoID c = 0; c < NUM_CARGO; c++) { - const CargoSpec *cs = GetCargo(c); + const CargoSpec *cs = CargoSpec::Get(c); if (!cs->IsValid()) continue; cg_ofst = HasBit(this->cargo_filter, c) ? 2 : 1; @@ -457,7 +457,7 @@ case SLW_CARGOALL: { uint i = 0; for (CargoID c = 0; c < NUM_CARGO; c++) { - if (!GetCargo(c)->IsValid()) continue; + if (!CargoSpec::Get(c)->IsValid()) continue; this->LowerWidget(i + SLW_CARGOSTART); i++; } @@ -507,7 +507,7 @@ CargoID c; int i = 0; for (c = 0; c < NUM_CARGO; c++) { - if (!GetCargo(c)->IsValid()) continue; + if (!CargoSpec::Get(c)->IsValid()) continue; if (widget - SLW_CARGOSTART == i) break; i++; } @@ -724,7 +724,7 @@ SpriteID GetCargoSprite(CargoID i) { - const CargoSpec *cs = GetCargo(i); + const CargoSpec *cs = CargoSpec::Get(i); SpriteID sprite; if (cs->sprite == 0xFFFF) { @@ -924,7 +924,7 @@ *b++ = ','; *b++ = ' '; } - b = InlineString(b, GetCargo(i)->name); + b = InlineString(b, CargoSpec::Get(i)->name); } } @@ -945,7 +945,7 @@ y += 10; for (CargoID i = 0; i < NUM_CARGO; i++) { - const CargoSpec *cs = GetCargo(i); + const CargoSpec *cs = CargoSpec::Get(i); if (!cs->IsValid()) continue; const GoodsEntry *ge = &st->goods[i];