Replace defines with constexpr

This commit is contained in:
Gymnasiast 2020-05-05 22:26:14 +02:00
parent 96fe3d3b3c
commit 9e4c664944
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
49 changed files with 109 additions and 109 deletions

View File

@ -18,7 +18,7 @@
constexpr int32_t WW = 400;
constexpr int32_t WH = 350;
#define WINDOW_TITLE STR_ABOUT
static constexpr const rct_string_id WINDOW_TITLE = STR_ABOUT;
constexpr int32_t TABHEIGHT = 50;
// clang-format off

View File

@ -24,7 +24,7 @@
constexpr int32_t WW = 113;
constexpr int32_t WH = 96;
#define WINDOW_TITLE STR_BANNER_WINDOW_TITLE
static constexpr const rct_string_id WINDOW_TITLE = STR_BANNER_WINDOW_TITLE;
// clang-format off
enum WINDOW_BANNER_WIDGET_IDX {

View File

@ -34,7 +34,7 @@ enum {
constexpr int32_t WW = 500;
constexpr int32_t WH = 400;
#define WINDOW_TITLE STR_CHANGELOG_TITLE
static constexpr const rct_string_id WINDOW_TITLE = STR_CHANGELOG_TITLE;
constexpr int32_t MIN_WW = 300;
constexpr int32_t MIN_WH = 200;

View File

@ -176,7 +176,7 @@ enum WINDOW_CHEATS_WIDGET_IDX
#pragma region MEASUREMENTS
#define WINDOW_TITLE STR_CHEAT_TITLE
static constexpr const rct_string_id WINDOW_TITLE = STR_CHEAT_TITLE;
constexpr int32_t WW = 249;
constexpr int32_t WH = 300;
constexpr int32_t TAB_HEIGHT = 43;

View File

@ -29,9 +29,9 @@ enum WINDOW_CLEAR_SCENERY_WIDGET_IDX {
WIDX_FOOTPATH
};
#define WINDOW_TITLE STR_CLEAR_SCENERY
#define WW 102
#define WH 93
static constexpr const rct_string_id WINDOW_TITLE = STR_CLEAR_SCENERY;
static constexpr const int32_t WW = 102;
static constexpr const int32_t WH = 93;
static rct_widget window_clear_scenery_widgets[] = {
{ WINDOW_SKELETON(WINDOW_TITLE, WW, WH) },

View File

@ -16,9 +16,9 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/util/Util.h>
#define WINDOW_TITLE STR_CUSTOM_CURRENCY_WINDOW_TITLE
#define WH 100
#define WW 400
static constexpr const rct_string_id WINDOW_TITLE = STR_CUSTOM_CURRENCY_WINDOW_TITLE;
static constexpr const int32_t WH = 100;
static constexpr const int32_t WW = 400;
// clang-format off
enum WINDOW_CUSTOM_CURRENCY_WIDGET_IDX {

View File

@ -18,7 +18,7 @@
constexpr int32_t WW = 200;
constexpr int32_t WH = 100;
#define WINDOW_TITLE STR_DEMOLISH_RIDE
static constexpr const rct_string_id WINDOW_TITLE = STR_DEMOLISH_RIDE;
static money32 _demolishRideCost;

View File

@ -28,7 +28,7 @@
constexpr int32_t WW = 600;
constexpr int32_t WH = 400;
#define WINDOW_TITLE STR_INVENTION_LIST
static constexpr const rct_string_id WINDOW_TITLE = STR_INVENTION_LIST;
// clang-format off
enum {

View File

@ -80,9 +80,9 @@ static char _filter_string[MAX_PATH];
#define _FILTER_SELECTED (_filter_flags & FILTER_SELECTED)
#define _FILTER_NONSELECTED (_filter_flags & FILTER_NONSELECTED)
#define WINDOW_TITLE STR_OBJECT_SELECTION
#define WH 400
#define WW 600
static constexpr const rct_string_id WINDOW_TITLE = STR_OBJECT_SELECTION;
static constexpr const int32_t WH = 400;
static constexpr const int32_t WW = 600;
struct ObjectPageDesc
{

View File

@ -32,9 +32,9 @@
#include <openrct2/util/Util.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE STR_OBJECTIVE_SELECTION
#define WH 229
#define WW 450
static constexpr const rct_string_id WINDOW_TITLE = STR_OBJECTIVE_SELECTION;
static constexpr const int32_t WH = 229;
static constexpr const int32_t WW = 450;
#pragma region Widgets

View File

@ -28,9 +28,9 @@
#include <openrct2/world/Climate.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE STR_SCENARIO_OPTIONS_FINANCIAL
#define WH 149
#define WW 280
static constexpr const rct_string_id WINDOW_TITLE = STR_SCENARIO_OPTIONS_FINANCIAL;
static constexpr const int32_t WH = 149;
static constexpr const int32_t WW = 280;
#pragma region Widgets

View File

@ -27,9 +27,9 @@
#include <openrct2/sprites.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE 0
#define WH 0
#define WW 0
static constexpr const rct_string_id WINDOW_TITLE = 0;
static constexpr const int32_t WH = 0;
static constexpr const int32_t WW = 0;
// clang-format off
enum

View File

@ -24,9 +24,9 @@
#include <openrct2/world/Park.h>
#include <openrct2/world/Surface.h>
#define WINDOW_TITLE STR_FOOTPATHS
#define WH 381
#define WW 106
static constexpr const rct_string_id WINDOW_TITLE = STR_FOOTPATHS;
static constexpr const int32_t WH = 381;
static constexpr const int32_t WW = 106;
// clang-format off
enum

View File

@ -31,9 +31,9 @@
#include <openrct2/world/Footpath.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE STR_STRINGID
#define WH 157
#define WW 192
static constexpr const rct_string_id WINDOW_TITLE = STR_STRINGID;
static constexpr const int32_t WH = 157;
static constexpr const int32_t WW = 192;
// clang-format off
enum WINDOW_GUEST_PAGE {

View File

@ -23,9 +23,9 @@
#include <openrct2/world/Sprite.h>
#include <vector>
#define WINDOW_TITLE STR_GUESTS
#define WH 330
#define WW 350
static constexpr const rct_string_id WINDOW_TITLE = STR_GUESTS;
static constexpr const int32_t WH = 330;
static constexpr const int32_t WW = 350;
// clang-format off
enum {

View File

@ -34,7 +34,7 @@ enum {
WIDX_CANCEL
};
#define WINDOW_TITLE STR_TRACK_DESIGN_INSTALL_WINDOW_TITLE
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;

View File

@ -23,9 +23,9 @@
using namespace OpenRCT2;
#define WINDOW_TITLE STR_LAND
#define WH 160
#define WW 98
static constexpr const rct_string_id WINDOW_TITLE = STR_LAND;
static constexpr const int32_t WH = 160;
static constexpr const int32_t WW = 98;
// clang-format off
enum WINDOW_LAND_WIDGET_IDX {

View File

@ -20,9 +20,9 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE STR_LAND_RIGHTS
#define WH 94
#define WW 98
static constexpr const rct_string_id WINDOW_TITLE = STR_LAND_RIGHTS;
static constexpr const int32_t WH = 94;
static constexpr const int32_t WW = 98;
// clang-format off
enum WINDOW_WATER_WIDGET_IDX {

View File

@ -38,7 +38,7 @@
#pragma region Widgets
#define WINDOW_TITLE STR_NONE
static constexpr const rct_string_id WINDOW_TITLE = STR_NONE;
constexpr int32_t WW = 350;
constexpr int32_t WH = 400;

View File

@ -38,9 +38,9 @@
constexpr int32_t MAP_WINDOW_MAP_SIZE = MAXIMUM_MAP_SIZE_TECHNICAL * 2;
#define WINDOW_TITLE STR_MAP_LABEL
#define WH 259
#define WW 245
static constexpr const rct_string_id WINDOW_TITLE = STR_MAP_LABEL;
static constexpr const int32_t WH = 259;
static constexpr const int32_t WW = 245;
// 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.

View File

@ -110,7 +110,7 @@ enum {
#pragma region Widgets
#define WINDOW_TITLE STR_MAPGEN_WINDOW_TITLE
static constexpr const rct_string_id WINDOW_TITLE = STR_MAPGEN_WINDOW_TITLE;
constexpr int32_t WW = 250;
constexpr int32_t WH = 273;

View File

@ -24,9 +24,9 @@
#pragma region Widgets
#define WINDOW_TITLE STR_RIDE_CONSTRUCTION_WINDOW_TITLE
#define WH 200
#define WW 166
static constexpr const rct_string_id WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE;
static constexpr const int32_t WH = 200;
static constexpr const int32_t WW = 166;
// clang-format off
enum {

View File

@ -14,9 +14,9 @@
#include <openrct2/interface/Colour.h>
#include <openrct2/localisation/Localisation.h>
#define WINDOW_TITLE STR_MUSIC_ACKNOWLEDGEMENTS
#define WH 314
#define WW 510
static constexpr const rct_string_id WINDOW_TITLE = STR_MUSIC_ACKNOWLEDGEMENTS;
static constexpr const int32_t WH = 314;
static constexpr const int32_t WW = 510;
// clang-format off
enum WINDOW_MUSIC_CREDITS_WIDGET_IDX {

View File

@ -20,9 +20,9 @@
#include <openrct2/ride/RideData.h>
#include <openrct2/ride/ShopItem.h>
#define WINDOW_TITLE 0
#define WH 107
#define WW 350
static constexpr const rct_string_id WINDOW_TITLE = 0;
static constexpr const int32_t WH = 107;
static constexpr const int32_t WW = 350;
constexpr uint16_t SELECTED_RIDE_UNDEFINED = 0xFFFF;
// clang-format off

View File

@ -34,7 +34,7 @@
#include <openrct2/windows/Intent.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE 0xFFFFFFFF
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;

View File

@ -19,9 +19,9 @@
#include <openrct2/sprites.h>
#include <openrct2/world/Sprite.h>
#define WINDOW_TITLE STR_RECENT_MESSAGES
#define WH 300
#define WW 400
static constexpr const rct_string_id WINDOW_TITLE = STR_RECENT_MESSAGES;
static constexpr const int32_t WH = 300;
static constexpr const int32_t WW = 400;
// clang-format off
enum WINDOW_NEWS_WIDGET_IDX {

View File

@ -16,9 +16,9 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#define WINDOW_TITLE STR_NOTIFICATION_SETTINGS
#define WH 300
#define WW 400
static constexpr const rct_string_id WINDOW_TITLE = STR_NOTIFICATION_SETTINGS;
static constexpr const int32_t WH = 300;
static constexpr const int32_t WW = 400;
// clang-format off
enum {

View File

@ -200,7 +200,7 @@ enum WINDOW_OPTIONS_WIDGET_IDX {
WIDX_NEWS_CHECKBOX
};
#define WINDOW_TITLE STR_OPTIONS_TITLE
static constexpr const rct_string_id WINDOW_TITLE = STR_OPTIONS_TITLE;
constexpr int32_t WW = 310;
constexpr int32_t WH = 332;

View File

@ -31,9 +31,9 @@
#include <openrct2/world/Entrance.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE STR_STRINGID
#define WH 224
#define WW 230
static constexpr const rct_string_id WINDOW_TITLE = STR_STRINGID;
static constexpr const int32_t WH = 224;
static constexpr const int32_t WW = 230;
// clang-format off
enum WINDOW_PARK_PAGE {

View File

@ -20,9 +20,9 @@
#include <openrct2/world/Park.h>
#include <openrct2/world/Scenery.h>
#define WINDOW_TITLE 0
#define WH 0
#define WW 0
static constexpr const rct_string_id WINDOW_TITLE = 0;
static constexpr const int32_t WH = 0;
static constexpr const int32_t WW = 0;
// clang-format off
enum {

View File

@ -56,9 +56,9 @@
using namespace OpenRCT2;
#define WINDOW_TITLE STR_RIDE_WINDOW_TITLE
#define WH 207
#define WW 316
static constexpr const rct_string_id WINDOW_TITLE = STR_RIDE_WINDOW_TITLE;
static constexpr const int32_t WH = 207;
static constexpr const int32_t WW = 316;
enum
{

View File

@ -36,9 +36,9 @@
#include <openrct2/world/Footpath.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE STR_RIDE_CONSTRUCTION_WINDOW_TITLE
#define WH 394
#define WW 166
static constexpr const rct_string_id WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE;
static constexpr const int32_t WH = 394;
static constexpr const int32_t WW = 166;
#pragma region Widgets

View File

@ -25,9 +25,9 @@
#include <openrct2/windows/Intent.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE 0xFFFFFFFF
#define WH 240
#define WW 340
static constexpr const rct_string_id WINDOW_TITLE = STR_NONE;
static constexpr const int32_t WH = 240;
static constexpr const int32_t WW = 340;
// clang-format off
enum {

View File

@ -20,9 +20,9 @@
#include <openrct2/scenario/Scenario.h>
#include <openrct2/windows/Intent.h>
#define WINDOW_TITLE 0
#define WH 54
#define WW 260
static constexpr const rct_string_id WINDOW_TITLE = 0;
static constexpr const int32_t WH = 54;
static constexpr const int32_t WW = 260;
// clang-format off
enum WINDOW_SAVE_PROMPT_WIDGET_IDX {

View File

@ -26,9 +26,9 @@
#include <openrct2/world/Scenery.h>
#include <openrct2/world/SmallScenery.h>
#define WINDOW_TITLE 0xFFFFFFFF
#define WW 634
#define WH 180
static constexpr const rct_string_id WINDOW_TITLE = STR_NONE;
static constexpr const int32_t WW = 634;
static constexpr const int32_t WH = 180;
constexpr int32_t WINDOW_SCENERY_WIDTH = 634;
constexpr int32_t WINDOW_SCENERY_HEIGHT = 180;
constexpr int32_t SCENERY_BUTTON_WIDTH = 66;

View File

@ -15,7 +15,7 @@
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Localisation.h>
#define WINDOW_TITLE STR_SHORTCUT_CHANGE_TITLE
static constexpr const rct_string_id WINDOW_TITLE = STR_SHORTCUT_CHANGE_TITLE;
constexpr int32_t WW = 250;
constexpr int32_t WH = 60;

View File

@ -15,7 +15,7 @@
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Localisation.h>
#define WINDOW_TITLE STR_SHORTCUTS_TITLE
static constexpr const rct_string_id WINDOW_TITLE = STR_SHORTCUTS_TITLE;
constexpr int32_t WW = 420;
constexpr int32_t WH = 280;

View File

@ -25,7 +25,7 @@
#include <openrct2/world/Scenery.h>
#include <openrct2/world/Wall.h>
#define WINDOW_TITLE STR_SIGN
static constexpr const rct_string_id WINDOW_TITLE = STR_SIGN;
constexpr int32_t WW = 113;
constexpr int32_t WH = 96;

View File

@ -31,7 +31,7 @@
#include <openrct2/world/Park.h>
#include <openrct2/world/Sprite.h>
#define WINDOW_TITLE STR_STRINGID
static constexpr const rct_string_id WINDOW_TITLE = STR_STRINGID;
constexpr int32_t WW = 190;
constexpr int32_t WH = 180;

View File

@ -16,7 +16,7 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/world/Sprite.h>
#define WINDOW_TITLE STR_SACK_STAFF
static constexpr const rct_string_id WINDOW_TITLE = STR_SACK_STAFF;
constexpr int32_t WW = 200;
constexpr int32_t WH = 100;

View File

@ -104,7 +104,7 @@ enum WINDOW_STAFF_LIST_WIDGET_IDX {
WIDX_STAFF_LIST_MAP,
};
#define WINDOW_TITLE STR_STAFF
static constexpr const rct_string_id WINDOW_TITLE = STR_STAFF;
constexpr int32_t WW = 320;
constexpr int32_t WH = 270;
constexpr int32_t MAX_WW = 500;

View File

@ -25,7 +25,7 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/util/Util.h>
#define WINDOW_TITLE STR_OPTIONS
static constexpr const rct_string_id WINDOW_TITLE = STR_OPTIONS;
constexpr int32_t WW = 250;
constexpr int32_t WH = 90;

View File

@ -203,7 +203,7 @@ enum WINDOW_TILE_INSPECTOR_WIDGET_IDX {
WIDX_CORRUPT_BUTTON_CLAMP,
};
#define WINDOW_TITLE STR_TILE_INSPECTOR_TITLE
static constexpr const rct_string_id WINDOW_TITLE = STR_TILE_INSPECTOR_TITLE;
// Window sizes
constexpr int32_t WW = 400;

View File

@ -24,9 +24,9 @@
#include <openrct2/util/Util.h>
#include <vector>
#define WINDOW_TITLE STR_SELECT_SCENARIO
#define WW 734
#define WH 334
static constexpr const rct_string_id WINDOW_TITLE = STR_SELECT_SCENARIO;
static constexpr const int32_t WW = 734;
static constexpr const int32_t WH = 334;
#define INITIAL_NUM_UNLOCKED_SCENARIOS 5
// clang-format off

View File

@ -16,9 +16,9 @@
#include <openrct2/ride/TrackDesignRepository.h>
#include <openrct2/util/Util.h>
#define WINDOW_TITLE STR_STRING
#define WH 44
#define WW 250
static constexpr const rct_string_id WINDOW_TITLE = STR_STRING;
static constexpr const int32_t WH = 44;
static constexpr const int32_t WW = 250;
#pragma region Widgets

View File

@ -32,9 +32,9 @@
using namespace OpenRCT2;
#define WINDOW_TITLE STR_STRING
#define WH 124
#define WW 200
static constexpr const rct_string_id WINDOW_TITLE = STR_STRING;
static constexpr const int32_t WH = 124;
static constexpr const int32_t WW = 200;
constexpr int16_t TRACK_MINI_PREVIEW_WIDTH = 168;
constexpr int16_t TRACK_MINI_PREVIEW_HEIGHT = 78;
constexpr uint16_t TRACK_MINI_PREVIEW_SIZE = TRACK_MINI_PREVIEW_WIDTH * TRACK_MINI_PREVIEW_HEIGHT;

View File

@ -24,9 +24,9 @@
#include <openrct2/windows/Intent.h>
#include <vector>
#define WINDOW_TITLE STR_SELECT_DESIGN
#define WH 431
#define WW 600
static constexpr const rct_string_id WINDOW_TITLE = STR_SELECT_DESIGN;
static constexpr const int32_t WH = 431;
static constexpr const int32_t WW = 600;
// clang-format off
enum {

View File

@ -15,9 +15,9 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#define WINDOW_TITLE STR_VIEWPORT_NO
#define WH 0
#define WW 0
static constexpr const rct_string_id WINDOW_TITLE = STR_VIEWPORT_NO;
static constexpr const int32_t WH = 0;
static constexpr const int32_t WW = 0;
constexpr int32_t INITIAL_WIDTH = 500;
constexpr int32_t INITIAL_HEIGHT = 350;

View File

@ -16,9 +16,9 @@
#include <openrct2/localisation/Localisation.h>
#include <openrct2/world/Park.h>
#define WINDOW_TITLE STR_WATER
#define WH 77
#define WW 76
static constexpr const rct_string_id WINDOW_TITLE = STR_WATER;
static constexpr const int32_t WH = 77;
static constexpr const int32_t WW = 76;
// clang-format off
enum WINDOW_WATER_WIDGET_IDX {