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

Function AddCustomRefreshRates

src/settings_gui.cpp:164–172  ·  view source on GitHub ↗

* Add the refresh rate from the config and the refresh rates from all the monitors to * our list of refresh rates shown in the GUI. */

Source from the content-addressed store, hash-verified

162 * our list of refresh rates shown in the GUI.
163 */
164static void AddCustomRefreshRates()
165{
166 /* Add the refresh rate as selected in the config. */
167 _refresh_rates.insert(_settings_client.gui.refresh_rate);
168
169 /* Add all the refresh rates of all monitors connected to the machine. */
170 std::vector<int> monitor_rates = VideoDriver::GetInstance()->GetListOfMonitorRefreshRates();
171 std::copy(monitor_rates.begin(), monitor_rates.end(), std::inserter(_refresh_rates, _refresh_rates.end()));
172}
173
174static const int SCALE_NMARKS = (MAX_INTERFACE_SCALE - MIN_INTERFACE_SCALE) / 25 + 1; // Show marks at 25% increments
175static const int VOLUME_NMARKS = 9; // Show 5 values and 4 empty marks.

Callers 1

GameOptionsWindowMethod · 0.85

Calls 5

copyFunction · 0.85
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected