summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-08-29 09:30:40 +0000
committerrubidium <rubidium@openttd.org>2009-08-29 09:30:40 +0000
commit9eb06f125fa913d73c9202651d1715816afa1360 (patch)
treeb0eae8b6c9a9ea253c66f3c1714c53d2031787f6 /src
parent76a667bb352efa092a2d5ac36c22a74a6dcfa790 (diff)
downloadopenttd-9eb06f125fa913d73c9202651d1715816afa1360.tar.xz
(svn r17304) -Codechange: move (more) drawing code out of the rail depot picker's OnPaint.
Diffstat (limited to 'src')
-rw-r--r--src/rail_gui.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 1a972b8db..a44eed5a5 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -1689,11 +1689,13 @@ struct BuildRailDepotWindow : public PickerWindowBase {
virtual void OnPaint()
{
this->DrawWidgets();
+ }
+
+ virtual void DrawWidget(const Rect &r, int widget) const
+ {
+ if (!IsInsideMM(widget, BRDW_DEPOT_NE, BRDW_DEPOT_NW + 1)) return;
- DrawTrainDepotSprite(this->nested_array[BRDW_DEPOT_NE]->pos_x - 1, this->nested_array[BRDW_DEPOT_NE]->pos_y, DIAGDIR_NE, _cur_railtype);
- DrawTrainDepotSprite(this->nested_array[BRDW_DEPOT_SE]->pos_x - 1, this->nested_array[BRDW_DEPOT_SE]->pos_y, DIAGDIR_SE, _cur_railtype);
- DrawTrainDepotSprite(this->nested_array[BRDW_DEPOT_SW]->pos_x - 1, this->nested_array[BRDW_DEPOT_SW]->pos_y, DIAGDIR_SW, _cur_railtype);
- DrawTrainDepotSprite(this->nested_array[BRDW_DEPOT_NW]->pos_x - 1, this->nested_array[BRDW_DEPOT_NW]->pos_y, DIAGDIR_NW, _cur_railtype);
+ DrawTrainDepotSprite(r.left - 1, r.top, widget - BRDW_DEPOT_NE + DIAGDIR_NE, _cur_railtype);
}
virtual void OnClick(Point pt, int widget)