diff options
author | peter1138 <peter1138@openttd.org> | 2011-11-24 12:38:48 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2011-11-24 12:38:48 +0000 |
commit | 81598273e9b6bb2ee20ebdd82f3d4646a02999ba (patch) | |
tree | 2d13cc93dc84f2d99cff6fc2bb02214d4453f033 /src/depot_gui.cpp | |
parent | 15d0a22aac6b90a2055e68d019cab4350376a8fd (diff) | |
download | openttd-81598273e9b6bb2ee20ebdd82f3d4646a02999ba.tar.xz |
(svn r23316) -Feature: Add ability to zoom in to 2x and 4x level.
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r-- | src/depot_gui.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index 07fd635a8..cd0b4671d 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -28,6 +28,7 @@ #include "window_gui.h" #include "vehiclelist.h" #include "order_backup.h" +#include "zoom_func.h" #include "table/strings.h" @@ -297,7 +298,7 @@ struct DepotWindow : Window { case VEH_AIRCRAFT: { const Sprite *spr = GetSprite(v->GetImage(DIR_W, EIT_IN_DEPOT), ST_NORMAL); DrawAircraftImage(v, image_left, image_right, - y + max(spr->height + spr->y_offs - 14, 0), // tall sprites needs an y offset + y + max(UnScaleByZoom(spr->height, ZOOM_LVL_GUI) + UnScaleByZoom(spr->y_offs, ZOOM_LVL_GUI) - 14, 0), // tall sprites needs an y offset this->sel, EIT_IN_DEPOT); break; } @@ -608,14 +609,14 @@ struct DepotWindow : Window { Dimension unumber = { GetDigitWidth() * 4, FONT_HEIGHT_NORMAL }; const Sprite *spr = GetSprite(SPR_FLAG_VEH_STOPPED, ST_NORMAL); - this->flag_width = spr->width + WD_FRAMERECT_RIGHT; - this->flag_height = spr->height; + this->flag_width = UnScaleByZoom(spr->width, ZOOM_LVL_GUI) + WD_FRAMERECT_RIGHT; + this->flag_height = UnScaleByZoom(spr->height, ZOOM_LVL_GUI); if (this->type == VEH_TRAIN || this->type == VEH_ROAD) { - min_height = max<uint>(unumber.height + WD_MATRIX_TOP, spr->height); + min_height = max<uint>(unumber.height + WD_MATRIX_TOP, UnScaleByZoom(spr->height, ZOOM_LVL_GUI)); this->header_width = unumber.width + this->flag_width + WD_FRAMERECT_LEFT; } else { - min_height = unumber.height + spr->height + WD_MATRIX_TOP + WD_PAR_VSEP_NORMAL + WD_MATRIX_BOTTOM; + min_height = unumber.height + UnScaleByZoom(spr->height, ZOOM_LVL_GUI) + WD_MATRIX_TOP + WD_PAR_VSEP_NORMAL + WD_MATRIX_BOTTOM; this->header_width = max<uint>(unumber.width, this->flag_width) + WD_FRAMERECT_RIGHT; } int base_width = this->count_width + this->header_width; |