summaryrefslogtreecommitdiff
path: root/src/window_func.h
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/window_func.h
parent59fe4f28c8f0bf47e7af40095dc6fba145188930 (diff)
downloadopenttd-806e7d25dddcc8b0e9c3f372ed956c63c6508381.tar.xz
Change: Use GUITimer class instead of bare int/uints.
Diffstat (limited to 'src/window_func.h')
-rw-r--r--src/window_func.h32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/window_func.h b/src/window_func.h
index f2ae638fe..453b88978 100644
--- a/src/window_func.h
+++ b/src/window_func.h
@@ -56,36 +56,4 @@ void DeleteWindowByClass(WindowClass cls);
bool EditBoxInGlobalFocus();
Point GetCaretPosition();
-/**
- * Count how many times the interval has elapsed, and update the timer.
- * Use to ensure a specific amount of events happen within a timeframe, e.g. for animation.
- * The timer value does not need to be initialised.
- * @param timer Timer to test. Value will be increased.
- * @param delta Time since last test.
- * @param interval Timing interval.
- * @return Number of times the interval has elapsed.
- */
-static inline uint CountIntervalElapsed(uint &timer, uint delta, uint interval)
-{
- uint count = delta / interval;
- if (timer + (delta % interval) >= interval) count++;
- timer = (timer + delta) % interval;
- return count;
-}
-
-/**
- * Test if a timer has elapsed, and update the timer.
- * Use to ensure an event happens only once within a timeframe, e.g. for window updates.
- * The timer value must be initialised in order for the timer to elapsed.
- * @param timer Timer to test. Value will be decreased.
- * @param delta Time since last test.
- * @return True iff the timer has elapsed.
- */
-static inline bool TimerElapsed(int &timer, uint delta)
-{
- if (timer <= 0) return false;
- timer -= delta;
- return timer <= 0;
-}
-
#endif /* WINDOW_FUNC_H */