summaryrefslogtreecommitdiff
path: root/src/misc_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/misc_gui.cpp
parent59fe4f28c8f0bf47e7af40095dc6fba145188930 (diff)
downloadopenttd-806e7d25dddcc8b0e9c3f372ed956c63c6508381.tar.xz
Change: Use GUITimer class instead of bare int/uints.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 31faae2d4..149ebe717 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -26,6 +26,7 @@
#include "core/geometry_func.hpp"
#include "newgrf_debug.h"
#include "zoom_func.h"
+#include "guitimer_func.h"
#include "widgets/misc_widget.h"
@@ -458,13 +459,14 @@ struct AboutWindow : public Window {
static const int num_visible_lines = 19; ///< The number of lines visible simultaneously
static const uint TIMER_INTERVAL = 150; ///< Scrolling interval in ms
- uint timer;
+ GUITimer timer;
AboutWindow() : Window(&_about_desc)
{
this->InitNested(WN_GAME_OPTIONS_ABOUT);
this->text_position = this->GetWidget<NWidgetBase>(WID_A_SCROLLING_TEXT)->pos_y + this->GetWidget<NWidgetBase>(WID_A_SCROLLING_TEXT)->current_y;
+ this->timer.SetInterval(TIMER_INTERVAL);
}
virtual void SetStringParameters(int widget) const
@@ -505,7 +507,7 @@ struct AboutWindow : public Window {
virtual void OnRealtimeTick(uint delta_ms)
{
- uint count = CountIntervalElapsed(this->timer, delta_ms, TIMER_INTERVAL);
+ uint count = this->timer.CountElapsed(delta_ms);
if (count > 0) {
this->text_position -= count;
/* If the last text has scrolled start a new from the start */