MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / GetNumVisibleLines

Method GetNumVisibleLines

src/openrct2-ui/interface/InGameConsole.cpp:410–418  ·  view source on GitHub ↗

Calculates the amount of visible lines, based on the console size, excluding the input line.

Source from the content-addressed store, hash-verified

408
409// Calculates the amount of visible lines, based on the console size, excluding the input line.
410int32_t InGameConsole::GetNumVisibleLines() const
411{
412 const int32_t lineHeight = InGameConsoleGetLineHeight();
413 const int32_t consoleHeight = _consoleBottomRight.y - _consoleTopLeft.y;
414 if (consoleHeight == 0)
415 return 0;
416 const int32_t drawableHeight = consoleHeight - 2 * lineHeight - 4; // input line, separator - padding
417 return drawableHeight / lineHeight;
418}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected