diff --git a/src/openrct2/actions/MazeSetTrackAction.hpp b/src/openrct2/actions/MazeSetTrackAction.hpp index 186c40ad4e..d0db3ea7f1 100644 --- a/src/openrct2/actions/MazeSetTrackAction.hpp +++ b/src/openrct2/actions/MazeSetTrackAction.hpp @@ -21,16 +21,32 @@ #include "../world/Park.h" #include "GameAction.h" +// clang-format off /** rct2: 0x00993CE9 */ static constexpr const uint8_t byte_993CE9[] = { - 0xFF, 0xE0, 0xFF, 14, 0, 1, 2, 6, 2, 4, 5, 9, 10, 6, 8, 12, 13, 14, 10, + 0xFF, 0xE0, 0xFF, + 14, 0, 1, 2, + 6, 2, 4, 5, + 9, 10, 6, 8, + 12, 13, 14, 10, }; /** rct2: 0x00993CFC */ -static constexpr const uint8_t byte_993CFC[] = { 5, 12, 0xFF, 0xFF, 9, 0, 0xFF, 0xFF, 13, 4, 0xFF, 0xFF, 1, 8, 0xFF, 0xFF }; +static constexpr const uint8_t byte_993CFC[] = { + 5, 12, 0xFF, 0xFF, + 9, 0, 0xFF, 0xFF, + 13, 4, 0xFF, 0xFF, + 1, 8, 0xFF, 0xFF, +}; /** rct2: 0x00993D0C */ -static constexpr const uint8_t byte_993D0C[] = { 3, 0, 0xFF, 0xFF, 0, 1, 0xFF, 0xFF, 1, 2, 0xFF, 0xFF, 2, 3, 0xFF, 0xFF }; +static constexpr const uint8_t byte_993D0C[] = { + 3, 0, 0xFF, 0xFF, + 0, 1, 0xFF, 0xFF, + 1, 2, 0xFF, 0xFF, + 2, 3, 0xFF, 0xFF, +}; +// clang-format on struct MazeSetTrackAction : public GameActionBase { diff --git a/src/openrct2/actions/RideSetStatus.hpp b/src/openrct2/actions/RideSetStatus.hpp index 56ad2a6ec3..bbc51fd21f 100644 --- a/src/openrct2/actions/RideSetStatus.hpp +++ b/src/openrct2/actions/RideSetStatus.hpp @@ -21,7 +21,11 @@ #include "../world/Sprite.h" #include "GameAction.h" -static rct_string_id _StatusErrorTitles[] = { STR_CANT_CLOSE, STR_CANT_OPEN, STR_CANT_TEST }; +static rct_string_id _StatusErrorTitles[] = { + STR_CANT_CLOSE, + STR_CANT_OPEN, + STR_CANT_TEST, +}; struct RideSetStatusAction : public GameActionBase { diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 864538c5ca..adcc140bd4 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -741,8 +741,8 @@ bool config_find_or_browse_install_directory() while (true) { auto uiContext = GetContext()->GetUiContext(); - uiContext->ShowMessageBox("OpenRCT2 needs files from the original RollerCoaster Tycoon 2 in order to work. " - "\nPlease select the directory where you installed RollerCoaster Tycoon 2."); + uiContext->ShowMessageBox("OpenRCT2 needs files from the original RollerCoaster Tycoon 2 in order to work.\n" + "Please select the directory where you installed RollerCoaster Tycoon 2."); std::string installPath = uiContext->ShowDirectoryDialog("Please select your RCT2 directory"); if (installPath.empty()) diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index 3b0bdb3679..bd6162eef3 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -637,5 +637,5 @@ const PaletteBGRA ImageImporter::StandardPalette[256] = { { 75, 207, 255, 255 }, // 255 (unused?) - { 0, 0, 0, 255 } + { 0, 0, 0, 255 }, }; diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index 90c0b3fe8e..f3b31aa061 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -266,8 +266,15 @@ void lightfx_prepare_light_list() } int32_t mapFrontDiv = 1 << _current_view_zoom_front; - static int16_t offsetPattern[26] - = { 0, 0, -4, 0, 0, -3, 4, 0, 0, 3, -2, -1, -1, -1, 2, 1, 1, 1, -3, -2, -3, 2, 3, -2, 3, 2 }; + + // clang-format off + static int16_t offsetPattern[26] = { + 0, 0, + -4, 0, 0, -3, 4, 0, 0, 3, + -2, -1, -1, -1, 2, 1, 1, 1, + -3, -2, -3, 2, 3, -2, 3, 2, + }; + // clang-format on #endif // LIGHTFX_UNKNOWN_PART_1 if (true) @@ -774,9 +781,10 @@ void lightfx_add_lights_magic_vehicles() place_y = vehicle->y; place_z = vehicle->z; - static constexpr const int16_t 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 int16_t offsetLookup[] = { + 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/Rain.cpp b/src/openrct2/drawing/Rain.cpp index b3ddc67481..b68af23884 100644 --- a/src/openrct2/drawing/Rain.cpp +++ b/src/openrct2/drawing/Rain.cpp @@ -28,7 +28,11 @@ static void DrawHeavyRain(IRainDrawer* rainDrawer, int32_t left, int32_t top, in * * rct2: 0x009AC058 */ -const DrawRainFunc DrawRainFunctions[] = { nullptr, &DrawLightRain, &DrawHeavyRain }; +const DrawRainFunc DrawRainFunctions[] = { + nullptr, + &DrawLightRain, + &DrawHeavyRain, +}; /** * diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 1045eb0b12..8d881a16f6 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -47,13 +47,15 @@ static void void scrolling_text_initialise_bitmaps() { uint8_t drawingSurface[64]; - rct_drawpixelinfo dpi = { /* .bits = */ (uint8_t*)&drawingSurface, - /* .x = */ 0, - /* .y = */ 0, - /* .width = */ 8, - /* .height = */ 8, - /* .pitch = */ 0, - /* .zoom_level = */ 0 }; + rct_drawpixelinfo dpi = { + /* .bits = */ (uint8_t*)&drawingSurface, + /* .x = */ 0, + /* .y = */ 0, + /* .width = */ 8, + /* .height = */ 8, + /* .pitch = */ 0, + /* .zoom_level = */ 0, + }; for (int32_t i = 0; i < FONT_SPRITE_GLYPH_COUNT; i++) { diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 627f9a0af7..67ffc09091 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1067,8 +1067,11 @@ static int32_t cc_load_object(InteractiveConsole& console, const utf8** argv, in static int32_t cc_object_count(InteractiveConsole& console, [[maybe_unused]] const utf8** argv, [[maybe_unused]] int32_t argc) { - const utf8* object_type_names[] = { "Rides", "Small scenery", "Large scenery", "Walls", "Banners", - "Paths", "Path Additions", "Scenery groups", "Park entrances", "Water" }; + const utf8* object_type_names[] = { + "Rides", "Small scenery", "Large scenery", "Walls", "Banners", + "Paths", "Path Additions", "Scenery groups", "Park entrances", "Water", + }; + for (int32_t i = 0; i < 10; i++) { int32_t entryGroupIndex = 0; diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index f293a0dc29..f022517a6b 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -110,9 +110,7 @@ void centre_2d_coordinates(int32_t x, int32_t y, int32_t z, int32_t* out_x, int3 { int32_t start_x = x; - LocationXYZ16 coord_3d = { /* .x = */ (int16_t)x, - /* .y = */ (int16_t)y, - /* .z = */ (int16_t)z }; + LocationXYZ16 coord_3d = { (int16_t)x, (int16_t)y, (int16_t)z }; LocationXY16 coord_2d = coordinate_3d_to_2d(&coord_3d, get_current_rotation()); @@ -1381,13 +1379,15 @@ static bool sub_679074(rct_drawpixelinfo* dpi, int32_t imageId, int16_t x, int16 if (g1->flags & G1_FLAG_HAS_ZOOM_SPRITE) { // TODO: SAR in dpi done with `>> 1`, in coordinates with `/ 2` - rct_drawpixelinfo zoomed_dpi = { /* .bits = */ dpi->bits, - /* .x = */ (int16_t)(dpi->x >> 1), - /* .y = */ (int16_t)(dpi->y >> 1), - /* .height = */ dpi->height, - /* .width = */ dpi->width, - /* .pitch = */ dpi->pitch, - /* .zoom_level = */ (uint16_t)(dpi->zoom_level - 1) }; + rct_drawpixelinfo zoomed_dpi = { + /* .bits = */ dpi->bits, + /* .x = */ (int16_t)(dpi->x >> 1), + /* .y = */ (int16_t)(dpi->y >> 1), + /* .height = */ dpi->height, + /* .width = */ dpi->width, + /* .pitch = */ dpi->pitch, + /* .zoom_level = */ (uint16_t)(dpi->zoom_level - 1), + }; return sub_679074(&zoomed_dpi, imageId - g1->zoomed_offset, x / 2, y / 2, palette); } diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 19f16ae83f..2e072cfe58 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -55,11 +55,27 @@ colour_t gCurrentWindowColours[4]; // converted from uint16_t 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 +// clang-format off static constexpr const float window_scroll_locations[][2] = { - { 0.5f, 0.5f }, { 0.75f, 0.5f }, { 0.25f, 0.5f }, { 0.5f, 0.75f }, { 0.5f, 0.25f }, { 0.75f, 0.75f }, - { 0.75f, 0.25f }, { 0.25f, 0.75f }, { 0.25f, 0.25f }, { 0.125f, 0.5f }, { 0.875f, 0.5f }, { 0.5f, 0.125f }, - { 0.5f, 0.875f }, { 0.875f, 0.125f }, { 0.875f, 0.875f }, { 0.125f, 0.875f }, { 0.125f, 0.125f }, + { 0.5f, 0.5f }, + { 0.75f, 0.5f }, + { 0.25f, 0.5f }, + { 0.5f, 0.75f }, + { 0.5f, 0.25f }, + { 0.75f, 0.75f }, + { 0.75f, 0.25f }, + { 0.25f, 0.75f }, + { 0.25f, 0.25f }, + { 0.125f, 0.5f }, + { 0.875f, 0.5f }, + { 0.5f, 0.125f }, + { 0.5f, 0.875f }, + { 0.875f, 0.125f }, + { 0.875f, 0.875f }, + { 0.125f, 0.875f }, + { 0.125f, 0.125f }, }; +// clang-format on static int32_t window_draw_split(rct_drawpixelinfo* dpi, rct_window* w, int32_t left, int32_t top, int32_t right, int32_t bottom); @@ -839,9 +855,7 @@ void window_set_location(rct_window* w, int32_t x, int32_t y, int32_t z) */ void window_scroll_to_location(rct_window* w, int32_t x, int32_t y, int32_t z) { - LocationXYZ16 location_3d = { /* .x = */ (int16_t)x, - /* .y = */ (int16_t)y, - /* .z = */ (int16_t)z }; + LocationXYZ16 location_3d = { (int16_t)x, (int16_t)y, (int16_t)z }; assert(w != nullptr); diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index f17fd7639e..043b8b8243 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -635,23 +635,25 @@ static bool award_is_deserved_best_gentle_rides([[maybe_unused]] int32_t activeA using award_deserved_check = bool (*)(int32_t); -static constexpr const award_deserved_check _awardChecks[] = { award_is_deserved_most_untidy, - award_is_deserved_most_tidy, - award_is_deserved_best_rollercoasters, - award_is_deserved_best_value, - award_is_deserved_most_beautiful, - award_is_deserved_worst_value, - award_is_deserved_safest, - award_is_deserved_best_staff, - award_is_deserved_best_food, - award_is_deserved_worst_food, - award_is_deserved_best_restrooms, - award_is_deserved_most_disappointing, - award_is_deserved_best_water_rides, - award_is_deserved_best_custom_designed_rides, - award_is_deserved_most_dazzling_ride_colours, - award_is_deserved_most_confusing_layout, - award_is_deserved_best_gentle_rides }; +static constexpr const award_deserved_check _awardChecks[] = { + award_is_deserved_most_untidy, + award_is_deserved_most_tidy, + award_is_deserved_best_rollercoasters, + award_is_deserved_best_value, + award_is_deserved_most_beautiful, + award_is_deserved_worst_value, + award_is_deserved_safest, + award_is_deserved_best_staff, + award_is_deserved_best_food, + award_is_deserved_worst_food, + award_is_deserved_best_restrooms, + award_is_deserved_most_disappointing, + award_is_deserved_best_water_rides, + award_is_deserved_best_custom_designed_rides, + award_is_deserved_most_dazzling_ride_colours, + award_is_deserved_most_confusing_layout, + award_is_deserved_best_gentle_rides, +}; static bool award_is_deserved(int32_t awardType, int32_t activeAwardTypes) { diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index 5f4f7315a6..6fbf77c61d 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -32,7 +32,7 @@ const money32 wage_table[STAFF_TYPE_COUNT] = { MONEY(50, 00), // Handyman MONEY(80, 00), // Mechanic MONEY(60, 00), // Security guard - MONEY(55, 00) // Entertainer + MONEY(55, 00), // Entertainer }; // Monthly research funding costs @@ -40,10 +40,12 @@ const money32 research_cost_table[RESEARCH_FUNDING_COUNT] = { MONEY(0, 00), // No funding MONEY(100, 00), // Minimum funding MONEY(200, 00), // Normal funding - MONEY(400, 00) // Maximum funding + MONEY(400, 00), // Maximum funding }; -static constexpr const int32_t dword_988E60[RCT_EXPENDITURE_TYPE_COUNT] = { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0 }; +static constexpr const int32_t dword_988E60[RCT_EXPENDITURE_TYPE_COUNT] = { + 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, +}; money32 gInitialCash; money32 gCash; diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index 1ad88e6c3b..84b0bbc0fc 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -28,10 +28,12 @@ const money16 AdvertisingCampaignPricePerWeek[] = { MONEY(50, 00), // PARK_ENTRY_HALF_PRICE MONEY(50, 00), // FOOD_OR_DRINK_FREE MONEY(350, 00), // PARK - MONEY(200, 00) // RIDE + MONEY(200, 00), // RIDE }; -static constexpr const int32_t AdvertisingCampaignGuestGenerationProbabilities[] = { 400, 300, 200, 200, 250, 200 }; +static constexpr const int32_t AdvertisingCampaignGuestGenerationProbabilities[] = { + 400, 300, 200, 200, 250, 200, +}; uint8_t gMarketingCampaignDaysLeft[20]; uint8_t gMarketingCampaignRideIndex[22]; diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 3f540370d6..ec9a3cce0a 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -35,7 +35,12 @@ #include -static constexpr const int32_t _researchRate[] = { 0, 160, 250, 400 }; +static constexpr const int32_t _researchRate[] = { + 0, + 160, + 250, + 400, +}; uint8_t gResearchFundingLevel; uint8_t gResearchPriorities;