diff options
author | peter1138 <peter1138@openttd.org> | 2014-10-04 16:40:23 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2014-10-04 16:40:23 +0000 |
commit | ce9fab58bc02cda3fde8d3cb42fd88f25889b340 (patch) | |
tree | 7b92188f2ac8622c17ee45cd6c54bd16196c064c /src/roadveh_gui.cpp | |
parent | 587ad940cc46ffb573e080320bac51085994b7f7 (diff) | |
download | openttd-ce9fab58bc02cda3fde8d3cb42fd88f25889b340.tar.xz |
(svn r26951) -Codechange: Do the GUI-scale dance for vehicle, depot, and purchase lists.
Diffstat (limited to 'src/roadveh_gui.cpp')
-rw-r--r-- | src/roadveh_gui.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index 7f3e7bbbc..e00fb2873 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -15,6 +15,7 @@ #include "strings_func.h" #include "vehicle_func.h" #include "string_func.h" +#include "zoom_func.h" #include "table/strings.h" @@ -30,7 +31,7 @@ */ void DrawRoadVehDetails(const Vehicle *v, int left, int right, int y) { - uint y_offset = v->HasArticulatedPart() ? 15 : 0; // Draw the first line below the sprite of an articulated RV instead of after it. + 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. StringID str; Money feeder_share = 0; @@ -136,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, 14)) return; + if (!FillDrawPixelInfo(&tmp_dpi, left, y, max_width, UnScaleByZoom(4 * 14, ZOOM_LVL_GUI))) return; old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; @@ -148,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), 6 + offset.y); + DrawSprite(u->GetImage(dir, image_type), pal, px + (rtl ? -offset.x : offset.x), UnScaleByZoom(4 * 6, ZOOM_LVL_GUI) + offset.y); } px += rtl ? -width : width; } if (v->index == selection) { - DrawFrameRect((rtl ? px : 0), 0, (rtl ? max_width : px) - 1, 12, COLOUR_WHITE, FR_BORDERONLY); + DrawFrameRect((rtl ? px : 0), 0, (rtl ? max_width : px) - 1, UnScaleByZoom(4 * 13, ZOOM_LVL_GUI) - 1, COLOUR_WHITE, FR_BORDERONLY); } _cur_dpi = old_dpi; |