Merge pull request #10136 from tupaschoal/constexpr-for-openrct2ui-define

Use constexpr on openrct2-ui/*
This commit is contained in:
Duncan 2019-10-30 06:44:11 +00:00 committed by GitHub
commit 219046af14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 171 additions and 172 deletions

View File

@ -16,9 +16,9 @@
#include <openrct2/localisation/LocalisationService.h> #include <openrct2/localisation/LocalisationService.h>
#include <openrct2/sprites.h> #include <openrct2/sprites.h>
#define WW 400 constexpr int32_t WW = 400;
#define WH 350 constexpr int32_t WH = 350;
#define TABHEIGHT 50 constexpr int32_t TABHEIGHT = 50;
// clang-format off // clang-format off
enum enum

View File

@ -22,8 +22,8 @@
#include <openrct2/world/Banner.h> #include <openrct2/world/Banner.h>
#include <openrct2/world/Scenery.h> #include <openrct2/world/Scenery.h>
#define WW 113 constexpr int32_t WW = 113;
#define WH 96 constexpr int32_t WH = 96;
// clang-format off // clang-format off
enum WINDOW_BANNER_WIDGET_IDX { enum WINDOW_BANNER_WIDGET_IDX {

View File

@ -32,10 +32,10 @@ enum {
WIDX_SCROLL WIDX_SCROLL
}; };
#define WW 500 constexpr int32_t WW = 500;
#define WH 400 constexpr int32_t WH = 400;
#define MIN_WW 300 constexpr int32_t MIN_WW = 300;
#define MIN_WH 200 constexpr int32_t MIN_WH = 200;
static rct_widget window_changelog_widgets[] = { static rct_widget window_changelog_widgets[] = {
{ WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, 0xFFFFFFFF, STR_NONE }, // panel / background { WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, 0xFFFFFFFF, STR_NONE }, // panel / background

View File

@ -175,18 +175,18 @@ enum WINDOW_CHEATS_WIDGET_IDX
#pragma region MEASUREMENTS #pragma region MEASUREMENTS
#define WW 249 constexpr int32_t WW = 249;
#define WH 300 constexpr int32_t WH = 300;
#define TAB_HEIGHT 43 constexpr int32_t TAB_HEIGHT = 43;
#define XSPA 5 // X spacing constexpr int32_t XSPA = 5; // X spacing
#define YSPA 5 // Y spacing constexpr int32_t YSPA = 5; // Y spacing
#define XOS 6 + XSPA // X offset from left constexpr int32_t XOS = 6 + XSPA; // X offset from left
#define YOS TAB_HEIGHT + YSPA // Y offset from top (includes tabs height) constexpr int32_t YOS = TAB_HEIGHT + YSPA; // Y offset from top (includes tabs height)
#define BTNW 110 // button width constexpr int32_t BTNW = 110; // button width
#define BTNH 16 // button height constexpr int32_t BTNH = 16; // button height
#define OPTW 220 // Option (checkbox) width (two columns) constexpr int32_t OPTW = 220; // Option (checkbox) width (two columns)
#define OPTH 10 // Option (checkbox) height (two columns) constexpr int32_t OPTH = 10; // Option (checkbox) height (two columns)
#define GROUP_SPACE 6 constexpr int32_t GROUP_SPACE = 6;
#define YPL(ROW) ((int16_t)(YOS + ((BTNH + YSPA) * ROW))) #define YPL(ROW) ((int16_t)(YOS + ((BTNH + YSPA) * ROW)))
#define HPL(ROW) ((int16_t)(YPL(ROW) + BTNH)) #define HPL(ROW) ((int16_t)(YPL(ROW) + BTNH))
@ -200,7 +200,7 @@ enum WINDOW_CHEATS_WIDGET_IDX
#define MAX_BTN_LEFT ((int16_t)(XPL(1.5))) #define MAX_BTN_LEFT ((int16_t)(XPL(1.5)))
#define MAX_BTN_RIGHT ((int16_t)(WPL(1))) #define MAX_BTN_RIGHT ((int16_t)(WPL(1)))
#define TXTO 3 // Text horizontal offset from button left (for button text) constexpr int32_t TXTO = 3; // Text horizontal offset from button left (for button text)
#pragma endregion #pragma endregion
#define MAIN_CHEATS_WIDGETS \ #define MAIN_CHEATS_WIDGETS \

View File

@ -32,8 +32,8 @@ enum WINDOW_DEBUG_PAINT_WIDGET_IDX
WIDX_TOGGLE_SHOW_DIRTY_VISUALS, WIDX_TOGGLE_SHOW_DIRTY_VISUALS,
}; };
#define WINDOW_WIDTH (200) constexpr int32_t WINDOW_WIDTH = 200;
#define WINDOW_HEIGHT (8 + 15 + 15 + 15 + 15 + 11 + 8) constexpr int32_t WINDOW_HEIGHT = 8 + 15 + 15 + 15 + 15 + 11 + 8;
static rct_widget window_debug_paint_widgets[] = { static rct_widget window_debug_paint_widgets[] = {
{ WWT_FRAME, 0, 0, WINDOW_WIDTH - 1, 0, WINDOW_HEIGHT - 1, STR_NONE, STR_NONE }, { WWT_FRAME, 0, 0, WINDOW_WIDTH - 1, 0, WINDOW_HEIGHT - 1, STR_NONE, STR_NONE },

View File

@ -16,8 +16,8 @@
#include <openrct2/windows/Intent.h> #include <openrct2/windows/Intent.h>
#include <openrct2/world/Park.h> #include <openrct2/world/Park.h>
#define WW 200 constexpr int32_t WW = 200;
#define WH 100 constexpr int32_t WH = 100;
static money32 _demolishRideCost; static money32 _demolishRideCost;

View File

@ -18,9 +18,9 @@
#include <openrct2/sprites.h> #include <openrct2/sprites.h>
// The maximum number of rows to list before items overflow into new columns // The maximum number of rows to list before items overflow into new columns
#define DROPDOWN_TEXT_MAX_ROWS 32 constexpr int32_t DROPDOWN_TEXT_MAX_ROWS = 32;
#define DROPDOWN_ITEM_HEIGHT 12 constexpr int32_t DROPDOWN_ITEM_HEIGHT = 12;
int32_t gAppropriateImageDropdownItemsPerRow[] = { int32_t gAppropriateImageDropdownItemsPerRow[] = {
1, 1, 1, 1, 2, 2, 3, 3, 4, 3, 5, 4, 4, 5, 5, 5, 4, 5, 6, 5, 5, 7, 4, 5, 6, 5, 6, 6, 6, 6, 6, 8, 8, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 3, 5, 4, 4, 5, 5, 5, 4, 5, 6, 5, 5, 7, 4, 5, 6, 5, 6, 6, 6, 6, 6, 8, 8, 0,

View File

@ -26,8 +26,8 @@
#pragma region Widgets #pragma region Widgets
#define WW 600 constexpr int32_t WW = 600;
#define WH 400 constexpr int32_t WH = 400;
// clang-format off // clang-format off
enum { enum {

View File

@ -34,11 +34,11 @@ enum {
WIDX_CANCEL WIDX_CANCEL
}; };
#define WW 380 constexpr int32_t WW = 380;
#define WH 448 constexpr int32_t WH = 448;
#define WW_LESS_PADDING (WW - 4) constexpr int32_t WW_LESS_PADDING = WW - 4;
#define PREVIEW_BUTTONS_LEFT (WW - 25) constexpr int32_t PREVIEW_BUTTONS_LEFT = WW - 25;
#define ACTION_BUTTONS_LEFT (WW - 100) constexpr int32_t ACTION_BUTTONS_LEFT = WW - 100;
static rct_widget window_install_track_widgets[] = { static rct_widget window_install_track_widgets[] = {
{ WWT_FRAME, 0, 0, WW - 1, 0, WH-1, STR_NONE, STR_NONE }, { WWT_FRAME, 0, 0, WW - 1, 0, WH-1, STR_NONE, STR_NONE },

View File

@ -91,8 +91,8 @@ static rct_window_event_list window_land_rights_events = {
}; };
// clang-format on // clang-format on
#define LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS 0 constexpr uint8_t LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS = 0;
#define LAND_RIGHTS_MODE_BUY_LAND 1 constexpr uint8_t LAND_RIGHTS_MODE_BUY_LAND = 1;
static uint8_t _landRightsMode; static uint8_t _landRightsMode;
static money32 _landRightsCost; static money32 _landRightsCost;

View File

@ -38,8 +38,8 @@
#pragma region Widgets #pragma region Widgets
#define WW 340 constexpr int32_t WW = 340;
#define WH 400 constexpr int32_t WH = 400;
// clang-format off // clang-format off
enum enum
@ -1115,8 +1115,8 @@ static void window_loadsave_select(rct_window* w, const char* path)
#pragma region Overwrite prompt #pragma region Overwrite prompt
#define OVERWRITE_WW 200 constexpr int32_t OVERWRITE_WW = 200;
#define OVERWRITE_WH 100 constexpr int32_t OVERWRITE_WH = 100;
enum enum
{ {

View File

@ -34,7 +34,7 @@
#define MAP_COLOUR(colour) MAP_COLOUR_2(colour, colour) #define MAP_COLOUR(colour) MAP_COLOUR_2(colour, colour)
#define MAP_COLOUR_UNOWNED(colour) (PALETTE_INDEX_10 | ((colour)&0xFF00)) #define MAP_COLOUR_UNOWNED(colour) (PALETTE_INDEX_10 | ((colour)&0xFF00))
#define MAP_WINDOW_MAP_SIZE (MAXIMUM_MAP_SIZE_TECHNICAL * 2) constexpr int32_t MAP_WINDOW_MAP_SIZE = MAXIMUM_MAP_SIZE_TECHNICAL * 2;
// Some functions manipulate coordinates on the map. These are the coordinates of the pixels in the // Some functions manipulate coordinates on the map. These are the coordinates of the pixels in the
// minimap. In order to distinguish those from actual coordinates, we use a separate name. // minimap. In order to distinguish those from actual coordinates, we use a separate name.

View File

@ -110,8 +110,8 @@ enum {
#pragma region Widgets #pragma region Widgets
#define WW 250 constexpr int32_t WW = 250;
#define WH 273 constexpr int32_t WH = 273;
#define SHARED_WIDGETS \ #define SHARED_WIDGETS \
{ WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, 0xFFFFFFFF, STR_NONE }, /* WIDX_BACKGROUND */ \ { WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, 0xFFFFFFFF, STR_NONE }, /* WIDX_BACKGROUND */ \
@ -490,11 +490,11 @@ static constexpr const int32_t TabAnimationLoops[WINDOW_MAPGEN_PAGE_COUNT] = {
}; };
// clang-format on // clang-format on
#define BASESIZE_MIN 0 constexpr int32_t BASESIZE_MIN = 0;
#define BASESIZE_MAX 60 constexpr int32_t BASESIZE_MAX = 60;
#define WATERLEVEL_MIN 0 constexpr int32_t WATERLEVEL_MIN = 0;
#define WATERLEVEL_MAX 54 constexpr int32_t WATERLEVEL_MAX = 54;
#define MAX_SMOOTH_ITERATIONS 20 constexpr int32_t MAX_SMOOTH_ITERATIONS = 20;
static void window_mapgen_set_page(rct_window* w, int32_t page); static void window_mapgen_set_page(rct_window* w, int32_t page);
static void window_mapgen_set_pressed_tab(rct_window* w); static void window_mapgen_set_pressed_tab(rct_window* w);

View File

@ -26,8 +26,8 @@ enum {
WINDOW_NETWORK_PAGE_INFORMATION, WINDOW_NETWORK_PAGE_INFORMATION,
}; };
#define WW 450 constexpr int32_t WW = 450;
#define WH 210 constexpr int32_t WH = 210;
enum WINDOW_NETWORK_WIDGET_IDX { enum WINDOW_NETWORK_WIDGET_IDX {
WIDX_BACKGROUND, WIDX_BACKGROUND,

View File

@ -20,7 +20,7 @@
#include <openrct2/ride/RideData.h> #include <openrct2/ride/RideData.h>
#include <openrct2/ride/ShopItem.h> #include <openrct2/ride/ShopItem.h>
#define SELECTED_RIDE_UNDEFINED ((uint16_t)0xFFFF) constexpr uint16_t SELECTED_RIDE_UNDEFINED = 0xFFFF;
// clang-format off // clang-format off
enum WINDOW_NEW_CAMPAIGN_WIDGET_IDX { enum WINDOW_NEW_CAMPAIGN_WIDGET_IDX {

View File

@ -33,9 +33,9 @@
#include <openrct2/windows/Intent.h> #include <openrct2/windows/Intent.h>
#include <openrct2/world/Park.h> #include <openrct2/world/Park.h>
#define AVAILABILITY_STRING_SIZE 256 constexpr size_t AVAILABILITY_STRING_SIZE = 256;
#define WH 382 constexpr int32_t WH = 382;
#define WW 601 constexpr int32_t WW = 601;
static uint8_t _windowNewRideCurrentTab; static uint8_t _windowNewRideCurrentTab;
static ride_list_item _windowNewRideHighlightedItem[6]; static ride_list_item _windowNewRideHighlightedItem[6];

View File

@ -263,13 +263,12 @@ enum WINDOW_OBJECT_LOAD_ERROR_WIDGET_IDX {
WIDX_DOWNLOAD_ALL WIDX_DOWNLOAD_ALL
}; };
#define WW 450 constexpr int32_t WW = 450;
#define WH 400 constexpr int32_t WH = 400;
#define WW_LESS_PADDING (WW - 5) constexpr int32_t WW_LESS_PADDING = WW - 5;
#define NAME_COL_LEFT 4 constexpr int32_t NAME_COL_LEFT = 4;
#define SOURCE_COL_LEFT ((WW_LESS_PADDING / 4) + 1) constexpr int32_t SOURCE_COL_LEFT = (WW_LESS_PADDING / 4) + 1;
#define TYPE_COL_LEFT (5 * WW_LESS_PADDING / 8 + 1) constexpr int32_t TYPE_COL_LEFT = 5 * WW_LESS_PADDING / 8 + 1;
#define LIST_ITEM_HEIGHT 10
static rct_widget window_object_load_error_widgets[] = { static rct_widget window_object_load_error_widgets[] = {
{ WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, STR_NONE, STR_NONE }, // Background { WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, STR_NONE, STR_NONE }, // Background

View File

@ -197,8 +197,8 @@ enum WINDOW_OPTIONS_WIDGET_IDX {
WIDX_NEWS_CHECKBOX WIDX_NEWS_CHECKBOX
}; };
#define WW 310 constexpr int32_t WW = 310;
#define WH 332 constexpr int32_t WH = 332;
#ifndef DISABLE_TWITCH #ifndef DISABLE_TWITCH
#define TWITCH_TAB_SPRITE IMAGE_TYPE_REMAP | SPR_TAB #define TWITCH_TAB_SPRITE IMAGE_TYPE_REMAP | SPR_TAB

View File

@ -202,7 +202,7 @@ enum {
WIDX_SHOW_GUESTS_QUEUING WIDX_SHOW_GUESTS_QUEUING
}; };
#define RCT1_LIGHT_OFFSET 4 constexpr int32_t RCT1_LIGHT_OFFSET = 4;
#define MAIN_RIDE_WIDGETS \ #define MAIN_RIDE_WIDGETS \
{ WWT_FRAME, 0, 0, 315, 0, 206, 0xFFFFFFFF, STR_NONE }, \ { WWT_FRAME, 0, 0, 315, 0, 206, 0xFFFFFFFF, STR_NONE }, \

View File

@ -26,11 +26,11 @@
#include <openrct2/world/Scenery.h> #include <openrct2/world/Scenery.h>
#include <openrct2/world/SmallScenery.h> #include <openrct2/world/SmallScenery.h>
#define WINDOW_SCENERY_WIDTH 634 constexpr int32_t WINDOW_SCENERY_WIDTH = 634;
#define WINDOW_SCENERY_HEIGHT 180 constexpr int32_t WINDOW_SCENERY_HEIGHT = 180;
#define SCENERY_BUTTON_WIDTH 66 constexpr int32_t SCENERY_BUTTON_WIDTH = 66;
#define SCENERY_BUTTON_HEIGHT 80 constexpr int32_t SCENERY_BUTTON_HEIGHT = 80;
#define SCENERY_WINDOW_TABS (MAX_SCENERY_GROUP_OBJECTS + 1) // The + 1 is for the 'Miscellaneous' tab constexpr int32_t SCENERY_WINDOW_TABS = MAX_SCENERY_GROUP_OBJECTS + 1; // The + 1 is for the 'Miscellaneous' tab
// clang-format off // clang-format off
enum { enum {

View File

@ -46,8 +46,8 @@ enum {
WIDX_LOAD_SERVER WIDX_LOAD_SERVER
}; };
#define WW 300 constexpr int32_t WW = 300;
#define WH 154 constexpr int32_t WH = 154;
static rct_widget window_server_start_widgets[] = { static rct_widget window_server_start_widgets[] = {
{ WWT_FRAME, 0, 0, WW-1, 0, WH-1, STR_NONE, STR_NONE }, // panel / background { WWT_FRAME, 0, 0, WW-1, 0, WH-1, STR_NONE, STR_NONE }, // panel / background

View File

@ -15,8 +15,8 @@
#include <openrct2/drawing/Drawing.h> #include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Localisation.h> #include <openrct2/localisation/Localisation.h>
#define WW 250 constexpr int32_t WW = 250;
#define WH 60 constexpr int32_t WH = 60;
// clang-format off // clang-format off
enum WINDOW_SHORTCUT_CHANGE_WIDGET_IDX { enum WINDOW_SHORTCUT_CHANGE_WIDGET_IDX {

View File

@ -15,11 +15,11 @@
#include <openrct2/drawing/Drawing.h> #include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Localisation.h> #include <openrct2/localisation/Localisation.h>
#define WW 420 constexpr int32_t WW = 420;
#define WH 280 constexpr int32_t WH = 280;
#define WW_SC_MAX 1200 constexpr int32_t WW_SC_MAX = 1200;
#define WH_SC_MAX 800 constexpr int32_t WH_SC_MAX = 800;
// clang-format off // clang-format off
enum WINDOW_SHORTCUT_WIDGET_IDX { enum WINDOW_SHORTCUT_WIDGET_IDX {

View File

@ -25,8 +25,8 @@
#include <openrct2/world/Scenery.h> #include <openrct2/world/Scenery.h>
#include <openrct2/world/Wall.h> #include <openrct2/world/Wall.h>
#define WW 113 constexpr int32_t WW = 113;
#define WH 96 constexpr int32_t WH = 96;
// clang-format off // clang-format off
enum WINDOW_SIGN_WIDGET_IDX { enum WINDOW_SIGN_WIDGET_IDX {

View File

@ -31,8 +31,8 @@
#include <openrct2/world/Park.h> #include <openrct2/world/Park.h>
#include <openrct2/world/Sprite.h> #include <openrct2/world/Sprite.h>
#define WW 190 constexpr int32_t WW = 190;
#define WH 180 constexpr int32_t WH = 180;
// clang-format off // clang-format off
enum WINDOW_STAFF_PAGE { enum WINDOW_STAFF_PAGE {

View File

@ -16,8 +16,8 @@
#include <openrct2/localisation/Localisation.h> #include <openrct2/localisation/Localisation.h>
#include <openrct2/world/Sprite.h> #include <openrct2/world/Sprite.h>
#define WW 200 constexpr int32_t WW = 200;
#define WH 100 constexpr int32_t WH = 100;
// clang-format off // clang-format off
enum WINDOW_STAFF_FIRE_WIDGET_IDX { enum WINDOW_STAFF_FIRE_WIDGET_IDX {

View File

@ -102,10 +102,10 @@ enum WINDOW_STAFF_LIST_WIDGET_IDX {
WIDX_STAFF_LIST_MAP, WIDX_STAFF_LIST_MAP,
}; };
#define WW 320 constexpr int32_t WW = 320;
#define WH 270 constexpr int32_t WH = 270;
#define MAX_WW 500 constexpr int32_t MAX_WW = 500;
#define MAX_WH 450 constexpr int32_t MAX_WH = 450;
static rct_widget window_staff_list_widgets[] = { static rct_widget window_staff_list_widgets[] = {
{ WWT_FRAME, 0, 0, 319, 0, 269, 0xFFFFFFFF, STR_NONE }, // panel / background { WWT_FRAME, 0, 0, 319, 0, 269, 0xFFFFFFFF, STR_NONE }, // panel / background

View File

@ -25,8 +25,8 @@
#include <openrct2/localisation/Localisation.h> #include <openrct2/localisation/Localisation.h>
#include <openrct2/util/Util.h> #include <openrct2/util/Util.h>
#define WW 250 constexpr int32_t WW = 250;
#define WH 90 constexpr int32_t WH = 90;
// clang-format off // clang-format off
enum WINDOW_TEXT_INPUT_WIDGET_IDX { enum WINDOW_TEXT_INPUT_WIDGET_IDX {

View File

@ -200,33 +200,33 @@ enum WINDOW_TILE_INSPECTOR_WIDGET_IDX {
}; };
// Window sizes // Window sizes
#define WW 400 constexpr int32_t WW = 400;
#define WH 170 constexpr int32_t WH = 170;
#define MIN_WW WW constexpr int32_t MIN_WW = WW;
#define MAX_WW WW constexpr int32_t MAX_WW = WW;
#define MIN_WH 130 constexpr int32_t MIN_WH = 130;
#define MAX_WH 800 constexpr int32_t MAX_WH = 800;
// Button space for top buttons // Button space for top buttons
#define BW (WW - 5) // Button's right side constexpr int32_t BW = WW - 5; // Button's right side
#define BX (BW - 23) // Button's left side constexpr int32_t BX = BW - 23; // Button's left side
#define BY 17 // Button's Top constexpr int32_t BY = 17; // Button's Top
#define BH (BY + 23) // Button's Bottom constexpr int32_t BH = BY + 23; // Button's Bottom
#define BS 24 constexpr int32_t BS = 24;
// Column offsets for the table headers // Column offsets for the table headers
#define COL_X_TYPE 3 // Type constexpr int32_t COL_X_TYPE = 3; // Type
#define COL_X_BH (COL_X_TYPE + 312) // Base height constexpr int32_t COL_X_BH = COL_X_TYPE + 312; // Base height
#define COL_X_CH (COL_X_BH + 20) // Clearance height constexpr int32_t COL_X_CH = COL_X_BH + 20; // Clearance height
#define COL_X_GF (COL_X_CH + 20) // Ghost flag constexpr int32_t COL_X_GF = COL_X_CH + 20; // Ghost flag
#define COL_X_LF (COL_X_GF + 12) // Last for tile flag constexpr int32_t COL_X_LF = COL_X_GF + 12; // Last for tile flag
#define PADDING_BOTTOM 15 constexpr int32_t PADDING_BOTTOM = 15;
#define GROUPBOX_PADDING 6 constexpr int32_t GROUPBOX_PADDING = 6;
#define HORIZONTAL_GROUPBOX_PADDING 5 constexpr int32_t HORIZONTAL_GROUPBOX_PADDING = 5;
#define VERTICAL_GROUPBOX_PADDING 4 constexpr int32_t VERTICAL_GROUPBOX_PADDING = 4;
#define BUTTONW 130 constexpr int32_t BUTTONW = 130;
#define BUTTONH 17 constexpr int32_t BUTTONH = 17;
// Calculates the .left, .right, .top and .bottom for buttons in a group box. // Calculates the .left, .right, .top and .bottom for buttons in a group box.
// Buttons are used as reference points for all other widgets in the group boxes. // Buttons are used as reference points for all other widgets in the group boxes.
@ -275,10 +275,10 @@ static rct_widget DefaultWidgets[] = {
}; };
// Group boxes .top and .bottom for a given window height offsets from the bottom // Group boxes .top and .bottom for a given window height offsets from the bottom
#define SUR_GBPB PADDING_BOTTOM // Surface group box properties bottom constexpr int32_t SUR_GBPB = PADDING_BOTTOM; // Surface group box properties bottom
#define SUR_GBPT (SUR_GBPB + 16 + 4 * 21) // Surface group box properties top constexpr int32_t SUR_GBPT = SUR_GBPB + 16 + 4 * 21; // Surface group box properties top
#define SUR_GBDB (SUR_GBPT + GROUPBOX_PADDING) // Surface group box details bottom constexpr int32_t SUR_GBDB = SUR_GBPT + GROUPBOX_PADDING; // Surface group box details bottom
#define SUR_GBDT (SUR_GBDB + 20 + 4 * 11) // Surface group box details top constexpr int32_t SUR_GBDT = SUR_GBDB + 20 + 4 * 11; // Surface group box details top
static rct_widget SurfaceWidgets[] = { static rct_widget SurfaceWidgets[] = {
MAIN_TILE_INSPECTOR_WIDGETS, MAIN_TILE_INSPECTOR_WIDGETS,
SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - SUR_GBPT, 0) + 3, GBBB(WH - SUR_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_SURFACE_SPINNER_HEIGHT{,_INCREASE,_DECREASE} SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - SUR_GBPT, 0) + 3, GBBB(WH - SUR_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_SURFACE_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
@ -292,10 +292,10 @@ static rct_widget SurfaceWidgets[] = {
{ WIDGETS_END }, { WIDGETS_END },
}; };
#define PAT_GBPB PADDING_BOTTOM // Path group box properties bottom constexpr int32_t PAT_GBPB = PADDING_BOTTOM; // Path group box properties bottom
#define PAT_GBPT (PAT_GBPB + 16 + 5 * 21) // Path group box properties top constexpr int32_t PAT_GBPT = PAT_GBPB + 16 + 5 * 21; // Path group box properties top
#define PAT_GBDB (PAT_GBPT + GROUPBOX_PADDING) // Path group box info bottom constexpr int32_t PAT_GBDB = PAT_GBPT + GROUPBOX_PADDING; // Path group box info bottom
#define PAT_GBDT (PAT_GBDB + 20 + 2 * 11) // Path group box info top constexpr int32_t PAT_GBDT = PAT_GBDB + 20 + 2 * 11; // Path group box info top
static rct_widget PathWidgets[] = { static rct_widget PathWidgets[] = {
MAIN_TILE_INSPECTOR_WIDGETS, MAIN_TILE_INSPECTOR_WIDGETS,
SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - PAT_GBPT, 0) + 3, GBBB(WH - PAT_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_PATH_SPINNER_HEIGHT{,_INCREASE,_DECREASE} SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - PAT_GBPT, 0) + 3, GBBB(WH - PAT_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_PATH_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
@ -312,10 +312,10 @@ static rct_widget PathWidgets[] = {
{ WIDGETS_END }, { WIDGETS_END },
}; };
#define TRA_GBPB PADDING_BOTTOM // Track group box properties bottom constexpr int32_t TRA_GBPB = PADDING_BOTTOM; // Track group box properties bottom
#define TRA_GBPT (TRA_GBPB + 16 + 5 * 21) // Track group box properties top constexpr int32_t TRA_GBPT = TRA_GBPB + 16 + 5 * 21; // Track group box properties top
#define TRA_GBDB (TRA_GBPT + GROUPBOX_PADDING) // Track group box info bottom constexpr int32_t TRA_GBDB = TRA_GBPT + GROUPBOX_PADDING; // Track group box info bottom
#define TRA_GBDT (TRA_GBDB + 20 + 7 * 11) // Track group box info top constexpr int32_t TRA_GBDT = TRA_GBDB + 20 + 7 * 11; // Track group box info top
static rct_widget TrackWidgets[] = { static rct_widget TrackWidgets[] = {
MAIN_TILE_INSPECTOR_WIDGETS, MAIN_TILE_INSPECTOR_WIDGETS,
{ WWT_CHECKBOX, 1, GBBF(WH - TRA_GBPT, 0, 0), STR_TILE_INSPECTOR_TRACK_ENTIRE_TRACK_PIECE, STR_NONE }, // WIDX_TRACK_CHECK_APPLY_TO_ALL { WWT_CHECKBOX, 1, GBBF(WH - TRA_GBPT, 0, 0), STR_TILE_INSPECTOR_TRACK_ENTIRE_TRACK_PIECE, STR_NONE }, // WIDX_TRACK_CHECK_APPLY_TO_ALL
@ -326,10 +326,10 @@ static rct_widget TrackWidgets[] = {
{ WIDGETS_END }, { WIDGETS_END },
}; };
#define SCE_GBPB PADDING_BOTTOM // Scenery group box properties bottom constexpr int32_t SCE_GBPB = PADDING_BOTTOM; // Scenery group box properties bottom
#define SCE_GBPT (SCE_GBPB + 16 + 4 * 21) // Scenery group box properties top constexpr int32_t SCE_GBPT = SCE_GBPB + 16 + 4 * 21; // Scenery group box properties top
#define SCE_GBDB (SCE_GBPT + GROUPBOX_PADDING) // Scenery group box info bottom constexpr int32_t SCE_GBDB = SCE_GBPT + GROUPBOX_PADDING; // Scenery group box info bottom
#define SCE_GBDT (SCE_GBDB + 20 + 3 * 11) // Scenery group box info top constexpr int32_t SCE_GBDT = SCE_GBDB + 20 + 3 * 11; // Scenery group box info top
static rct_widget SceneryWidgets[] = { static rct_widget SceneryWidgets[] = {
MAIN_TILE_INSPECTOR_WIDGETS, MAIN_TILE_INSPECTOR_WIDGETS,
SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - SCE_GBPT, 0) + 3, GBBB(WH - SCE_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE} SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - SCE_GBPT, 0) + 3, GBBB(WH - SCE_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
@ -345,10 +345,10 @@ static rct_widget SceneryWidgets[] = {
}; };
#define ENT_GBPB PADDING_BOTTOM // Entrance group box properties bottom constexpr int32_t ENT_GBPB = PADDING_BOTTOM; // Entrance group box properties bottom
#define ENT_GBPT (ENT_GBPB + 16 + 2 * 21) // Entrance group box properties top constexpr int32_t ENT_GBPT = ENT_GBPB + 16 + 2 * 21; // Entrance group box properties top
#define ENT_GBDB (ENT_GBPT + GROUPBOX_PADDING) // Entrance group box info bottom constexpr int32_t ENT_GBDB = ENT_GBPT + GROUPBOX_PADDING; // Entrance group box info bottom
#define ENT_GBDT (ENT_GBDB + 20 + 4 * 11) // Entrance group box info top constexpr int32_t ENT_GBDT = ENT_GBDB + 20 + 4 * 11; // Entrance group box info top
static rct_widget EntranceWidgets[] = { static rct_widget EntranceWidgets[] = {
MAIN_TILE_INSPECTOR_WIDGETS, MAIN_TILE_INSPECTOR_WIDGETS,
SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - ENT_GBPT, 0) + 3, GBBB(WH - ENT_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_ENTRANCE_SPINNER_HEIGHT{,_INCREASE,_DECREASE} SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - ENT_GBPT, 0) + 3, GBBB(WH - ENT_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_ENTRANCE_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
@ -356,10 +356,10 @@ static rct_widget EntranceWidgets[] = {
{ WIDGETS_END }, { WIDGETS_END },
}; };
#define WALL_GBPB PADDING_BOTTOM // Wall group box properties bottom constexpr int32_t WALL_GBPB = PADDING_BOTTOM; // Wall group box properties bottom
#define WALL_GBPT (WALL_GBPB + 16 + 2 * 21) // Wall group box properties top constexpr int32_t WALL_GBPT = WALL_GBPB + 16 + 2 * 21; // Wall group box properties top
#define WALL_GBDB (WALL_GBPT + GROUPBOX_PADDING) // Wall group box info bottom constexpr int32_t WALL_GBDB = WALL_GBPT + GROUPBOX_PADDING; // Wall group box info bottom
#define WALL_GBDT (WALL_GBDB + 20 + 2 * 11) // Wall group box info top constexpr int32_t WALL_GBDT = WALL_GBDB + 20 + 2 * 11; // Wall group box info top
static rct_widget WallWidgets[] = { static rct_widget WallWidgets[] = {
MAIN_TILE_INSPECTOR_WIDGETS, MAIN_TILE_INSPECTOR_WIDGETS,
SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - WALL_GBPT, 0) + 3, GBBB(WH - WALL_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_WALL_SPINNER_HEIGHT{,_INCREASE,_DECREASE} SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - WALL_GBPT, 0) + 3, GBBB(WH - WALL_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_WALL_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
@ -368,20 +368,20 @@ static rct_widget WallWidgets[] = {
{ WIDGETS_END }, { WIDGETS_END },
}; };
#define LAR_GBPB PADDING_BOTTOM // Large scenery group box properties bottom constexpr int32_t LAR_GBPB = PADDING_BOTTOM; // Large scenery group box properties bottom
#define LAR_GBPT (LAR_GBPB + 16 + 1 * 21) // Large scenery group box properties top constexpr int32_t LAR_GBPT = LAR_GBPB + 16 + 1 * 21; // Large scenery group box properties top
#define LAR_GBDB (LAR_GBPT + GROUPBOX_PADDING) // Large scenery group box info bottom constexpr int32_t LAR_GBDB = LAR_GBPT + GROUPBOX_PADDING; // Large scenery group box info bottom
#define LAR_GBDT (LAR_GBDB + 20 + 3 * 11) // Large scenery group box info top constexpr int32_t LAR_GBDT = LAR_GBDB + 20 + 3 * 11; // Large scenery group box info top
static rct_widget LargeSceneryWidgets[] = { static rct_widget LargeSceneryWidgets[] = {
MAIN_TILE_INSPECTOR_WIDGETS, MAIN_TILE_INSPECTOR_WIDGETS,
SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - LAR_GBPT, 0) + 3, GBBB(WH - LAR_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_LARGE_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE} SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - LAR_GBPT, 0) + 3, GBBB(WH - LAR_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_LARGE_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
{ WIDGETS_END }, { WIDGETS_END },
}; };
#define BAN_GBPB PADDING_BOTTOM // Banner group box properties bottom constexpr int32_t BAN_GBPB = PADDING_BOTTOM; // Banner group box properties bottom
#define BAN_GBPT (BAN_GBPB + 16 + 3 * 21) // Banner group box properties top constexpr int32_t BAN_GBPT = BAN_GBPB + 16 + 3 * 21; // Banner group box properties top
#define BAN_GBDB (BAN_GBPT + GROUPBOX_PADDING) // Banner group box info bottom constexpr int32_t BAN_GBDB = BAN_GBPT + GROUPBOX_PADDING; // Banner group box info bottom
#define BAN_GBDT (BAN_GBDB + 20 + 1 * 11) // Banner group box info top constexpr int32_t BAN_GBDT = BAN_GBDB + 20 + 1 * 11; // Banner group box info top
static rct_widget BannerWidgets[] = { static rct_widget BannerWidgets[] = {
MAIN_TILE_INSPECTOR_WIDGETS, MAIN_TILE_INSPECTOR_WIDGETS,
SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - BAN_GBPT, 0) + 3, GBBB(WH - BAN_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_BANNER_SPINNER_HEIGHT{,_INCREASE,_DECREASE} SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - BAN_GBPT, 0) + 3, GBBB(WH - BAN_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_BANNER_SPINNER_HEIGHT{,_INCREASE,_DECREASE}
@ -393,10 +393,10 @@ static rct_widget BannerWidgets[] = {
{ WIDGETS_END }, { WIDGETS_END },
}; };
#define COR_GBPB PADDING_BOTTOM // Corrupt element group box properties bottom constexpr int32_t COR_GBPB = PADDING_BOTTOM; // Corrupt element group box properties bottom
#define COR_GBPT (COR_GBPB + 16 + 2 * 21) // Corrupt element group box properties top constexpr int32_t COR_GBPT = COR_GBPB + 16 + 2 * 21; // Corrupt element group box properties top
#define COR_GBDB (COR_GBPT + GROUPBOX_PADDING) // Corrupt element group box info bottom constexpr int32_t COR_GBDB = COR_GBPT + GROUPBOX_PADDING; // Corrupt element group box info bottom
#define COR_GBDT (COR_GBDB + 20 + 0 * 11) // Corrupt element group box info top constexpr int32_t COR_GBDT = COR_GBDB + 20 + 0 * 11; // Corrupt element group box info top
static rct_widget CorruptWidgets[] = { static rct_widget CorruptWidgets[] = {
MAIN_TILE_INSPECTOR_WIDGETS, MAIN_TILE_INSPECTOR_WIDGETS,
SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - COR_GBPT, 0) + 3, GBBB(WH - COR_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_CORRUPT_SPINNER_HEIGHT{,_INCREASE,_DECREASE} SPINNER_WIDGETS (1, GBBL(1), GBBR(1), GBBT(WH - COR_GBPT, 0) + 3, GBBB(WH - COR_GBPT, 0) - 3, STR_NONE, STR_NONE), // WIDX_CORRUPT_SPINNER_HEIGHT{,_INCREASE,_DECREASE}

View File

@ -69,16 +69,16 @@ enum WINDOW_WATER_WIDGET_IDX {
WIDX_CANCEL WIDX_CANCEL
}; };
#define WW 200 constexpr int32_t WW = 200;
#define WH 120 constexpr int32_t WH = 120;
#define BY 32 constexpr int32_t BY = 32;
#define BY2 70 constexpr int32_t BY2 = 70;
#define WS 16 constexpr int32_t WS = 16;
#define WHA ((WW-WS*2)/2) constexpr int32_t WHA = (WW-WS*2)/2;
static bool _window_title_command_editor_insert; static bool _window_title_command_editor_insert;
static int32_t _window_title_command_editor_index; static int32_t _window_title_command_editor_index;
#define BUF_SIZE 50 constexpr size_t BUF_SIZE = 50;
static char textbox1Buffer[BUF_SIZE]; static char textbox1Buffer[BUF_SIZE];
static char textbox2Buffer[BUF_SIZE]; static char textbox2Buffer[BUF_SIZE];
static TitleCommand command = { TITLE_SCRIPT_LOAD, { 0 } }; static TitleCommand command = { TITLE_SCRIPT_LOAD, { 0 } };

View File

@ -135,15 +135,15 @@ enum WINDOW_TITLE_EDITOR_WIDGET_IDX {
// Increase BW if certain languages do not fit // Increase BW if certain languages do not fit
// BW should be a multiple of 4 // BW should be a multiple of 4
#define WW 320 constexpr int32_t WW = 320;
#define WH 270 constexpr int32_t WH = 270;
#define BX 8 constexpr int32_t BX = 8;
#define BW 72 constexpr int32_t BW = 72;
#define BY 52 constexpr int32_t BY = 52;
#define BH 63 constexpr int32_t BH = 63;
#define BS 18 constexpr int32_t BS = 18;
#define SCROLL_WIDTH 350 constexpr int32_t SCROLL_WIDTH = 350;
#define WH2 127 constexpr int32_t WH2 = 127;
static rct_widget window_title_editor_widgets[] = { static rct_widget window_title_editor_widgets[] = {
{ WWT_FRAME, 0, 0, WW-1, 0, WH2-1, 0xFFFFFFFF, STR_NONE }, // panel / background { WWT_FRAME, 0, 0, WW-1, 0, WH2-1, 0xFFFFFFFF, STR_NONE }, // panel / background

View File

@ -27,9 +27,9 @@
#include <openrct2/world/Surface.h> #include <openrct2/world/Surface.h>
#include <vector> #include <vector>
#define TRACK_MINI_PREVIEW_WIDTH 168 constexpr int16_t TRACK_MINI_PREVIEW_WIDTH = 168;
#define TRACK_MINI_PREVIEW_HEIGHT 78 constexpr int16_t TRACK_MINI_PREVIEW_HEIGHT = 78;
#define TRACK_MINI_PREVIEW_SIZE (TRACK_MINI_PREVIEW_WIDTH * TRACK_MINI_PREVIEW_HEIGHT) constexpr uint16_t TRACK_MINI_PREVIEW_SIZE = TRACK_MINI_PREVIEW_WIDTH * TRACK_MINI_PREVIEW_HEIGHT;
struct rct_track_td6; struct rct_track_td6;

View File

@ -97,7 +97,7 @@ static rct_window_event_list window_track_list_events = {
}; };
// clang-format on // clang-format on
#define TRACK_DESIGN_INDEX_UNLOADED UINT16_MAX constexpr uint16_t TRACK_DESIGN_INDEX_UNLOADED = UINT16_MAX;
ride_list_item _window_track_list_item; ride_list_item _window_track_list_item;

View File

@ -45,8 +45,8 @@ static DISPLAY_TYPE gClipHeightDisplayType = DISPLAY_TYPE::DISPLAY_UNITS;
#pragma region Widgets #pragma region Widgets
#define WW 180 constexpr int32_t WW = 180;
#define WH 155 constexpr int32_t WH = 155;
static rct_widget window_view_clipping_widgets[] = { static rct_widget window_view_clipping_widgets[] = {
{ WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, STR_NONE, STR_NONE }, // panel / background { WWT_FRAME, 0, 0, WW - 1, 0, WH - 1, STR_NONE, STR_NONE }, // panel / background

View File

@ -15,8 +15,8 @@
#include <openrct2/localisation/Localisation.h> #include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h> #include <openrct2/sprites.h>
#define INITIAL_WIDTH 500 constexpr int32_t INITIAL_WIDTH = 500;
#define INITIAL_HEIGHT 350 constexpr int32_t INITIAL_HEIGHT = 350;
// clang-format off // clang-format off
enum { enum {