diff options
author | terkhen <terkhen@openttd.org> | 2010-12-21 13:56:52 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2010-12-21 13:56:52 +0000 |
commit | a136200c39704302ddaea1a46a9f3990eb736758 (patch) | |
tree | f148bf3e3f629ae2bff801a9ad80388c62974373 /src/roadveh_gui.cpp | |
parent | 5a124feb6dc6a68d56200ffb9c2b497b1970176a (diff) | |
download | openttd-a136200c39704302ddaea1a46a9f3990eb736758.tar.xz |
(svn r21565) -Codechange: Add pixel skip to DrawRoadVehImage().
Diffstat (limited to 'src/roadveh_gui.cpp')
-rw-r--r-- | src/roadveh_gui.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index cc44c4139..029234c26 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -128,8 +128,9 @@ void DrawRoadVehDetails(const Vehicle *v, int left, int right, int y) * @param right The maximum horizontal position * @param y Vertical position to draw at * @param selection Selected vehicle to draw a frame around + * @param skip Number of pixels to skip at the front (for scrolling) */ -void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID selection) +void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID selection, int skip) { bool rtl = _current_text_dir == TD_RTL; Direction dir = rtl ? DIR_E : DIR_W; @@ -143,7 +144,7 @@ void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID se old_dpi = _cur_dpi; _cur_dpi = &tmp_dpi; - int px = rtl ? max_width : 0; + int px = rtl ? max_width + skip : -skip; for (; u != NULL && (rtl ? px > 0 : px < max_width); u = u->Next()) { Point offset; int width = u->GetDisplayImageWidth(&offset); |