diff options
author | frosch <frosch@openttd.org> | 2015-02-01 20:54:24 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2015-02-01 20:54:24 +0000 |
commit | a8080b62563dcb9f3e3bf5180ebf2de6cf6b68ae (patch) | |
tree | 3ac628ab264823257073f281ce7e692f07e5c651 /src/aircraft_gui.cpp | |
parent | 3bc7ee3ab731c7a855f811b36356ed907b42989a (diff) | |
download | openttd-a8080b62563dcb9f3e3bf5180ebf2de6cf6b68ae.tar.xz |
(svn r27134) -Codechange: Simplify GUI scaling by adding UnScaleGUI() and ScaleGUITrad().
Diffstat (limited to 'src/aircraft_gui.cpp')
-rw-r--r-- | src/aircraft_gui.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index 77cfd1de7..c3379d395 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -86,12 +86,12 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s SpriteID sprite = v->GetImage(rtl ? DIR_E : DIR_W, image_type); const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL); - int width = UnScaleByZoom(real_sprite->width, ZOOM_LVL_GUI); - int x_offs = UnScaleByZoom(real_sprite->x_offs, ZOOM_LVL_GUI); + int width = UnScaleGUI(real_sprite->width); + int x_offs = UnScaleGUI(real_sprite->x_offs); int x = rtl ? right - width - x_offs : left - x_offs; bool helicopter = v->subtype == AIR_HELICOPTER; - int y_offs = UnScaleByZoom(4 * 10, ZOOM_LVL_GUI); + int y_offs = ScaleGUITrad(10); int heli_offs = 0; PaletteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); @@ -100,12 +100,12 @@ void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID s const Aircraft *a = Aircraft::From(v); SpriteID rotor_sprite = GetCustomRotorSprite(a, true, image_type); if (rotor_sprite == 0) rotor_sprite = SPR_ROTOR_STOPPED; - heli_offs = UnScaleByZoom(4 * 5, ZOOM_LVL_GUI); + heli_offs = ScaleGUITrad(5); DrawSprite(rotor_sprite, PAL_NONE, x, y + y_offs - heli_offs); } if (v->index == selection) { x += x_offs; - y += UnScaleByZoom(real_sprite->y_offs, ZOOM_LVL_GUI) + y_offs - heli_offs; - DrawFrameRect(x - 1, y - 1, x + width + 1, y + UnScaleByZoom(real_sprite->height, ZOOM_LVL_GUI) + heli_offs + 1, COLOUR_WHITE, FR_BORDERONLY); + y += UnScaleGUI(real_sprite->y_offs) + y_offs - heli_offs; + DrawFrameRect(x - 1, y - 1, x + width + 1, y + UnScaleGUI(real_sprite->height) + heli_offs + 1, COLOUR_WHITE, FR_BORDERONLY); } } |