From 806e7d25dddcc8b0e9c3f372ed956c63c6508381 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 20 May 2018 09:58:36 +0100 Subject: Change: Use GUITimer class instead of bare int/uints. --- src/smallmap_gui.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/smallmap_gui.cpp') 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(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(); } -- cgit v1.2.3-54-g00ecf