diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index 318957bb00..f4b2b6a108 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -64,7 +64,7 @@ static utf8 * _rct2DataPath = nullptr; static bool _silentBreakpad = false; // clang-format off -static const CommandLineOptionDefinition StandardOptions[] +static constexpr const CommandLineOptionDefinition StandardOptions[] { { CMDLINE_TYPE_SWITCH, &_help, 'h', "help", "show this help message and exit" }, { CMDLINE_TYPE_SWITCH, &_version, 'v', "version", "show version information and exit" }, @@ -99,7 +99,7 @@ static exitcode_t HandleCommandScanObjects(CommandLineArgEnumerator * enumerator static bool _removeShell = false; -static const CommandLineOptionDefinition RegisterShellOptions[] +static constexpr const CommandLineOptionDefinition RegisterShellOptions[] { { CMDLINE_TYPE_SWITCH, &_removeShell, 'd', "remove", "remove shell integration" }, }; diff --git a/src/openrct2/cmdline/ScreenshotCommands.cpp b/src/openrct2/cmdline/ScreenshotCommands.cpp index 7985ecae14..a1736e963e 100644 --- a/src/openrct2/cmdline/ScreenshotCommands.cpp +++ b/src/openrct2/cmdline/ScreenshotCommands.cpp @@ -20,7 +20,7 @@ static ScreenshotOptions options; // clang-format off -static const CommandLineOptionDefinition ScreenshotOptionsDef[] +static constexpr const CommandLineOptionDefinition ScreenshotOptionsDef[] { { CMDLINE_TYPE_INTEGER, &options.weather, NAC, "weather", "weather to be used (0 = default, 1 = sunny, ..., 6 = thunder)." }, { CMDLINE_TYPE_SWITCH, &options.hide_guests, NAC, "no-peeps", "hide peeps" }, diff --git a/src/openrct2/cmdline/SpriteCommands.cpp b/src/openrct2/cmdline/SpriteCommands.cpp index 8d6f6af9ba..e23b70ad78 100644 --- a/src/openrct2/cmdline/SpriteCommands.cpp +++ b/src/openrct2/cmdline/SpriteCommands.cpp @@ -31,7 +31,7 @@ sint32 gSpriteMode = 0; static const char * _mode; // clang-format off -static const CommandLineOptionDefinition SpriteOptions[] +static constexpr const CommandLineOptionDefinition SpriteOptions[] { { CMDLINE_TYPE_STRING, &_mode, 'm', "mode", "the type of sprite conversion <" SZ_DEFAULT "|" SZ_CLOSEST "|" SZ_DITHERING ">" }, OptionTableEnd diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index c453f8f5a1..9e22c021b0 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -23,7 +23,7 @@ #include "Font.h" #include "TTF.h" -static const sint32 SpriteFontLineHeight[] = { 6, 10, 10, 18 }; +static constexpr const sint32 SpriteFontLineHeight[] = { 6, 10, 10, 18 }; static uint8 _spriteFontCharacterWidths[896]; diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 186d3ebfd8..5591dc8a16 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -729,7 +729,7 @@ void lightfx_add_lights_magic_vehicles() place_y = vehicle->y; place_z = vehicle->z; - static const sint16 offsetLookup[32] = { 10, 10, 9, 8, 7, 6, 4, 2, 0, -2, -4, -6, -7, -8, -9, -10, -10, -10, -9, -8, -7, -6, -4, -2, 0, 2, 4, 6, 7, 8, 9, 10 }; + static constexpr const sint16 offsetLookup[32] = { 10, 10, 9, 8, 7, 6, 4, 2, 0, -2, -4, -6, -7, -8, -9, -10, -10, -10, -9, -8, -7, -6, -4, -2, 0, 2, 4, 6, 7, 8, 9, 10 }; Ride *ride = get_ride(vehicle->ride); switch (ride->type) { diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index abec1f1e42..efbf26f0e7 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -160,7 +160,7 @@ extern bool TempForScrollText; #define SCROLL_POS(x, y) ((y * 64) + x) // clang-format off -static const sint16 _scrollpos0[] = { +static constexpr const sint16 _scrollpos0[] = { SCROLL_POS( 35, 12 ), SCROLL_POS( 36, 12 ), SCROLL_POS( 37, 11 ), @@ -187,7 +187,7 @@ static const sint16 _scrollpos0[] = { SCROLL_POS( 58, 1 ), -1, }; -static const sint16 _scrollpos1[] = { +static constexpr const sint16 _scrollpos1[] = { SCROLL_POS( 5, 1 ), SCROLL_POS( 6, 1 ), SCROLL_POS( 7, 2 ), @@ -214,7 +214,7 @@ static const sint16 _scrollpos1[] = { SCROLL_POS( 28, 12 ), -1, }; -static const sint16 _scrollpos2[] = { +static constexpr const sint16 _scrollpos2[] = { SCROLL_POS( 12, 1 ), SCROLL_POS( 13, 1 ), SCROLL_POS( 14, 2 ), @@ -256,7 +256,7 @@ static const sint16 _scrollpos2[] = { SCROLL_POS( 50, 1 ), -1, }; -static const sint16 _scrollpos3[] = { +static constexpr const sint16 _scrollpos3[] = { SCROLL_POS( 16, 0 ), SCROLL_POS( 17, 1 ), SCROLL_POS( 18, 1 ), @@ -292,7 +292,7 @@ static const sint16 _scrollpos3[] = { SCROLL_POS( 48, 16 ), -1, }; -static const sint16 _scrollpos4[] = { +static constexpr const sint16 _scrollpos4[] = { SCROLL_POS( 15, 17 ), SCROLL_POS( 16, 17 ), SCROLL_POS( 17, 16 ), @@ -329,7 +329,7 @@ static const sint16 _scrollpos4[] = { SCROLL_POS( 48, 0 ), -1, }; -static const sint16 _scrollpos5[] = { +static constexpr const sint16 _scrollpos5[] = { SCROLL_POS( 4, 12 ), SCROLL_POS( 5, 12 ), SCROLL_POS( 6, 11 ), @@ -356,7 +356,7 @@ static const sint16 _scrollpos5[] = { SCROLL_POS( 27, 1 ), -1, }; -static const sint16 _scrollpos6[] = { +static constexpr const sint16 _scrollpos6[] = { SCROLL_POS( 36, 1 ), SCROLL_POS( 37, 1 ), SCROLL_POS( 38, 2 ), @@ -383,7 +383,7 @@ static const sint16 _scrollpos6[] = { SCROLL_POS( 59, 12 ), -1, }; -static const sint16 _scrollpos7[] = { +static constexpr const sint16 _scrollpos7[] = { SCROLL_POS( 8, 11 ), SCROLL_POS( 9, 11 ), SCROLL_POS( 10, 10 ), @@ -408,7 +408,7 @@ static const sint16 _scrollpos7[] = { SCROLL_POS( 29, 1 ), -1, }; -static const sint16 _scrollpos8[] = { +static constexpr const sint16 _scrollpos8[] = { SCROLL_POS( 36, 2 ), SCROLL_POS( 37, 2 ), SCROLL_POS( 38, 3 ), @@ -431,7 +431,7 @@ static const sint16 _scrollpos8[] = { SCROLL_POS( 55, 11 ), -1, }; -static const sint16 _scrollpos9[] = { +static constexpr const sint16 _scrollpos9[] = { SCROLL_POS( 11, 9 ), SCROLL_POS( 12, 9 ), SCROLL_POS( 13, 9 ), @@ -453,7 +453,7 @@ static const sint16 _scrollpos9[] = { SCROLL_POS( 29, 1 ), -1, }; -static const sint16 _scrollpos10[] = { +static constexpr const sint16 _scrollpos10[] = { SCROLL_POS( 34, 1 ), SCROLL_POS( 35, 2 ), SCROLL_POS( 36, 3 ), @@ -475,7 +475,7 @@ static const sint16 _scrollpos10[] = { SCROLL_POS( 52, 9 ), -1, }; -static const sint16 _scrollpos11[] = { +static constexpr const sint16 _scrollpos11[] = { SCROLL_POS( 14, 10 ), SCROLL_POS( 15, 9 ), SCROLL_POS( 16, 9 ), @@ -499,7 +499,7 @@ static const sint16 _scrollpos11[] = { SCROLL_POS( 34, 0 ), -1, }; -static const sint16 _scrollpos12[] = { +static constexpr const sint16 _scrollpos12[] = { SCROLL_POS( 33, 1 ), SCROLL_POS( 34, 2 ), SCROLL_POS( 35, 2 ), @@ -523,7 +523,7 @@ static const sint16 _scrollpos12[] = { SCROLL_POS( 53, 11 ), -1, }; -static const sint16 _scrollpos13[] = { +static constexpr const sint16 _scrollpos13[] = { SCROLL_POS( 12, 11 ), SCROLL_POS( 13, 10 ), SCROLL_POS( 14, 10 ), @@ -546,7 +546,7 @@ static const sint16 _scrollpos13[] = { SCROLL_POS( 31, 1 ), -1, }; -static const sint16 _scrollpos14[] = { +static constexpr const sint16 _scrollpos14[] = { SCROLL_POS( 33, 1 ), SCROLL_POS( 34, 2 ), SCROLL_POS( 35, 2 ), @@ -570,7 +570,7 @@ static const sint16 _scrollpos14[] = { SCROLL_POS( 53, 11 ), -1, }; -static const sint16 _scrollpos15[] = { +static constexpr const sint16 _scrollpos15[] = { SCROLL_POS( 10, 10 ), SCROLL_POS( 11, 10 ), SCROLL_POS( 12, 9 ), @@ -595,7 +595,7 @@ static const sint16 _scrollpos15[] = { SCROLL_POS( 31, 0 ), -1, }; -static const sint16 _scrollpos16[] = { +static constexpr const sint16 _scrollpos16[] = { SCROLL_POS( 33, 0 ), SCROLL_POS( 34, 0 ), SCROLL_POS( 35, 1 ), @@ -620,7 +620,7 @@ static const sint16 _scrollpos16[] = { SCROLL_POS( 54, 10 ), -1, }; -static const sint16 _scrollpos17[] = { +static constexpr const sint16 _scrollpos17[] = { SCROLL_POS( 6, 11 ), SCROLL_POS( 7, 11 ), SCROLL_POS( 8, 10 ), @@ -647,7 +647,7 @@ static const sint16 _scrollpos17[] = { SCROLL_POS( 29, 0 ), -1, }; -static const sint16 _scrollpos18[] = { +static constexpr const sint16 _scrollpos18[] = { SCROLL_POS( 34, 0 ), SCROLL_POS( 35, 0 ), SCROLL_POS( 36, 1 ), @@ -674,7 +674,7 @@ static const sint16 _scrollpos18[] = { SCROLL_POS( 57, 11 ), -1, }; -static const sint16 _scrollpos19[] = { +static constexpr const sint16 _scrollpos19[] = { SCROLL_POS( 13, 1 ), SCROLL_POS( 14, 1 ), SCROLL_POS( 15, 2 ), @@ -716,7 +716,7 @@ static const sint16 _scrollpos19[] = { SCROLL_POS( 51, 1 ), -1, }; -static const sint16 _scrollpos20[] = { +static constexpr const sint16 _scrollpos20[] = { SCROLL_POS( 12, 1 ), SCROLL_POS( 13, 3 ), SCROLL_POS( 14, 4 ), @@ -757,7 +757,7 @@ static const sint16 _scrollpos20[] = { SCROLL_POS( 49, 3 ), -1, }; -static const sint16 _scrollpos21[] = { +static constexpr const sint16 _scrollpos21[] = { SCROLL_POS( 12, 1 ), SCROLL_POS( 13, 1 ), SCROLL_POS( 14, 2 ), @@ -798,7 +798,7 @@ static const sint16 _scrollpos21[] = { SCROLL_POS( 49, 1 ), -1, }; -static const sint16 _scrollpos22[] = { +static constexpr const sint16 _scrollpos22[] = { SCROLL_POS( 16, 1 ), SCROLL_POS( 17, 1 ), SCROLL_POS( 18, 2 ), @@ -834,7 +834,7 @@ static const sint16 _scrollpos22[] = { SCROLL_POS( 48, 1 ), -1, }; -static const sint16 _scrollpos23[] = { +static constexpr const sint16 _scrollpos23[] = { SCROLL_POS( 15, 1 ), SCROLL_POS( 16, 2 ), SCROLL_POS( 17, 2 ), @@ -871,7 +871,7 @@ static const sint16 _scrollpos23[] = { SCROLL_POS( 48, 1 ), -1, }; -static const sint16 _scrollpos24[] = { +static constexpr const sint16 _scrollpos24[] = { SCROLL_POS( 8, 9 ), SCROLL_POS( 9, 9 ), SCROLL_POS( 10, 8 ), @@ -894,7 +894,7 @@ static const sint16 _scrollpos24[] = { SCROLL_POS( 27, 0 ), -1, }; -static const sint16 _scrollpos25[] = { +static constexpr const sint16 _scrollpos25[] = { SCROLL_POS( 36, 0 ), SCROLL_POS( 37, 0 ), SCROLL_POS( 38, 1 ), @@ -917,7 +917,7 @@ static const sint16 _scrollpos25[] = { SCROLL_POS( 55, 9 ), -1, }; -static const sint16 _scrollpos26[] = { +static constexpr const sint16 _scrollpos26[] = { SCROLL_POS( 4, 13 ), SCROLL_POS( 5, 13 ), SCROLL_POS( 6, 12 ), @@ -948,7 +948,7 @@ static const sint16 _scrollpos26[] = { SCROLL_POS( 31, 0 ), -1, }; -static const sint16 _scrollpos27[] = { +static constexpr const sint16 _scrollpos27[] = { SCROLL_POS( 32, 0 ), SCROLL_POS( 33, 0 ), SCROLL_POS( 34, 1 ), @@ -979,7 +979,7 @@ static const sint16 _scrollpos27[] = { SCROLL_POS( 59, 13 ), -1, }; -static const sint16 _scrollpos28[] = { +static constexpr const sint16 _scrollpos28[] = { SCROLL_POS( 6, 13 ), SCROLL_POS( 7, 13 ), SCROLL_POS( 8, 12 ), @@ -1010,7 +1010,7 @@ static const sint16 _scrollpos28[] = { SCROLL_POS( 33, 0 ), -1, }; -static const sint16 _scrollpos29[] = { +static constexpr const sint16 _scrollpos29[] = { SCROLL_POS( 30, 0 ), SCROLL_POS( 31, 0 ), SCROLL_POS( 32, 1 ), @@ -1041,7 +1041,7 @@ static const sint16 _scrollpos29[] = { SCROLL_POS( 57, 13 ), -1, }; -static const sint16 _scrollpos30[] = { +static constexpr const sint16 _scrollpos30[] = { SCROLL_POS( 2, 30 ), SCROLL_POS( 3, 30 ), SCROLL_POS( 4, 29 ), @@ -1105,7 +1105,7 @@ static const sint16 _scrollpos30[] = { SCROLL_POS( 62, 0 ), -1, }; -static const sint16 _scrollpos31[] = { +static constexpr const sint16 _scrollpos31[] = { SCROLL_POS( 1, 0 ), SCROLL_POS( 2, 1 ), SCROLL_POS( 3, 1 ), @@ -1169,7 +1169,7 @@ static const sint16 _scrollpos31[] = { SCROLL_POS( 61, 30 ), -1, }; -static const sint16 _scrollpos32[] = { +static constexpr const sint16 _scrollpos32[] = { SCROLL_POS( 12, 0 ), SCROLL_POS( 13, 1 ), SCROLL_POS( 14, 1 ), @@ -1211,7 +1211,7 @@ static const sint16 _scrollpos32[] = { SCROLL_POS( 50, 19 ), -1, }; -static const sint16 _scrollpos33[] = { +static constexpr const sint16 _scrollpos33[] = { SCROLL_POS( 12, 20 ), SCROLL_POS( 13, 20 ), SCROLL_POS( 14, 19 ), @@ -1254,7 +1254,7 @@ static const sint16 _scrollpos33[] = { SCROLL_POS( 51, 1 ), -1, }; -static const sint16 _scrollpos34[] = { +static constexpr const sint16 _scrollpos34[] = { SCROLL_POS( 2, 14 ), SCROLL_POS( 3, 14 ), SCROLL_POS( 4, 13 ), @@ -1286,7 +1286,7 @@ static const sint16 _scrollpos34[] = { SCROLL_POS( 30, 0 ), -1, }; -static const sint16 _scrollpos35[] = { +static constexpr const sint16 _scrollpos35[] = { SCROLL_POS( 33, 0 ), SCROLL_POS( 34, 0 ), SCROLL_POS( 35, 1 ), @@ -1318,7 +1318,7 @@ static const sint16 _scrollpos35[] = { SCROLL_POS( 61, 14 ), -1, }; -static const sint16 _scrollpos36[] = { +static constexpr const sint16 _scrollpos36[] = { SCROLL_POS( 4, 0 ), SCROLL_POS( 5, 1 ), SCROLL_POS( 6, 2 ), @@ -1348,7 +1348,7 @@ static const sint16 _scrollpos36[] = { SCROLL_POS( 30, 12 ), -1, }; -static const sint16 _scrollpos37[] = { +static constexpr const sint16 _scrollpos37[] = { SCROLL_POS( 32, 13 ), SCROLL_POS( 33, 12 ), SCROLL_POS( 34, 12 ), @@ -1379,7 +1379,7 @@ static const sint16 _scrollpos37[] = { -1, }; -static const sint16* _scrollPositions[MAX_SCROLLING_TEXT_MODES] = { +static constexpr const sint16* _scrollPositions[MAX_SCROLLING_TEXT_MODES] = { _scrollpos0, _scrollpos1, _scrollpos2, diff --git a/src/openrct2/interface/Console.cpp b/src/openrct2/interface/Console.cpp index d45f711b5b..4c7a6a69e7 100644 --- a/src/openrct2/interface/Console.cpp +++ b/src/openrct2/interface/Console.cpp @@ -1393,7 +1393,7 @@ typedef struct console_command { const utf8 * usage; } console_command; -static const utf8* console_variable_table[] = { +static constexpr const utf8* console_variable_table[] = { "park_rating", "park_value", "company_value", @@ -1432,7 +1432,7 @@ static const utf8* console_variable_table[] = { "cheat_disable_clearance_checks", "cheat_disable_support_limits", }; -static const utf8* console_window_table[] = { +static constexpr const utf8* console_window_table[] = { "object_selection", "inventions_list", "scenario_options", @@ -1441,7 +1441,7 @@ static const utf8* console_window_table[] = { "title_sequences" }; -static const console_command console_command_table[] = { +static constexpr const console_command console_command_table[] = { { "clear", cc_clear, "Clears the console.", "clear"}, { "hide", cc_hide, "Hides the console.", "hide"}, { "echo", cc_echo, "Echoes the text to the console.", "echo " }, diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 1bbcdf8e46..1ec7ba0d0d 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -68,7 +68,7 @@ colour_t gCurrentWindowColours[4]; // converted from uint16 values at 0x009A41EC - 0x009A4230 // these are percentage coordinates of the viewport to centre to, if a window is obscuring a location, the next is tried -static const float window_scroll_locations[][2] = { +static constexpr const float window_scroll_locations[][2] = { {0.5f, 0.5f}, {0.75f, 0.5f}, {0.25f, 0.5f}, diff --git a/src/openrct2/localisation/FormatCodes.cpp b/src/openrct2/localisation/FormatCodes.cpp index 5470dd2cb8..e5900c5a23 100644 --- a/src/openrct2/localisation/FormatCodes.cpp +++ b/src/openrct2/localisation/FormatCodes.cpp @@ -27,7 +27,7 @@ typedef struct format_code_token { } format_code_token; // clang-format off -static const format_code_token format_code_tokens[] = { +static constexpr const format_code_token format_code_tokens[] = { { FORMAT_MOVE_X, "MOVE_X" }, { FORMAT_ADJUST_PALETTE, "ADJUST_PALETTE" }, { FORMAT_NEWLINE, "NEWLINE" }, diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index a34ee68db6..1dc960d701 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -825,7 +825,7 @@ static void format_velocity(char **dest, size_t *size, uint16 value) format_string_part(dest, size, stringId, (char**)&argRef); } -static const rct_string_id DurationFormats[][2] = { +static constexpr const rct_string_id DurationFormats[][2] = { {STR_DURATION_SEC, STR_DURATION_SECS}, {STR_DURATION_MIN_SEC, STR_DURATION_MIN_SECS}, {STR_DURATION_MINS_SEC, STR_DURATION_MINS_SECS}, @@ -858,7 +858,7 @@ static void format_duration(char **dest, size_t *size, uint16 value) format_string_part(dest, size, stringId, (char**)&argsRef); } -static const rct_string_id RealtimeFormats[][2] = { +static constexpr const rct_string_id RealtimeFormats[][2] = { {STR_REALTIME_MIN, STR_REALTIME_MINS}, {STR_REALTIME_HOUR_MIN, STR_REALTIME_HOUR_MINS}, {STR_REALTIME_HOURS_MIN, STR_REALTIME_HOURS_MINS}, diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index bc538086e5..450b596f3f 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -22,7 +22,7 @@ #include "tile_element/TileElement.h" #include "VirtualFloor.h" -static const rct_xy_element offsets[4] = +static constexpr const rct_xy_element offsets[4] = { { -32, 0 }, { 0, 32 }, diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index 9ddcee781f..2ed2b64015 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -28,7 +28,7 @@ namespace RCT1 { colour_t GetColour(colour_t colour) { - static const uint8 map[] = + static constexpr const uint8 map[] = { COLOUR_BLACK, COLOUR_GREY, @@ -73,7 +73,7 @@ namespace RCT1 uint8 GetPeepSpriteType(uint8 rct1SpriteType) { - static const uint8 map[] = + static constexpr const uint8 map[] = { PEEP_SPRITE_TYPE_NORMAL, // 0x00 PEEP_SPRITE_TYPE_HANDYMAN, // 0x01 @@ -121,7 +121,7 @@ namespace RCT1 uint8 GetTerrain(uint8 terrain) { - static const uint8 map[] = + static constexpr const uint8 map[] = { TERRAIN_GRASS, TERRAIN_SAND, @@ -146,7 +146,7 @@ namespace RCT1 uint8 GetTerrainEdge(uint8 terrainEdge) { - static const uint8 map[] = + static constexpr const uint8 map[] = { TERRAIN_EDGE_ROCK, TERRAIN_EDGE_BRICK, @@ -423,7 +423,7 @@ namespace RCT1 uint8 GetVehicleSubEntryIndex(uint8 vehicleSubEntry) { - static const uint8 map[] = + static constexpr const uint8 map[] = { 0, // STEEL_RC_FRONT 1, // STEEL_RC_CARRIAGE @@ -687,7 +687,7 @@ namespace RCT1 const char * GetRideTypeObject(uint8 rideType) { - static const char * map[] = + static constexpr const char * map[] = { "PTCT1 ", // RCT1_RIDE_TYPE_WOODEN_ROLLER_COASTER "TOGST ", // RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER @@ -782,7 +782,7 @@ namespace RCT1 const char * GetVehicleObject(uint8 vehicleType) { - static const char * map[] = + static constexpr const char * map[] = { "SCHT1 ", // RCT1_VEHICLE_TYPE_STEEL_ROLLER_COASTER_TRAIN "SCHT1 ", // RCT1_VEHICLE_TYPE_STEEL_ROLLER_COASTER_TRAIN_BACKWARDS @@ -881,7 +881,7 @@ namespace RCT1 const char * GetSmallSceneryObject(uint8 smallSceneryType) { - static const char * map[] = + static constexpr const char * map[] = { "TL0 ", "TL1 ", @@ -1133,7 +1133,7 @@ namespace RCT1 const char * GetLargeSceneryObject(uint8 largeSceneryType) { - static const char * map[] = + static constexpr const char * map[] = { "SCOL ", "SHS1 ", @@ -1180,7 +1180,7 @@ namespace RCT1 const char * GetWallObject(uint8 wallType) { - static const char * map[] = + static constexpr const char * map[] = { "WMF ", "WMFG ", @@ -1284,7 +1284,7 @@ namespace RCT1 const char * GetPathObject(uint8 pathType) { - static const char * map[] = + static constexpr const char * map[] = { "TARMAC ", // RCT1_FOOTPATH_TYPE_QUEUE_BLUE "PATHSPCE", // RCT1_FOOTPATH_TYPE_QUEUE_RED @@ -1321,7 +1321,7 @@ namespace RCT1 const char * GetPathAddtionObject(uint8 pathAdditionType) { - static const char * map[] = + static constexpr const char * map[] = { " ", // RCT1_PATH_ADDITION_NONE "LAMP1 ", // RCT1_PATH_ADDITION_LAMP_1 @@ -1344,7 +1344,7 @@ namespace RCT1 const char * GetSceneryGroupObject(uint8 sceneryGroupType) { - static const char * map[] = + static constexpr const char * map[] = { " ", // RCT1_SCENERY_THEME_GENERAL "SCGMINE ", // RCT1_SCENERY_THEME_MINE @@ -1370,7 +1370,7 @@ namespace RCT1 const char * GetWaterObject(uint8 waterType) { - static const char * map[] = + static constexpr const char * map[] = { "WTRCYAN ", "WTRORNG ", diff --git a/src/openrct2/ride/RideGroupManager.cpp b/src/openrct2/ride/RideGroupManager.cpp index 2d5ff275a4..d42f09c2b1 100644 --- a/src/openrct2/ride/RideGroupManager.cpp +++ b/src/openrct2/ride/RideGroupManager.cpp @@ -97,11 +97,11 @@ static constexpr const RideGroup ride_group_spinning_wild_mouse = { /*.Naming =*/ { STR_SPINNING_WILD_MOUSE_GROUP, STR_SPINNING_WILD_MOUSE_GROUP_DESC }, }; -static const RideGroup corkscrew_rc_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_corkscrew_rc, ride_group_hypercoaster }; -static const RideGroup junior_rc_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_junior_rc, ride_group_classic_mini_coaster }; -static const RideGroup car_ride_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_car_ride, ride_group_monster_trucks }; -static const RideGroup twister_rc_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_steel_twister_rc, ride_group_hyper_twister }; -static const RideGroup steel_wild_mouse_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_steel_wild_mouse, ride_group_spinning_wild_mouse }; +static constexpr const RideGroup corkscrew_rc_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_corkscrew_rc, ride_group_hypercoaster }; +static constexpr const RideGroup junior_rc_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_junior_rc, ride_group_classic_mini_coaster }; +static constexpr const RideGroup car_ride_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_car_ride, ride_group_monster_trucks }; +static constexpr const RideGroup twister_rc_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_steel_twister_rc, ride_group_hyper_twister }; +static constexpr const RideGroup steel_wild_mouse_groups[MAX_RIDE_GROUPS_PER_RIDE_TYPE] = { ride_group_steel_wild_mouse, ride_group_spinning_wild_mouse }; const RideGroup * RideGroupManager::GetRideGroup(const uint8 rideType, const rct_ride_entry * rideEntry) { diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index b7bdacac88..1be9426f91 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -160,7 +160,7 @@ const uint32 trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile[4] = { SPR_TRACK_SUBMARINE_RIDE_MINI_HELICOPTERS_FLAT_QUARTER_TURN_1_TILE_SE_SW, }; -static const uint32 trackSpritesGhostTrainSpinningTunnel[2][2][4] = { +static constexpr const uint32 trackSpritesGhostTrainSpinningTunnel[2][2][4] = { { { SPR_GHOST_TRAIN_SPINNING_TUNNEL_BACK_SW_NE_FRAME_0, @@ -744,7 +744,7 @@ bool track_paint_util_draw_station_covers_2(paint_session * session, enum edge_t return false; } - static const sint16 heights[][2] = { + static constexpr const sint16 heights[][2] = { { 22, 0 }, { 30, 0 }, { 46, 0 }, @@ -976,7 +976,7 @@ const LocationXYZ16 defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2] = { }; // clang-format on -static const sint8 right_helix_up_small_quarter_tiles_sprite_map[] = { 0, -1, 1, 2 }; +static constexpr const sint8 right_helix_up_small_quarter_tiles_sprite_map[] = { 0, -1, 1, 2 }; void track_paint_util_right_helix_up_small_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, @@ -1079,7 +1079,7 @@ const LocationXY16 defaultRightHelixUpLargeQuarterBoundLengths[4][5][2] = { }; // clang-format on -static const sint8 right_helix_up_large_quarter_sprite_map[] = { 0, -1, 1, 2, -1, 3, 4 }; +static constexpr const sint8 right_helix_up_large_quarter_sprite_map[] = { 0, -1, 1, 2, -1, 3, 4 }; void track_paint_util_right_helix_up_large_quarter_tiles_paint(paint_session * session, const sint8 thickness[2], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5][2], @@ -1256,7 +1256,7 @@ const sint8 defaultEighthToDiagThickness[4][4] = { const uint8 mapLeftEighthTurnToOrthogonal[] = { 4, 2, 3, 1, 0 }; -static const sint8 eighth_to_diag_sprite_map[] = { 0, 1, 2, -1, 3 }; +static constexpr const sint8 eighth_to_diag_sprite_map[] = { 0, 1, 2, -1, 3 }; void track_paint_util_eighth_to_diag_tiles_paint(paint_session * session, const sint8 thickness[4][4], sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][4], const LocationXY16 offsets[4][4], @@ -1293,7 +1293,7 @@ const LocationXY16 defaultDiagBoundLengths[4] = { { 32, 32 }, }; -static const sint8 diag_sprite_map[4][4] = { +static constexpr const sint8 diag_sprite_map[4][4] = { { -1, 0, -1, -1 }, { -1, -1, -1, 0 }, { -1, -1, 0, -1 }, @@ -1418,7 +1418,7 @@ const LocationXY16 defaultRightQuarterTurn5TilesBoundLengths[4][5] = { }; // clang-format on -static const sint8 right_quarter_turn_5_tiles_sprite_map[] = { 0, -1, 1, 2, -1, 3, 4 }; +static constexpr const sint8 right_quarter_turn_5_tiles_sprite_map[] = { 0, -1, 1, 2, -1, 3, 4 }; void track_paint_util_right_quarter_turn_5_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], const LocationXY16 offsets[4][5], @@ -1500,7 +1500,7 @@ void track_paint_util_right_quarter_turn_5_tiles_wooden_supports(paint_session * { if (trackSequence != 1 && trackSequence != 4) { - static const uint8 supportTypes[][7] = { + static constexpr const uint8 supportTypes[][7] = { { 0, 0xFF, 4, 2, 0xFF, 4, 1 }, { 1, 0xFF, 5, 3, 0xFF, 5, 0 }, { 0, 0xFF, 2, 4, 0xFF, 2, 1 }, @@ -1584,7 +1584,7 @@ const LocationXY16 defaultRightQuarterTurn3TilesBoundLengths[4][3] = { }; // clang-format on -static const sint8 right_quarter_turn_3_tiles_sprite_map[] = { 0, -1, 1, 2 }; +static constexpr const sint8 right_quarter_turn_3_tiles_sprite_map[] = { 0, -1, 1, 2 }; void track_paint_util_right_quarter_turn_3_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], const LocationXY16 offsets[4][3], @@ -1790,7 +1790,7 @@ void track_paint_util_right_quarter_turn_3_tiles_25_deg_down_tunnel(paint_sessio } } -static const sint8 left_quarter_turn_3_tiles_sprite_map[] = { 2, -1, 1, 0 }; +static constexpr const sint8 left_quarter_turn_3_tiles_sprite_map[] = { 2, -1, 1, 0 }; void track_paint_util_left_quarter_turn_3_tiles_paint(paint_session * session, sint8 thickness, sint16 height, sint32 direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation) @@ -2003,7 +2003,7 @@ void track_paint_util_spinning_tunnel_paint(paint_session * session, sint8 thick void track_paint_util_onride_photo_small_paint(paint_session * session, uint8 direction, sint32 height, rct_tile_element * tileElement) { - static const uint32 imageIds[4][3] = { + static constexpr const uint32 imageIds[4][3] = { { SPR_ON_RIDE_PHOTO_SIGN_SMALL_SW_NE, SPR_ON_RIDE_PHOTO_CAMERA_SMALL_S, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_SMALL_S }, { SPR_ON_RIDE_PHOTO_SIGN_SMALL_NW_SE, SPR_ON_RIDE_PHOTO_CAMERA_SMALL_W, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_SMALL_W }, { SPR_ON_RIDE_PHOTO_SIGN_SMALL_NE_SW, SPR_ON_RIDE_PHOTO_CAMERA_SMALL_N, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_SMALL_N }, @@ -2041,7 +2041,7 @@ void track_paint_util_onride_photo_small_paint(paint_session * session, uint8 di void track_paint_util_onride_photo_paint(paint_session * session, uint8 direction, sint32 height, rct_tile_element * tileElement) { - static const uint32 imageIds[4][3] = { + static constexpr const uint32 imageIds[4][3] = { { SPR_ON_RIDE_PHOTO_SIGN_SW_NE, SPR_ON_RIDE_PHOTO_CAMERA_S, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_S }, { SPR_ON_RIDE_PHOTO_SIGN_NW_SE, SPR_ON_RIDE_PHOTO_CAMERA_W, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_W }, { SPR_ON_RIDE_PHOTO_SIGN_NE_SW, SPR_ON_RIDE_PHOTO_CAMERA_N, SPR_ON_RIDE_PHOTO_CAMERA_FLASH_N }, @@ -2076,7 +2076,7 @@ void track_paint_util_onride_photo_paint(paint_session * session, uint8 directio } } -static const uint16 RightVerticalLoopSegments[] = { +static constexpr const uint16 RightVerticalLoopSegments[] = { SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, diff --git a/src/openrct2/ride/VehiclePaint.cpp b/src/openrct2/ride/VehiclePaint.cpp index da5dd7a0c7..6e243db3b7 100644 --- a/src/openrct2/ride/VehiclePaint.cpp +++ b/src/openrct2/ride/VehiclePaint.cpp @@ -2785,7 +2785,7 @@ static void vehicle_sprite_59(paint_session * session, rct_vehicle * vehicle, si typedef void (*vehicle_sprite_func)(paint_session * session, rct_vehicle * vehicle, sint32 imageDirection, sint32 z, const rct_ride_entry_vehicle * vehicleEntry); // clang-format off -static const vehicle_sprite_func vehicle_sprite_funcs[] = { +static constexpr const vehicle_sprite_func vehicle_sprite_funcs[] = { vehicle_sprite_0, vehicle_sprite_1, vehicle_sprite_2, diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index 46f3f52356..4485d0ff40 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -1865,7 +1865,7 @@ static void junior_rc_right_quarter_turn_5_tiles_paint_setup(paint_session * ses paint_util_set_general_support_height(session, height + 32, 0x20); } -static const uint8 junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[] = { 6, 4, 5, 3, 1, 2, 0 }; +static constexpr const uint8 junior_rc_left_quarter_turn_5_tiles_to_right_turn_map[] = { 6, 4, 5, 3, 1, 2, 0 }; /* rct2: 0x0051917A */ static void junior_rc_left_quarter_turn_5_tiles_paint_setup(paint_session * session, uint8 rideIndex, uint8 trackSequence, diff --git a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp index 5a3f829c49..622f2d6940 100644 --- a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp @@ -107,7 +107,7 @@ static void mini_rc_track_flat(paint_session * session, uint8 rideIndex, uint8 t static void mini_rc_track_station(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_tile_element * tileElement) { - static const uint32 imageIds[4][3] = { + static constexpr const uint32 imageIds[4][3] = { { 18746, 18742, SPR_STATION_BASE_A_SW_NE }, { 18747, 18743, SPR_STATION_BASE_A_NW_SE }, { 18746, 18742, SPR_STATION_BASE_A_SW_NE }, diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index f0d43d949c..1ef7feb09d 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -701,7 +701,7 @@ static void wild_mouse_track_left_quarter_turn_3(paint_session * session, uint8 static void wild_mouse_track_left_quarter_turn_1(paint_session * session, uint8 rideIndex, uint8 trackSequence, uint8 direction, sint32 height, rct_tile_element * tileElement) { - static const uint32 imageIds[4] = { + static constexpr const uint32 imageIds[4] = { SPR_WILD_MOUSE_QUARTER_TURN_1_SW_NE, SPR_WILD_MOUSE_QUARTER_TURN_1_NW_SE, SPR_WILD_MOUSE_QUARTER_TURN_1_NE_SW, diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 6277ac8b80..eec52f6f05 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -187,7 +187,7 @@ enum SPR_MINI_GOLF_HOLE_E_TRIM_PART_3_SW_NW = 14556, }; -static const uint32 mini_golf_track_sprites_25_deg_up[][3] = { { +static constexpr const uint32 mini_golf_track_sprites_25_deg_up[][3] = { { SPR_MINI_GOLF_25_DEG_UP_SW_NE, SPR_MINI_GOLF_25_DEG_UP_FENCE_BACK_SW_NE, SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_SW_NE, @@ -208,7 +208,7 @@ static const uint32 mini_golf_track_sprites_25_deg_up[][3] = { { SPR_MINI_GOLF_25_DEG_UP_FENCE_FRONT_SE_NW, } }; -static const uint32 mini_golf_track_sprites_flat_to_25_deg_up[][3] = { { +static constexpr const uint32 mini_golf_track_sprites_flat_to_25_deg_up[][3] = { { SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_SW_NE, SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_BACK_SW_NE, SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_SW_NE, @@ -229,7 +229,7 @@ static const uint32 mini_golf_track_sprites_flat_to_25_deg_up[][3] = { { SPR_MINI_GOLF_FLAT_TO_25_DEG_UP_FENCE_FRONT_SE_NW, } }; -static const uint32 mini_golf_track_sprites_25_deg_up_to_flat[][3] = { { +static constexpr const uint32 mini_golf_track_sprites_25_deg_up_to_flat[][3] = { { SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_SW_NE, SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_BACK_SW_NE, SPR_MINI_GOLF_25_DEG_UP_TO_FLAT_FENCE_FRONT_SW_NE, diff --git a/src/openrct2/ride/thrill/GoKarts.cpp b/src/openrct2/ride/thrill/GoKarts.cpp index 6b8165d79d..1b83795e2a 100644 --- a/src/openrct2/ride/thrill/GoKarts.cpp +++ b/src/openrct2/ride/thrill/GoKarts.cpp @@ -95,14 +95,14 @@ enum SPR_GO_KARTS_START_LIGHTS_GREEN_SE_NW = 20819, }; -static const uint32 go_karts_track_pieces_starting_grid_end[4][2] = { +static constexpr const uint32 go_karts_track_pieces_starting_grid_end[4][2] = { { SPR_GO_KARTS_STARTING_GRID_END_SW_NE, SPR_GO_KARTS_STARTING_GRID_END_FRONT_SW_NE }, { SPR_GO_KARTS_STARTING_GRID_END_NW_SE, SPR_GO_KARTS_STARTING_GRID_END_FRONT_NW_SE }, { SPR_GO_KARTS_STARTING_GRID_END_NE_SW, SPR_GO_KARTS_STARTING_GRID_END_FRONT_NE_SW }, { SPR_GO_KARTS_STARTING_GRID_END_SE_NW, SPR_GO_KARTS_STARTING_GRID_END_FRONT_SE_NW }, }; -static const uint32 go_karts_track_pieces_starting_grid[4][2] = { +static constexpr const uint32 go_karts_track_pieces_starting_grid[4][2] = { { SPR_GO_KARTS_STARTING_GRID_SW_NE, SPR_GO_KARTS_STARTING_GRID_FRONT_SW_NE }, { SPR_GO_KARTS_STARTING_GRID_NW_SE, SPR_GO_KARTS_STARTING_GRID_FRONT_NW_SE }, { SPR_GO_KARTS_STARTING_GRID_NE_SW, SPR_GO_KARTS_STARTING_GRID_FRONT_NE_SW }, diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 895c381482..0fe6696782 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -31,7 +31,7 @@ enum SPR_LAUNCHED_FREEFALL_TOWER_SEGMENT_TOP = 14566, }; -static const uint32 launched_freefall_fence_sprites[] = { SPR_FENCE_METAL_NE, SPR_FENCE_METAL_SE, SPR_FENCE_METAL_SW, +static constexpr const uint32 launched_freefall_fence_sprites[] = { SPR_FENCE_METAL_NE, SPR_FENCE_METAL_SE, SPR_FENCE_METAL_SW, SPR_FENCE_METAL_NW }; /** diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 429e94973c..ddc205546a 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -141,7 +141,7 @@ enum SPR_MINIATURE_RAILWAY_DIAG_25_DEG_UP_S_N = 23452, }; -static const uint32 miniature_railway_track_floor[4] = { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS, +static constexpr const uint32 miniature_railway_track_floor[4] = { SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_90_DEG, SPR_FLOOR_PLANKS, SPR_FLOOR_PLANKS_90_DEG }; static constexpr const uint32 miniature_railway_track_pieces_flat[4] = { @@ -520,7 +520,7 @@ static constexpr const LocationXY16 miniature_railway_track_pieces_left_eight_to }, }; -static const uint32 miniature_railway_track_pieces_diag_flat[4] = { +static constexpr const uint32 miniature_railway_track_pieces_diag_flat[4] = { SPR_MINIATURE_RAILWAY_DIAG_FLAT_W_E, SPR_MINIATURE_RAILWAY_DIAG_FLAT_N_S, SPR_MINIATURE_RAILWAY_DIAG_FLAT_E_W, diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index 184e170650..8a82d3ba94 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -403,7 +403,7 @@ static constexpr const uint32 monorail_track_pieces_diag_flat[4] = { SPR_MONORAIL_DIAG_FLAT_S_N, }; -static const uint32 monorail_track_pieces_diag_flat_to_25_deg_up[4] = { +static constexpr const uint32 monorail_track_pieces_diag_flat_to_25_deg_up[4] = { SPR_MONORAIL_DIAG_FLAT_TO_25_DEG_UP_W_E, SPR_MONORAIL_DIAG_FLAT_TO_25_DEG_UP_N_S, SPR_MONORAIL_DIAG_FLAT_TO_25_DEG_UP_E_W, diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 52d2041b23..b88c68cd2c 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -57,14 +57,14 @@ const LocationXY16 word_981D6C[4] = { }; // rct2: 0x0097B974 -static const uint16 EntranceDirections[] = { +static constexpr const uint16 EntranceDirections[] = { (4 ), 0, 0, 0, 0, 0, 0, 0, // ENTRANCE_TYPE_RIDE_ENTRANCE, (4 ), 0, 0, 0, 0, 0, 0, 0, // ENTRANCE_TYPE_RIDE_EXIT, (4 | 1), 0, 0, 0, 0, 0, 0, 0, // ENTRANCE_TYPE_PARK_ENTRANCE }; /** rct2: 0x0098D7F0 */ -static const uint8 connected_path_count[] = { +static constexpr const uint8 connected_path_count[] = { 0, // 0b0000 1, // 0b0001 1, // 0b0010 @@ -172,7 +172,7 @@ static void loc_6A6620(sint32 flags, sint32 x, sint32 y, rct_tile_element *tileE } /** rct2: 0x0098D7EC */ -static const uint8 byte_98D7EC[] = { +static constexpr const uint8 byte_98D7EC[] = { 207, 159, 63, 111 }; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 06b82d331a..41869d6909 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1443,7 +1443,7 @@ void game_command_change_surface_style(sint32* eax, sint32* ebx, sint32* ecx, si } //0x00981A1E -static const uint8 tile_element_raise_styles[5][32] = { +static constexpr const uint8 tile_element_raise_styles[5][32] = { { 0x01, 0x1B, 0x03, 0x1B, 0x05, 0x21, 0x07, 0x21, 0x09, 0x1B, 0x0B, 0x1B, 0x0D, 0x21, 0x20, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x23, 0x18, 0x19, 0x1A, 0x3B, 0x1C, 0x29, 0x24, 0x1F }, { 0x02, 0x03, 0x17, 0x17, 0x06, 0x07, 0x17, 0x17, 0x0A, 0x0B, 0x22, 0x22, 0x0E, 0x20, 0x22, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x37, 0x18, 0x19, 0x1A, 0x23, 0x1C, 0x28, 0x26, 0x1F }, { 0x04, 0x05, 0x06, 0x07, 0x1E, 0x24, 0x1E, 0x24, 0x0C, 0x0D, 0x0E, 0x20, 0x1E, 0x24, 0x1E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x26, 0x18, 0x19, 0x1A, 0x21, 0x1C, 0x2C, 0x3E, 0x1F }, @@ -1452,7 +1452,7 @@ static const uint8 tile_element_raise_styles[5][32] = { }; //0x00981ABE -static const uint8 tile_element_lower_styles[5][32] = { +static constexpr const uint8 tile_element_lower_styles[5][32] = { { 0x2E, 0x00, 0x2E, 0x02, 0x3E, 0x04, 0x3E, 0x06, 0x2E, 0x08, 0x2E, 0x0A, 0x3E, 0x0C, 0x3E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x06, 0x18, 0x19, 0x1A, 0x0B, 0x1C, 0x0C, 0x3E, 0x1F }, { 0x2D, 0x2D, 0x00, 0x01, 0x2D, 0x2D, 0x04, 0x05, 0x3D, 0x3D, 0x08, 0x09, 0x3D, 0x3D, 0x0C, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x07, 0x18, 0x19, 0x1A, 0x09, 0x1C, 0x3D, 0x0C, 0x1F }, { 0x2B, 0x3B, 0x2B, 0x3B, 0x00, 0x01, 0x02, 0x03, 0x2B, 0x3B, 0x2B, 0x3B, 0x08, 0x09, 0x0A, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x03, 0x18, 0x19, 0x1A, 0x3B, 0x1C, 0x09, 0x0E, 0x1F }, diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index eadebb5e54..42ca624665 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -528,7 +528,7 @@ static bool map_animation_invalidate_wall(sint32 x, sint32 y, sint32 baseZ) * * rct2: 0x009819DC */ -static const map_animation_invalidate_event_handler _animatedObjectEventHandlers[MAP_ANIMATION_TYPE_COUNT] = { +static constexpr const map_animation_invalidate_event_handler _animatedObjectEventHandlers[MAP_ANIMATION_TYPE_COUNT] = { map_animation_invalidate_ride_entrance, map_animation_invalidate_queue_banner, map_animation_invalidate_small_scenery,