diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 5153cb83cb..956511edfb 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -217,7 +217,7 @@ namespace Config model->LastSaveScenarioDirectory = reader->GetString("last_scenario_directory", ""); model->LastSaveTrackDirectory = reader->GetString("last_track_directory", ""); model->UseNativeBrowseDialog = reader->GetBoolean("use_native_browse_dialog", false); - model->WindowLimit = reader->GetInt32("window_limit", WINDOW_LIMIT_MAX); + model->WindowLimit = reader->GetInt32("window_limit", kWindowLimitMax); model->ZoomToCursor = reader->GetBoolean("zoom_to_cursor", true); model->RenderWeatherEffects = reader->GetBoolean("render_weather_effects", true); model->RenderWeatherGloom = reader->GetBoolean("render_weather_gloom", true); diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 9681dcd081..0366976024 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -114,7 +114,7 @@ struct InteractionInfo ViewportInteractionItem SpriteType = ViewportInteractionItem::None; }; -constexpr int32_t kMaxViewportCount = WINDOW_LIMIT_MAX; +constexpr int32_t kMaxViewportCount = kWindowLimitMax; /** * A reference counter for whether something is forcing the grid lines to show. When the counter diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index b01b5a1bf0..8718d33891 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -194,7 +194,7 @@ static void WindowCloseSurplus(int32_t cap, WindowClass avoid_classification) void WindowSetWindowLimit(int32_t value) { int32_t prev = gConfigGeneral.WindowLimit; - int32_t val = std::clamp(value, kWindowLimitMin, WINDOW_LIMIT_MAX); + int32_t val = std::clamp(value, kWindowLimitMin, kWindowLimitMax); gConfigGeneral.WindowLimit = val; ConfigSaveDefault(); // Checks if value decreases and then closes surplus diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 1e3b50c76f..bf023a396e 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -483,7 +483,7 @@ using modal_callback = void (*)(int32_t result); using close_callback = void (*)(); constexpr int8_t kWindowLimitMin = 4; -#define WINDOW_LIMIT_MAX 64 +constexpr int8_t kWindowLimitMax = 64; #define WINDOW_LIMIT_RESERVED 4 // Used to reserve room for the main viewport, toolbars, etc. extern WindowBase* gWindowAudioExclusive;