OpenTTD Source: GUITimer Class Reference

OpenTTD Source 13.2.1

Public Member Functions | Protected Attributes
GUITimer Class Reference

## Public Member Functions
| GUITimer (uint interval)
bool | HasElapsed () const
void | SetInterval (uint interval)
uint | CountElapsed (uint delta)
| Count how many times the interval has elapsed. More...
bool | Elapsed (uint delta)
| Test if a timer has elapsed. More...

## Protected Attributes
uint | timer
uint | interval

## Detailed Description

Definition at line 13 of file guitimer_func.h.

## Member Function Documentation

## ◆ CountElapsed()

uint GUITimer::CountElapsed | ( | uint | delta | ) |
| inline

Count how many times the interval has elapsed.

Use to ensure a specific amount of events happen within a timeframe, e.g. for animation.

Parameters

  delta | Time since last test.

Returns
  Number of times the interval has elapsed.

Definition at line 40 of file guitimer_func.h.

Referenced by Elapsed(), IConsoleWindow::OnRealtimeTick(), StatusBarWindow::OnRealtimeTick(), ErrmsgWindow::OnRealtimeTick(), AboutWindow::OnRealtimeTick(), and NewsWindow::OnRealtimeTick().

## ◆ Elapsed()

bool GUITimer::Elapsed | ( | uint | delta | ) |
| inline

Test if a timer has elapsed.

Use to ensure an event happens only once within a timeframe, e.g. for window updates.

Parameters

  delta | Time since last test.

Returns
  True iff the timer has elapsed.

Definition at line 55 of file guitimer_func.h.

References CountElapsed().

Referenced by SmallMapWindow::OnRealtimeTick(), StatusBarWindow::OnRealtimeTick(), MainWindow::OnRealtimeTick(), DropdownWindow::OnRealtimeTick(), GSConfigWindow::OnRealtimeTick(), FramerateWindow::OnRealtimeTick(), NewGRFParametersWindow::OnRealtimeTick(), AISettingsWindow::OnRealtimeTick(), FrametimeGraphWindow::OnRealtimeTick(), NetworkGameWindow::OnRealtimeTick(), MainToolbarWindow::OnRealtimeTick(), ScenarioEditorToolbarWindow::OnRealtimeTick(), and UpdateWindows().

The documentation for this class was generated from the following file:

- src/guitimer_func.h