summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2009-06-27 21:06:58 +0000
committerfrosch <frosch@openttd.org>2009-06-27 21:06:58 +0000
commita288e4d82ff85819aa49061d66ee7e0cfd87e802 (patch)
treedcb119ed56cd690290a226e44feaf430ff4f14de /src/misc_gui.cpp
parent9b070b5405d11c74d89a747e912e627e39850f7c (diff)
downloadopenttd-a288e4d82ff85819aa49061d66ee7e0cfd87e802.tar.xz
(svn r16678) -Codechange: Turn CargoArray into a class, so one does not have to deal with sizeof() wrt. typedef-ed arrays.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 4ebdb53ec..bfdfd7818 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -130,7 +130,6 @@ public:
td.grf = NULL;
CargoArray acceptance;
- memset(acceptance, 0, sizeof(CargoArray));
AddAcceptedCargo(tile, acceptance);
GetTileDesc(tile, &td);
@@ -811,7 +810,7 @@ void GuiShowTooltips(StringID str, uint paramcount, const uint64 params[], bool
}
-static int DrawStationCoverageText(const CargoArray cargos,
+static int DrawStationCoverageText(const CargoArray &cargos,
int str_x, int str_y, StationCoverageType sct, bool supplies)
{
bool first = true;
@@ -863,12 +862,12 @@ static int DrawStationCoverageText(const CargoArray cargos,
int DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad, bool supplies)
{
TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y);
- CargoArray cargos;
if (tile < MapSize()) {
+ CargoArray cargos;
if (supplies) {
- GetProductionAroundTiles(cargos, tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE , rad);
+ cargos = GetProductionAroundTiles(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE, rad);
} else {
- GetAcceptanceAroundTiles(cargos, tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE , rad);
+ cargos = GetAcceptanceAroundTiles(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE, rad);
}
return DrawStationCoverageText(cargos, sx, sy, sct, supplies);
}