summaryrefslogtreecommitdiff
path: root/src/ship_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-16 22:25:01 +0000
committerrubidium <rubidium@openttd.org>2009-11-16 22:25:01 +0000
commita808623b24b247d3a8b3b08875dd6cd2e22a85c6 (patch)
tree9f899d3a21ba89f4155651ef014a83b4e8392786 /src/ship_gui.cpp
parent6204c56d99d934c0fb04bf6194a7fa29e46953b8 (diff)
downloadopenttd-a808623b24b247d3a8b3b08875dd6cd2e22a85c6.tar.xz
(svn r18133) -Codechange: pass the 'maximum' left/right positions to Draw*Image
Diffstat (limited to 'src/ship_gui.cpp')
-rw-r--r--src/ship_gui.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ship_gui.cpp b/src/ship_gui.cpp
index abc2a84d2..64a2157d3 100644
--- a/src/ship_gui.cpp
+++ b/src/ship_gui.cpp
@@ -19,12 +19,20 @@
#include "table/strings.h"
-void DrawShipImage(const Vehicle *v, int x, int y, VehicleID selection)
+/**
+ * Draws an image of a ship
+ * @param v Front vehicle
+ * @param left The minimum horizontal position
+ * @param right The maximum horizontal position
+ * @param y Vertical position to draw at
+ * @param selection Selected vehicle to draw a frame around
+ */
+void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selection)
{
- DrawSprite(v->GetImage(DIR_W), GetVehiclePalette(v), x + 32, y + 10);
+ DrawSprite(v->GetImage(DIR_W), GetVehiclePalette(v), left + 32, y + 10);
if (v->index == selection) {
- DrawFrameRect(x - 5, y - 1, x + 67, y + 21, COLOUR_WHITE, FR_BORDERONLY);
+ DrawFrameRect(left - 5, y - 1, left + 67, y + 21, COLOUR_WHITE, FR_BORDERONLY);
}
}