1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-20 06:12:57 +01:00

Introduce Config namespace and struct

This commit is contained in:
Aaron van Geffen
2024-05-10 12:10:21 +02:00
parent 9e206d5528
commit a63d86c488
101 changed files with 1162 additions and 1108 deletions

View File

@@ -224,7 +224,7 @@ WindowBase* WindowCreate(
// Check if there are any window slots left
// include kWindowLimitReserved for items such as the main viewport and toolbars to not appear to be counted.
if (g_window_list.size() >= static_cast<size_t>(gConfigGeneral.WindowLimit + kWindowLimitReserved))
if (g_window_list.size() >= static_cast<size_t>(Config::Get().general.WindowLimit + kWindowLimitReserved))
{
// Close least recently used window
for (auto& w : g_window_list)
@@ -570,7 +570,7 @@ void WindowAllWheelInput()
void ApplyScreenSaverLockSetting()
{
gConfigGeneral.DisableScreensaver ? SDL_DisableScreenSaver() : SDL_EnableScreenSaver();
Config::Get().general.DisableScreensaver ? SDL_DisableScreenSaver() : SDL_EnableScreenSaver();
}
/**
@@ -828,7 +828,7 @@ void WindowAlignTabs(WindowBase* w, WidgetIndex start_tab_id, WidgetIndex end_ta
ScreenCoordsXY WindowGetViewportSoundIconPos(WindowBase& w)
{
const uint8_t buttonOffset = (gConfigInterface.WindowButtonsOnTheLeft) ? CloseButtonWidth + 2 : 0;
const uint8_t buttonOffset = (Config::Get().interface.WindowButtonsOnTheLeft) ? CloseButtonWidth + 2 : 0;
return w.windowPos + ScreenCoordsXY{ 2 + buttonOffset, 2 };
}