summaryrefslogtreecommitdiff
path: root/src/roadveh_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2015-02-01 20:54:24 +0000
committerfrosch <frosch@openttd.org>2015-02-01 20:54:24 +0000
commita8080b62563dcb9f3e3bf5180ebf2de6cf6b68ae (patch)
tree3ac628ab264823257073f281ce7e692f07e5c651 /src/roadveh_gui.cpp
parent3bc7ee3ab731c7a855f811b36356ed907b42989a (diff)
downloadopenttd-a8080b62563dcb9f3e3bf5180ebf2de6cf6b68ae.tar.xz
(svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad().
Diffstat (limited to 'src/roadveh_gui.cpp')
-rw-r--r--src/roadveh_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp
index e00fb2873..46ff6cea7 100644
--- a/src/roadveh_gui.cpp
+++ b/src/roadveh_gui.cpp
@@ -31,7 +31,7 @@
*/
void DrawRoadVehDetails(const Vehicle *v, int left, int right, int y)
{
- uint y_offset = v->HasArticulatedPart() ? UnScaleByZoom(4 * 15, ZOOM_LVL_GUI) : 0; // Draw the first line below the sprite of an articulated RV instead of after it.
+ uint y_offset = v->HasArticulatedPart() ? ScaleGUITrad(15) : 0; // Draw the first line below the sprite of an articulated RV instead of after it.
StringID str;
Money feeder_share = 0;
@@ -137,7 +137,7 @@ void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID se
DrawPixelInfo tmp_dpi, *old_dpi;
int max_width = right - left + 1;
- if (!FillDrawPixelInfo(&tmp_dpi, left, y, max_width, UnScaleByZoom(4 * 14, ZOOM_LVL_GUI))) return;
+ if (!FillDrawPixelInfo(&tmp_dpi, left, y, max_width, ScaleGUITrad(14))) return;
old_dpi = _cur_dpi;
_cur_dpi = &tmp_dpi;
@@ -149,14 +149,14 @@ void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID se
if (rtl ? px + width > 0 : px - width < max_width) {
PaletteID pal = (u->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(u);
- DrawSprite(u->GetImage(dir, image_type), pal, px + (rtl ? -offset.x : offset.x), UnScaleByZoom(4 * 6, ZOOM_LVL_GUI) + offset.y);
+ DrawSprite(u->GetImage(dir, image_type), pal, px + (rtl ? -offset.x : offset.x), ScaleGUITrad(6) + offset.y);
}
px += rtl ? -width : width;
}
if (v->index == selection) {
- DrawFrameRect((rtl ? px : 0), 0, (rtl ? max_width : px) - 1, UnScaleByZoom(4 * 13, ZOOM_LVL_GUI) - 1, COLOUR_WHITE, FR_BORDERONLY);
+ DrawFrameRect((rtl ? px : 0), 0, (rtl ? max_width : px) - 1, ScaleGUITrad(13) - 1, COLOUR_WHITE, FR_BORDERONLY);
}
_cur_dpi = old_dpi;