From 6fd83fd00684c0ba6c3db7d4a97ed0d0ef01b136 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 9 May 2020 17:05:01 +0200 Subject: [PATCH] Make WW and WH static --- src/openrct2-ui/windows/About.cpp | 4 ++-- src/openrct2-ui/windows/Banner.cpp | 4 ++-- src/openrct2-ui/windows/Changelog.cpp | 4 ++-- src/openrct2-ui/windows/Cheats.cpp | 4 ++-- src/openrct2-ui/windows/DemolishRidePrompt.cpp | 4 ++-- src/openrct2-ui/windows/EditorInventionsList.cpp | 4 ++-- src/openrct2-ui/windows/InstallTrack.cpp | 6 +++--- src/openrct2-ui/windows/LoadSave.cpp | 4 ++-- src/openrct2-ui/windows/MapGen.cpp | 4 ++-- src/openrct2-ui/windows/Network.cpp | 4 ++-- src/openrct2-ui/windows/NewRide.cpp | 4 ++-- src/openrct2-ui/windows/ObjectLoadError.cpp | 6 +++--- src/openrct2-ui/windows/Options.cpp | 4 ++-- src/openrct2-ui/windows/ServerStart.cpp | 4 ++-- src/openrct2-ui/windows/ShortcutKeyChange.cpp | 4 ++-- src/openrct2-ui/windows/ShortcutKeys.cpp | 8 ++++---- src/openrct2-ui/windows/Sign.cpp | 4 ++-- src/openrct2-ui/windows/Staff.cpp | 4 ++-- src/openrct2-ui/windows/StaffFirePrompt.cpp | 4 ++-- src/openrct2-ui/windows/StaffList.cpp | 4 ++-- src/openrct2-ui/windows/TextInput.cpp | 4 ++-- src/openrct2-ui/windows/TileInspector.cpp | 4 ++-- src/openrct2-ui/windows/TitleCommandEditor.cpp | 6 +++--- src/openrct2-ui/windows/TitleEditor.cpp | 6 +++--- src/openrct2-ui/windows/TitleLogo.cpp | 4 ++-- src/openrct2-ui/windows/ViewClipping.cpp | 4 ++-- 26 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index 89452d650f..a0ffa89d14 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -16,8 +16,8 @@ #include #include -constexpr int32_t WW = 400; -constexpr int32_t WH = 350; +static constexpr const int32_t WW = 400; +static constexpr const int32_t WH = 350; static constexpr const rct_string_id WINDOW_TITLE = STR_ABOUT; constexpr int32_t TABHEIGHT = 50; diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index ba9c993e15..6b1d9a0418 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -22,8 +22,8 @@ #include #include -constexpr int32_t WW = 113; -constexpr int32_t WH = 96; +static constexpr const int32_t WW = 113; +static constexpr const int32_t WH = 96; static constexpr const rct_string_id WINDOW_TITLE = STR_BANNER_WINDOW_TITLE; // clang-format off diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 3eeefbf38c..f755082a5d 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -32,8 +32,8 @@ enum { WIDX_SCROLL }; -constexpr int32_t WW = 500; -constexpr int32_t WH = 400; +static constexpr const int32_t WW = 500; +static constexpr const int32_t WH = 400; static constexpr const rct_string_id WINDOW_TITLE = STR_CHANGELOG_TITLE; constexpr int32_t MIN_WW = 300; constexpr int32_t MIN_WH = 200; diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 2733479cd1..6a7a251e50 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -177,8 +177,8 @@ enum WINDOW_CHEATS_WIDGET_IDX #pragma region MEASUREMENTS static constexpr const rct_string_id WINDOW_TITLE = STR_CHEAT_TITLE; -constexpr int32_t WW = 249; -constexpr int32_t WH = 300; +static constexpr const int32_t WW = 249; +static constexpr const int32_t WH = 300; constexpr int32_t TAB_HEIGHT = 43; constexpr int32_t XSPA = 5; // X spacing constexpr int32_t YSPA = 5; // Y spacing diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 38104ec07e..9715a0977c 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -16,8 +16,8 @@ #include #include -constexpr int32_t WW = 200; -constexpr int32_t WH = 100; +static constexpr const int32_t WW = 200; +static constexpr const int32_t WH = 100; static constexpr const rct_string_id WINDOW_TITLE = STR_DEMOLISH_RIDE; static money32 _demolishRideCost; diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 85ca09a582..55a31b0a6c 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -26,8 +26,8 @@ #pragma region Widgets -constexpr int32_t WW = 600; -constexpr int32_t WH = 400; +static constexpr const int32_t WW = 600; +static constexpr const int32_t WH = 400; static constexpr const rct_string_id WINDOW_TITLE = STR_INVENTION_LIST; // clang-format off diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 4d8f1ccd7c..a67467437f 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -35,9 +35,9 @@ enum { }; static constexpr const rct_string_id WINDOW_TITLE = STR_TRACK_DESIGN_INSTALL_WINDOW_TITLE; -constexpr int32_t WW = 380; -constexpr int32_t WH = 448; -constexpr int32_t WW_LESS_PADDING = WW - 4; +static constexpr const int32_t WW = 380; +static constexpr const int32_t WH = 448; +static constexpr const int32_t WW_LESS_PADDING = WW - 4; constexpr int32_t PREVIEW_BUTTONS_LEFT = WW - 25; constexpr int32_t ACTION_BUTTONS_LEFT = WW - 100; diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 982b4e550b..0f4c3f660e 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -39,8 +39,8 @@ #pragma region Widgets static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; -constexpr int32_t WW = 350; -constexpr int32_t WH = 400; +static constexpr const int32_t WW = 350; +static constexpr const int32_t WH = 400; // clang-format off enum diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 23c5441881..94f8b25ba7 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -111,8 +111,8 @@ enum { #pragma region Widgets static constexpr const rct_string_id WINDOW_TITLE = STR_MAPGEN_WINDOW_TITLE; -constexpr int32_t WW = 250; -constexpr int32_t WH = 273; +static constexpr const int32_t WW = 250; +static constexpr const int32_t WH = 273; #define SHARED_WIDGETS \ WINDOW_SHIM(WINDOW_TITLE, WW, WH), /* WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE */ \ diff --git a/src/openrct2-ui/windows/Network.cpp b/src/openrct2-ui/windows/Network.cpp index 8dd4f7a557..debcbae030 100644 --- a/src/openrct2-ui/windows/Network.cpp +++ b/src/openrct2-ui/windows/Network.cpp @@ -26,8 +26,8 @@ enum { WINDOW_NETWORK_PAGE_INFORMATION, }; -constexpr int32_t WW = 450; -constexpr int32_t WH = 210; +static constexpr const int32_t WW = 450; +static constexpr const int32_t WH = 210; enum WINDOW_NETWORK_WIDGET_IDX { WIDX_BACKGROUND, diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 1c11c8ee25..31a62a491c 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -36,8 +36,8 @@ static constexpr const rct_string_id WINDOW_TITLE = STR_NONE; constexpr size_t AVAILABILITY_STRING_SIZE = 256; -constexpr int32_t WH = 382; -constexpr int32_t WW = 601; +static constexpr const int32_t WH = 382; +static constexpr const int32_t WW = 601; static uint8_t _windowNewRideCurrentTab; static RideSelection _windowNewRideHighlightedItem[6]; diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index e17c9292c5..189f2c602f 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -260,9 +260,9 @@ enum WINDOW_OBJECT_LOAD_ERROR_WIDGET_IDX { WIDX_DOWNLOAD_ALL }; -constexpr int32_t WW = 450; -constexpr int32_t WH = 400; -constexpr int32_t WW_LESS_PADDING = WW - 5; +static constexpr const int32_t WW = 450; +static constexpr const int32_t WH = 400; +static constexpr const int32_t WW_LESS_PADDING = WW - 5; constexpr int32_t NAME_COL_LEFT = 4; constexpr int32_t SOURCE_COL_LEFT = (WW_LESS_PADDING / 4) + 1; constexpr int32_t TYPE_COL_LEFT = 5 * WW_LESS_PADDING / 8 + 1; diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index b9f8e43dea..d61c7512c8 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -201,8 +201,8 @@ enum WINDOW_OPTIONS_WIDGET_IDX { }; static constexpr const rct_string_id WINDOW_TITLE = STR_OPTIONS_TITLE; -constexpr int32_t WW = 310; -constexpr int32_t WH = 332; +static constexpr const int32_t WW = 310; +static constexpr const int32_t WH = 332; #ifndef DISABLE_TWITCH #define TWITCH_TAB_SPRITE IMAGE_TYPE_REMAP | SPR_TAB diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index 70d61fbe0d..4b78caa9a1 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -46,8 +46,8 @@ enum { WIDX_LOAD_SERVER }; -constexpr int32_t WW = 300; -constexpr int32_t WH = 154; +static constexpr const int32_t WW = 300; +static constexpr const int32_t WH = 154; static rct_widget window_server_start_widgets[] = { { WWT_FRAME, 0, 0, WW-1, 0, WH-1, STR_NONE, STR_NONE }, // panel / background diff --git a/src/openrct2-ui/windows/ShortcutKeyChange.cpp b/src/openrct2-ui/windows/ShortcutKeyChange.cpp index ca9072933a..fcec0864b0 100644 --- a/src/openrct2-ui/windows/ShortcutKeyChange.cpp +++ b/src/openrct2-ui/windows/ShortcutKeyChange.cpp @@ -16,8 +16,8 @@ #include static constexpr const rct_string_id WINDOW_TITLE = STR_SHORTCUT_CHANGE_TITLE; -constexpr int32_t WW = 250; -constexpr int32_t WH = 60; +static constexpr const int32_t WW = 250; +static constexpr const int32_t WH = 60; // clang-format off enum WINDOW_SHORTCUT_CHANGE_WIDGET_IDX { diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index cfe2fce7e0..a8d31d598e 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -16,11 +16,11 @@ #include static constexpr const rct_string_id WINDOW_TITLE = STR_SHORTCUTS_TITLE; -constexpr int32_t WW = 420; -constexpr int32_t WH = 280; +static constexpr const int32_t WW = 420; +static constexpr const int32_t WH = 280; -constexpr int32_t WW_SC_MAX = 1200; -constexpr int32_t WH_SC_MAX = 800; +static constexpr const int32_t WW_SC_MAX = 1200; +static constexpr const int32_t WH_SC_MAX = 800; // clang-format off enum WINDOW_SHORTCUT_WIDGET_IDX { diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 714dcc065c..64d92db9a0 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -26,8 +26,8 @@ #include static constexpr const rct_string_id WINDOW_TITLE = STR_SIGN; -constexpr int32_t WW = 113; -constexpr int32_t WH = 96; +static constexpr const int32_t WW = 113; +static constexpr const int32_t WH = 96; // clang-format off enum WINDOW_SIGN_WIDGET_IDX { diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 57d53d69cb..330f452c97 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -32,8 +32,8 @@ #include static constexpr const rct_string_id WINDOW_TITLE = STR_STRINGID; -constexpr int32_t WW = 190; -constexpr int32_t WH = 180; +static constexpr const int32_t WW = 190; +static constexpr const int32_t WH = 180; // clang-format off enum WINDOW_STAFF_PAGE { diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index 831110ed0b..7b7c984ba4 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -17,8 +17,8 @@ #include static constexpr const rct_string_id WINDOW_TITLE = STR_SACK_STAFF; -constexpr int32_t WW = 200; -constexpr int32_t WH = 100; +static constexpr const int32_t WW = 200; +static constexpr const int32_t WH = 100; // clang-format off enum WINDOW_STAFF_FIRE_WIDGET_IDX { diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 6ab127a0e8..868efe9725 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -105,8 +105,8 @@ enum WINDOW_STAFF_LIST_WIDGET_IDX { }; static constexpr const rct_string_id WINDOW_TITLE = STR_STAFF; -constexpr int32_t WW = 320; -constexpr int32_t WH = 270; +static constexpr const int32_t WW = 320; +static constexpr const int32_t WH = 270; constexpr int32_t MAX_WW = 500; constexpr int32_t MAX_WH = 450; diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 38c95a1ceb..368731d4d7 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -26,8 +26,8 @@ #include static constexpr const rct_string_id WINDOW_TITLE = STR_OPTIONS; -constexpr int32_t WW = 250; -constexpr int32_t WH = 90; +static constexpr const int32_t WW = 250; +static constexpr const int32_t WH = 90; // clang-format off enum WINDOW_TEXT_INPUT_WIDGET_IDX { diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 95855a3e73..236a21cb47 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -206,8 +206,8 @@ enum WINDOW_TILE_INSPECTOR_WIDGET_IDX { static constexpr const rct_string_id WINDOW_TITLE = STR_TILE_INSPECTOR_TITLE; // Window sizes -constexpr int32_t WW = 400; -constexpr int32_t WH = 170; +static constexpr const int32_t WW = 400; +static constexpr const int32_t WH = 170; constexpr int32_t MIN_WW = WW; constexpr int32_t MAX_WW = WW; constexpr int32_t MIN_WH = 130; diff --git a/src/openrct2-ui/windows/TitleCommandEditor.cpp b/src/openrct2-ui/windows/TitleCommandEditor.cpp index bde43a4230..25f9c6329a 100644 --- a/src/openrct2-ui/windows/TitleCommandEditor.cpp +++ b/src/openrct2-ui/windows/TitleCommandEditor.cpp @@ -69,12 +69,12 @@ enum WINDOW_WATER_WIDGET_IDX { WIDX_CANCEL }; -constexpr int32_t WW = 200; -constexpr int32_t WH = 120; +static constexpr const int32_t WW = 200; +static constexpr const int32_t WH = 120; constexpr int32_t BY = 32; constexpr int32_t BY2 = 70; constexpr int32_t WS = 16; -constexpr int32_t WHA = (WW-WS*2)/2; +static constexpr const int32_t WHA = (WW-WS*2)/2; static bool _window_title_command_editor_insert; static int32_t _window_title_command_editor_index; diff --git a/src/openrct2-ui/windows/TitleEditor.cpp b/src/openrct2-ui/windows/TitleEditor.cpp index d328f13e57..582be06d7c 100644 --- a/src/openrct2-ui/windows/TitleEditor.cpp +++ b/src/openrct2-ui/windows/TitleEditor.cpp @@ -135,15 +135,15 @@ enum WINDOW_TITLE_EDITOR_WIDGET_IDX { // Increase BW if certain languages do not fit // BW should be a multiple of 4 -constexpr int32_t WW = 320; -constexpr int32_t WH = 270; +static constexpr const int32_t WW = 320; +static constexpr const int32_t WH = 270; constexpr int32_t BX = 8; constexpr int32_t BW = 72; constexpr int32_t BY = 52; constexpr int32_t BH = 63; constexpr int32_t BS = 18; constexpr int32_t SCROLL_WIDTH = 350; -constexpr int32_t WH2 = 127; +static constexpr const int32_t WH2 = 127; static rct_widget window_title_editor_widgets[] = { { WWT_FRAME, 0, 0, WW-1, 0, WH2-1, 0xFFFFFFFF, STR_NONE }, // panel / background diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index e6a88f4c3e..0cd4e069d1 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -14,8 +14,8 @@ #include #include -constexpr int32_t WW = 232; -constexpr int32_t WH = 136; +static constexpr const int32_t WW = 232; +static constexpr const int32_t WH = 136; enum { diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 19894a10c6..459e3171ec 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -45,8 +45,8 @@ static DISPLAY_TYPE gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS; #pragma region Widgets -constexpr int32_t WW = 180; -constexpr int32_t WH = 155; +static constexpr const int32_t WW = 180; +static constexpr const int32_t WH = 155; static rct_widget window_view_clipping_widgets[] = { { WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, STR_NONE, STR_NONE }, // panel / background