diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index f80393b5bf..3ae2a9ed1f 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -224,8 +224,8 @@ WindowBase* WindowCreate( } // Check if there are any window slots left - // include WINDOW_LIMIT_RESERVED for items such as the main viewport and toolbars to not appear to be counted. - if (g_window_list.size() >= static_cast(gConfigGeneral.WindowLimit + WINDOW_LIMIT_RESERVED)) + // include kWindowLimitReserved for items such as the main viewport and toolbars to not appear to be counted. + if (g_window_list.size() >= static_cast(gConfigGeneral.WindowLimit + kWindowLimitReserved)) { // Close least recently used window for (auto& w : g_window_list) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 8718d33891..52cc76ef1b 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -164,7 +164,7 @@ static void WindowCloseSurplus(int32_t cap, WindowClass avoid_classification) // find the amount of windows that are currently open auto count = static_cast(g_window_list.size()); // difference between amount open and cap = amount to close - auto diff = count - WINDOW_LIMIT_RESERVED - cap; + auto diff = count - kWindowLimitReserved - cap; for (auto i = 0; i < diff; i++) { // iterates through the list until it finds the newest window, or a window that can be closed diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index bf023a396e..1e58689a92 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -484,7 +484,7 @@ using close_callback = void (*)(); constexpr int8_t kWindowLimitMin = 4; constexpr int8_t kWindowLimitMax = 64; -#define WINDOW_LIMIT_RESERVED 4 // Used to reserve room for the main viewport, toolbars, etc. +constexpr int8_t kWindowLimitReserved = 4; // Used to reserve room for the main viewport, toolbars, etc. extern WindowBase* gWindowAudioExclusive;