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

Function GetCurrentResolutionIndex

src/settings_gui.cpp:91–95  ·  view source on GitHub ↗

* Get index of the current screen resolution. * @return Index of the current screen resolution if it is a known resolution, _resolutions.size() otherwise. */

Source from the content-addressed store, hash-verified

89 * @return Index of the current screen resolution if it is a known resolution, _resolutions.size() otherwise.
90 */
91static uint GetCurrentResolutionIndex()
92{
93 auto it = std::ranges::find(_resolutions, Dimension(_screen.width, _screen.height));
94 return std::distance(_resolutions.begin(), it);
95}
96
97static void ShowCustCurrency();
98

Callers 2

BuildDropDownListMethod · 0.85
GetWidgetStringMethod · 0.85

Calls 3

DimensionClass · 0.85
findFunction · 0.50
beginMethod · 0.45

Tested by

no test coverage detected