summaryrefslogtreecommitdiff
path: root/src/smallmap_gui.cpp
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2018-05-20 09:58:36 +0100
committerPeterN <peter@fuzzle.org>2019-01-11 11:56:21 +0000
commit806e7d25dddcc8b0e9c3f372ed956c63c6508381 (patch)
treed79d90933423d8cafef1420cd200bc506a138713 /src/smallmap_gui.cpp
parent59fe4f28c8f0bf47e7af40095dc6fba145188930 (diff)
downloadopenttd-806e7d25dddcc8b0e9c3f372ed956c63c6508381.tar.xz
Change: Use GUITimer class instead of bare int/uints.
Diffstat (limited to 'src/smallmap_gui.cpp')
-rw-r--r--src/smallmap_gui.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 447d25e4a..df9fd2df2 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -23,6 +23,7 @@
#include "sound_func.h"
#include "window_func.h"
#include "company_base.h"
+#include "guitimer_func.h"
#include "smallmap_gui.h"
@@ -1055,7 +1056,7 @@ void SmallMapWindow::SetupWidgetData()
this->GetWidget<NWidgetStacked>(WID_SM_SELECT_BUTTONS)->SetDisplayedPlane(plane);
}
-SmallMapWindow::SmallMapWindow(WindowDesc *desc, int window_number) : Window(desc), refresh(FORCE_REFRESH_PERIOD)
+SmallMapWindow::SmallMapWindow(WindowDesc *desc, int window_number) : Window(desc), refresh(GUITimer(FORCE_REFRESH_PERIOD))
{
_smallmap_industry_highlight = INVALID_INDUSTRYTYPE;
this->overlay = new LinkGraphOverlay(this, WID_SM_MAP, 0, this->GetOverlayCompanyMask(), 1);
@@ -1390,7 +1391,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
}
if (new_highlight != _smallmap_industry_highlight) {
_smallmap_industry_highlight = new_highlight;
- this->refresh = _smallmap_industry_highlight != INVALID_INDUSTRYTYPE ? BLINK_PERIOD : FORCE_REFRESH_PERIOD;
+ this->refresh.SetInterval(_smallmap_industry_highlight != INVALID_INDUSTRYTYPE ? BLINK_PERIOD : FORCE_REFRESH_PERIOD);
_smallmap_industry_highlight_state = true;
this->SetDirty();
}
@@ -1573,7 +1574,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
/* virtual */ void SmallMapWindow::OnRealtimeTick(uint delta_ms)
{
/* Update the window every now and then */
- if (!TimerElapsed(this->refresh, delta_ms)) return;
+ if (!this->refresh.Elapsed(delta_ms)) return;
if (this->map_type == SMT_LINKSTATS) {
uint32 company_mask = this->GetOverlayCompanyMask();
@@ -1585,7 +1586,7 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
}
_smallmap_industry_highlight_state = !_smallmap_industry_highlight_state;
- this->refresh = _smallmap_industry_highlight != INVALID_INDUSTRYTYPE ? BLINK_PERIOD : FORCE_REFRESH_PERIOD;
+ this->refresh.SetInterval(_smallmap_industry_highlight != INVALID_INDUSTRYTYPE ? BLINK_PERIOD : FORCE_REFRESH_PERIOD);
this->SetDirty();
}