MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / FramerateWindow

Method FramerateWindow

src/framerate_gui.cpp:449–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447 static constexpr int MIN_ELEMENTS = 5; ///< smallest number of elements to display
448
449 FramerateWindow(WindowDesc &desc, WindowNumber number) : Window(desc)
450 {
451 this->InitNested(number);
452 this->UpdateData();
453 this->num_displayed = this->num_active;
454
455 /* Window is always initialised to MIN_ELEMENTS height, resize to contain num_displayed */
456 ResizeWindow(this, 0, (std::max(MIN_ELEMENTS, this->num_displayed) - MIN_ELEMENTS) * GetCharacterHeight(FS_NORMAL));
457 }
458
459 /** Update the window on a regular interval. */
460 const IntervalTimer<TimerWindow> update_interval = {std::chrono::milliseconds(100), [this](auto) {

Callers

nothing calls this directly

Calls 4

UpdateDataMethod · 0.95
ResizeWindowFunction · 0.85
GetCharacterHeightFunction · 0.85
InitNestedMethod · 0.80

Tested by

no test coverage detected