summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-07-10 22:03:09 +0000
committeryexo <yexo@openttd.org>2009-07-10 22:03:09 +0000
commit4843b3c45d7dac3dc3bde82b8b4b0cfd3c5924e1 (patch)
tree0aafd9c27a76258eea8875b3701c12a400811493 /src/misc_gui.cpp
parent58ee544cff63e5e1d684074d20e6476b72acf5c1 (diff)
downloadopenttd-4843b3c45d7dac3dc3bde82b8b4b0cfd3c5924e1.tar.xz
(svn r16789) -Codechange: unify the drawing of the Accepts/Supplies cargo lists in the station build windows.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index bfdfd7818..459ef5f36 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -811,7 +811,7 @@ void GuiShowTooltips(StringID str, uint paramcount, const uint64 params[], bool
static int DrawStationCoverageText(const CargoArray &cargos,
- int str_x, int str_y, StationCoverageType sct, bool supplies)
+ int left, int right, int top, StationCoverageType sct, bool supplies)
{
bool first = true;
@@ -847,19 +847,20 @@ static int DrawStationCoverageText(const CargoArray &cargos,
assert(b < endof(string));
SetDParamStr(0, string);
- return DrawStringMultiLine(str_x, str_x + 144, str_y, INT32_MAX, STR_JUST_RAW_STRING);
+ return DrawStringMultiLine(left, right, top, INT32_MAX, STR_JUST_RAW_STRING);
}
/**
* Calculates and draws the accepted or supplied cargo around the selected tile(s)
- * @param sx x position where the string is to be drawn
- * @param sy y position where the string is to be drawn
+ * @param left x position where the string is to be drawn
+ * @param right the right most position to draw on
+ * @param top y position where the string is to be drawn
* @param sct which type of cargo is to be displayed (passengers/non-passengers)
* @param rad radius around selected tile(s) to be searched
* @param supplies if supplied cargos should be drawn, else accepted cargos
* @return Returns the y value below the string that was drawn
*/
-int DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad, bool supplies)
+int DrawStationCoverageAreaText(int left, int right, int top, StationCoverageType sct, int rad, bool supplies)
{
TileIndex tile = TileVirtXY(_thd.pos.x, _thd.pos.y);
if (tile < MapSize()) {
@@ -869,10 +870,10 @@ int DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad
} else {
cargos = GetAcceptanceAroundTiles(tile, _thd.size.x / TILE_SIZE, _thd.size.y / TILE_SIZE, rad);
}
- return DrawStationCoverageText(cargos, sx, sy, sct, supplies);
+ return DrawStationCoverageText(cargos, left, right, top, sct, supplies);
}
- return sy;
+ return top;
}
void CheckRedrawStationCoverage(const Window *w)