summaryrefslogtreecommitdiff
path: root/src/smallmap_gui.h
diff options
context:
space:
mode:
authorPeter Nelson <peter1138@openttd.org>2018-05-04 21:29:22 +0100
committerPeterN <peter@fuzzle.org>2019-01-11 11:56:21 +0000
commit2a8fa5fef9021bff67a13899832bf6f0a18e6ea1 (patch)
treec712f1973d6c74938e968f752a069b499dde7266 /src/smallmap_gui.h
parent916e911806083a2fe06a79f6f10e275015079149 (diff)
downloadopenttd-2a8fa5fef9021bff67a13899832bf6f0a18e6ea1.tar.xz
Change: Split up Window::OnTick into OnGameTick and OnRealtimeTick. Adjust timers to work with milliseconds instead of ticks.
Diffstat (limited to 'src/smallmap_gui.h')
-rw-r--r--src/smallmap_gui.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/smallmap_gui.h b/src/smallmap_gui.h
index c3151b1a7..60b39b7a3 100644
--- a/src/smallmap_gui.h
+++ b/src/smallmap_gui.h
@@ -67,8 +67,8 @@ protected:
static const uint LEGEND_BLOB_WIDTH = 8; ///< Width of the coloured blob in front of a line text in the #WID_SM_LEGEND widget.
static const uint INDUSTRY_MIN_NUMBER_OF_COLUMNS = 2; ///< Minimal number of columns in the #WID_SM_LEGEND widget for the #SMT_INDUSTRY legend.
- static const uint FORCE_REFRESH_PERIOD = 0x1F; ///< map is redrawn after that many ticks
- static const uint BLINK_PERIOD = 0x0F; ///< highlight blinking interval
+ static const uint FORCE_REFRESH_PERIOD = 930; ///< map is redrawn after that many milliseconds.
+ static const uint BLINK_PERIOD = 450; ///< highlight blinking interval in milliseconds.
uint min_number_of_columns; ///< Minimal number of columns in legends.
uint min_number_of_fixed_rows; ///< Minimal number of rows in the legends for the fixed layouts only (all except #SMT_INDUSTRY).
@@ -79,7 +79,7 @@ protected:
int32 subscroll; ///< Number of pixels (0..3) between the right end of the base tile and the pixel at the top-left corner of the smallmap display.
int zoom; ///< Zoom level. Bigger number means more zoom-out (further away).
- uint8 refresh; ///< Refresh counter, zeroed every FORCE_REFRESH_PERIOD ticks.
+ int refresh; ///< Refresh timer, in millseconds.
LinkGraphOverlay *overlay;
static void BreakIndustryChainLink();
@@ -187,7 +187,7 @@ public:
virtual void OnInvalidateData(int data = 0, bool gui_scope = true);
virtual bool OnRightClick(Point pt, int widget);
virtual void OnMouseWheel(int wheel);
- virtual void OnTick();
+ virtual void OnRealtimeTick(uint delta_ms);
virtual void OnScroll(Point delta);
virtual void OnMouseOver(Point pt, int widget);
};