summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-10-20 18:15:42 +0000
committersmatz <smatz@openttd.org>2009-10-20 18:15:42 +0000
commitcfbf57a54f7261ac3cc47d1af55cda419e2b4dbb (patch)
tree8e371e5d0d6456cc2d69d73bb48abf45e592121d /src
parentd4888b103ea4f59dfb315dd5e96a3c8f014c2c76 (diff)
downloadopenttd-cfbf57a54f7261ac3cc47d1af55cda419e2b4dbb.tar.xz
(svn r17821) -Codechange: make more mathods of SmallMapWindow private
Diffstat (limited to 'src')
-rw-r--r--src/smallmap_gui.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 535b72072..656cc76a3 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -545,8 +545,7 @@ static void DrawHorizMapIndicator(int x, int y, int x2, int y2)
GfxFillRect(x2 - 3, y, x2, y2, 69);
}
-class SmallMapWindow : public Window
-{
+class SmallMapWindow : public Window {
enum SmallMapType {
SMT_CONTOUR,
SMT_VEHICLES,
@@ -638,7 +637,6 @@ class SmallMapWindow : public Window
} while (xc++, yc++, dst = blitter->MoveTo(dst, pitch, 0), --reps != 0);
}
-public:
/**
* Draws the small map.
*
@@ -836,17 +834,6 @@ public:
_cur_dpi = old_dpi;
}
- void SmallMapCenterOnCurrentPos()
- {
- ViewPort *vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
-
- int x = ((vp->virtual_width - (this->widget[SM_WIDGET_MAP].right - this->widget[SM_WIDGET_MAP].left) * TILE_SIZE) / 2 + vp->virtual_left) / 4;
- int y = ((vp->virtual_height - (this->widget[SM_WIDGET_MAP].bottom - this->widget[SM_WIDGET_MAP].top ) * TILE_SIZE) / 2 + vp->virtual_top ) / 2 - TILE_SIZE * 2;
- this->scroll_x = (y - x) & ~0xF;
- this->scroll_y = (x + y) & ~0xF;
- this->SetDirty();
- }
-
void ResizeLegend()
{
Widget *legend = &this->widget[SM_WIDGET_LEGEND];
@@ -876,6 +863,7 @@ public:
}
}
+public:
SmallMapWindow(const WindowDesc *desc, int window_number) : Window(desc, window_number), refresh(FORCE_REFRESH_PERIOD)
{
this->LowerWidget(this->map_type + SM_WIDGET_CONTOUR);
@@ -1116,6 +1104,17 @@ public:
{
if (delta.x != 0 && this->map_type == SMT_INDUSTRY) this->ResizeLegend();
}
+
+ void SmallMapCenterOnCurrentPos()
+ {
+ ViewPort *vp = FindWindowById(WC_MAIN_WINDOW, 0)->viewport;
+
+ int x = ((vp->virtual_width - (this->widget[SM_WIDGET_MAP].right - this->widget[SM_WIDGET_MAP].left) * TILE_SIZE) / 2 + vp->virtual_left) / 4;
+ int y = ((vp->virtual_height - (this->widget[SM_WIDGET_MAP].bottom - this->widget[SM_WIDGET_MAP].top ) * TILE_SIZE) / 2 + vp->virtual_top ) / 2 - TILE_SIZE * 2;
+ this->scroll_x = (y - x) & ~0xF;
+ this->scroll_y = (x + y) & ~0xF;
+ this->SetDirty();
+ }
};
SmallMapWindow::SmallMapType SmallMapWindow::map_type = SMT_CONTOUR;