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

Function ReadGeneral

src/openrct2/config/Config.cpp:179–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177#pragma endregion
178
179 static void ReadGeneral(IIniReader* reader)
180 {
181 if (reader->ReadSection("general"))
182 {
183 auto model = &_config.general;
184 model->alwaysShowGridlines = reader->GetBoolean("always_show_gridlines", false);
185 model->autosaveFrequency = reader->GetInt32("autosave", AUTOSAVE_EVERY_5MINUTES);
186 model->autosaveAmount = reader->GetInt32("autosave_amount", kDefaultNumAutosavesToKeep);
187 model->confirmationPrompt = reader->GetBoolean("confirmation_prompt", false);
188 model->currencyFormat = reader->GetEnum<CurrencyType>(
189 "currency_format", Platform::GetLocaleCurrency(), Enum_Currency);
190 model->customCurrencyRate = reader->GetInt32("custom_currency_rate", 10);
191 model->customCurrencyAffix = reader->GetEnum<CurrencyAffix>(
192 "custom_currency_affix", CurrencyAffix::suffix, Enum_CurrencySymbolAffix);
193 model->customCurrencySymbol = reader->GetString("custom_currency_symbol", "Ctm");
194 model->edgeScrolling = reader->GetBoolean("edge_scrolling", true);
195 model->edgeScrollingSpeed = reader->GetInt32("edge_scrolling_speed", 12);
196 model->fullscreenMode = reader->GetInt32("fullscreen_mode", 0);
197 model->fullscreenHeight = reader->GetInt32("fullscreen_height", -1);
198 model->fullscreenWidth = reader->GetInt32("fullscreen_width", -1);
199 model->rct1Path = reader->GetString("rct1_path", "");
200 model->rct2Path = reader->GetString("game_path", "");
201 model->landscapeSmoothing = reader->GetBoolean("landscape_smoothing", true);
202 model->language = reader->GetEnum<int32_t>("language", Platform::GetLocaleLanguage(), Enum_LanguageEnum);
203 model->measurementFormat = reader->GetEnum<MeasurementFormat>(
204 "measurement_format", Platform::GetLocaleMeasurementFormat(), Enum_MeasurementFormat);
205 model->playIntro = reader->GetBoolean("play_intro", false);
206 model->savePluginData = reader->GetBoolean("save_plugin_data", true);
207 model->debuggingTools = reader->GetBoolean("debugging_tools", false);
208 model->showHeightAsUnits = reader->GetBoolean("show_height_as_units", false);
209 model->temperatureFormat = reader->GetEnum<TemperatureUnit>(
210 "temperature_format", Platform::GetLocaleTemperatureFormat(), Enum_Temperature);
211 model->windowHeight = reader->GetInt32("window_height", -1);
212 model->windowSnapProximity = reader->GetInt32("window_snap_proximity", 5);
213 model->windowWidth = reader->GetInt32("window_width", -1);
214 model->defaultDisplay = reader->GetInt32("default_display", 0);
215 model->drawingEngine = reader->GetEnum<DrawingEngine>(
216 "drawing_engine", DrawingEngine::SoftwareWithHardwareDisplay, Enum_DrawingEngine);
217 model->uncapFPS = reader->GetBoolean("uncap_fps", false);
218 model->useVSync = reader->GetBoolean("use_vsync", true);
219 model->virtualFloorStyle = reader->GetEnum<VirtualFloorStyles>(
220 "virtual_floor_style", VirtualFloorStyles::glassy, Enum_VirtualFloorStyle);
221 model->dateFormat = reader->GetEnum<int32_t>("date_format", Platform::GetLocaleDateFormat(), Enum_DateFormat);
222 model->autoStaffPlacement = reader->GetBoolean("auto_staff", true);
223 model->handymenMowByDefault = reader->GetBoolean("handymen_mow_default", false);
224 model->defaultInspectionInterval = reader->GetEnum<RideInspection>(
225 "default_inspection_interval", RideInspection::every30Minutes, Enum_RideInspectionInterval);
226 model->lastRunVersion = reader->GetString("last_run_version", "");
227 model->invertViewportDrag = reader->GetBoolean("invert_viewport_drag", false);
228 model->loadSaveSort = reader->GetEnum<FileBrowserSort>(
229 "load_save_sort", FileBrowserSort::nameAscending, Enum_FileBrowserSort);
230 model->minimizeFullscreenFocusLoss = reader->GetBoolean("minimize_fullscreen_focus_loss", true);
231 model->disableScreensaver = reader->GetBoolean("disable_screensaver", true);
232
233 // Default config setting is false until the games canvas can be separated from the effect
234 model->dayNightCycle = reader->GetBoolean("day_night_cycle", false);
235 const bool supportsLightFx = model->drawingEngine == DrawingEngine::SoftwareWithHardwareDisplay;
236 model->enableLightFx = supportsLightFx && reader->GetBoolean("enable_light_fx", false);

Callers 2

SetDefaultsFunction · 0.85
ReadFileFunction · 0.85

Calls 12

GetLocaleCurrencyFunction · 0.50
GetLocaleLanguageFunction · 0.50
GetLocaleDateFormatFunction · 0.50
GetDefaultScaleFunction · 0.50
ReadSectionMethod · 0.45
GetBooleanMethod · 0.45
GetInt32Method · 0.45
GetStringMethod · 0.45
GetFloatMethod · 0.45
GetInt64Method · 0.45

Tested by

no test coverage detected