summaryrefslogtreecommitdiff
path: root/src/station_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-07-16 19:00:13 +0000
committersmatz <smatz@openttd.org>2009-07-16 19:00:13 +0000
commit1f29e38b8372484d51d852b89fc957eb53635ecb (patch)
treeda4a251ac74e87e72a2857233069790f991914f6 /src/station_gui.cpp
parentb6889daf8d11b083358a26eea3f633942e2e50e4 (diff)
downloadopenttd-1f29e38b8372484d51d852b89fc957eb53635ecb.tar.xz
(svn r16849) -Codechange: replace GetCargo() by CargoSpec::Get()
Diffstat (limited to 'src/station_gui.cpp')
-rw-r--r--src/station_gui.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index 65a2f39f6..310e2b0dd 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -49,7 +49,7 @@ static void StationsWndShowStationRating(int left, int right, int y, CargoID typ
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 @@ public:
/* 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 @@ public:
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 @@ public:
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 @@ public:
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 @@ public:
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 @@ static const NWidgetPart _nested_station_view_widgets[] = {
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 @@ struct StationViewWindow : public Window {
*b++ = ',';
*b++ = ' ';
}
- b = InlineString(b, GetCargo(i)->name);
+ b = InlineString(b, CargoSpec::Get(i)->name);
}
}
@@ -945,7 +945,7 @@ struct StationViewWindow : public Window {
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];