diff options
author | rubidium <rubidium@openttd.org> | 2009-11-16 22:25:01 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-11-16 22:25:01 +0000 |
commit | a808623b24b247d3a8b3b08875dd6cd2e22a85c6 (patch) | |
tree | 9f899d3a21ba89f4155651ef014a83b4e8392786 /src/train_gui.cpp | |
parent | 6204c56d99d934c0fb04bf6194a7fa29e46953b8 (diff) | |
download | openttd-a808623b24b247d3a8b3b08875dd6cd2e22a85c6.tar.xz |
(svn r18133) -Codechange: pass the 'maximum' left/right positions to Draw*Image
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r-- | src/train_gui.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp index dd7852736..0ad1c04b6 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -61,21 +61,22 @@ void CcBuildLoco(bool success, TileIndex tile, uint32 p1, uint32 p2) /** * Draws an image of a whole train - * @param v Front vehicle - * @param x x Position to start at - * @param y y Position to draw at + * @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 - * @param max_width Number of pixels space for drawing - * @param skip Number of pixels to skip at the front (for scrolling) + * @param skip Number of pixels to skip at the front (for scrolling) */ -void DrawTrainImage(const Train *v, int x, int y, VehicleID selection, int max_width, int skip) +void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID selection, int skip) { DrawPixelInfo tmp_dpi, *old_dpi; /* Position of highlight box */ int highlight_l = 0; int highlight_r = 0; + int max_width = right - left + 1; - if (!FillDrawPixelInfo(&tmp_dpi, x, y, max_width, 14)) return; + if (!FillDrawPixelInfo(&tmp_dpi, left, y, max_width, 14)) return; old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; |