summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2014-10-04 20:18:25 +0000
committerpeter1138 <peter1138@openttd.org>2014-10-04 20:18:25 +0000
commitd6ac7d6fda940bc2b24290175f1fe3bcbaa16ae1 (patch)
tree92e25907c058fe70baa6ed2bed3b99e5c7dd1a35 /src
parent51c7d2ab6f5f789858dc17f285dea59d73aedda9 (diff)
downloadopenttd-d6ac7d6fda940bc2b24290175f1fe3bcbaa16ae1.tar.xz
(svn r26957) -Codechange: Spread the station cargo icons out by GUI scale.
Diffstat (limited to 'src')
-rw-r--r--src/station_gui.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/station_gui.cpp b/src/station_gui.cpp
index e9f0a9240..a6fc67c88 100644
--- a/src/station_gui.cpp
+++ b/src/station_gui.cpp
@@ -31,6 +31,7 @@
#include "vehiclelist.h"
#include "town.h"
#include "linkgraph/linkgraph.h"
+#include "zoom_func.h"
#include "widgets/station_widget.h"
@@ -802,15 +803,16 @@ static const NWidgetPart _nested_station_view_widgets[] = {
*/
static void DrawCargoIcons(CargoID i, uint waiting, int left, int right, int y)
{
- uint num = min((waiting + 5) / 10, (right - left) / 10); // maximum is width / 10 icons so it won't overflow
+ int width = UnScaleByZoom(4 * 10, ZOOM_LVL_GUI);
+ uint num = min((waiting + (width / 2)) / width, (right - left) / width); // maximum is width / 10 icons so it won't overflow
if (num == 0) return;
SpriteID sprite = CargoSpec::Get(i)->GetCargoIcon();
- int x = _current_text_dir == TD_RTL ? left : right - num * 10;
+ int x = _current_text_dir == TD_RTL ? left : right - num * width;
do {
DrawSprite(sprite, PAL_NONE, x, y);
- x += 10;
+ x += width;
} while (--num);
}