Enforce not breaking before assignments and function names

Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
This commit is contained in:
clang-format 2018-07-21 11:50:45 +02:00 committed by Hielke Morsink
parent 9bfa8bdbe8
commit 95ce592579
158 changed files with 1885 additions and 1798 deletions

View File

@ -69,13 +69,13 @@ MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PenaltyBreakAssignment: 2
PenaltyBreakAssignment: 1000
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Left
ReflowComments: true
SortIncludes: true

View File

@ -307,8 +307,8 @@ void TextComposition::Delete()
size_t bytesToSkip = selectionOffset - _session.SelectionStart;
// std::min() is used to ensure that shiftSize doesn't underflow; it should be between 0 and _session.Size
size_t shiftSize
= _session.Size - std::min(_session.Size, (_session.SelectionStart - _session.SelectionSize + bytesToSkip));
size_t shiftSize = _session.Size
- std::min(_session.Size, (_session.SelectionStart - _session.SelectionSize + bytesToSkip));
memmove(targetShiftPtr, sourceShiftPtr, shiftSize);
_session.SelectionSize = 0;
RecalculateLength();

View File

@ -95,8 +95,8 @@ namespace OpenRCT2::Ui
{
case DIALOG_TYPE::KDIALOG:
{
std::string cmd
= String::Format("%s --title \"OpenRCT2\" --msgbox \"%s\"", executablePath.c_str(), message.c_str());
std::string cmd = String::Format(
"%s --title \"OpenRCT2\" --msgbox \"%s\"", executablePath.c_str(), message.c_str());
Execute(cmd);
break;
}
@ -220,8 +220,8 @@ namespace OpenRCT2::Ui
case DIALOG_TYPE::KDIALOG:
{
std::string output;
std::string cmd
= String::Format("%s --title '%s' --getexistingdirectory /", executablePath.c_str(), title.c_str());
std::string cmd = String::Format(
"%s --title '%s' --getexistingdirectory /", executablePath.c_str(), title.c_str());
if (Execute(cmd, &output) == 0)
{
result = output;

View File

@ -30,8 +30,8 @@ namespace OpenRCT2
class DrawingEngineFactory final : public IDrawingEngineFactory
{
public:
std::unique_ptr<IDrawingEngine>
Create(DRAWING_ENGINE_TYPE type, const std::shared_ptr<IUiContext>& uiContext) override
std::unique_ptr<IDrawingEngine> Create(
DRAWING_ENGINE_TYPE type, const std::shared_ptr<IUiContext>& uiContext) override
{
switch ((int32_t)type)
{

View File

@ -141,8 +141,8 @@ public:
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaleQualityBuffer);
uint32_t scale = std::ceil(gConfigGeneral.window_scale);
_scaledScreenTexture
= SDL_CreateTexture(_sdlRenderer, pixelFormat, SDL_TEXTUREACCESS_TARGET, width * scale, height * scale);
_scaledScreenTexture = SDL_CreateTexture(
_sdlRenderer, pixelFormat, SDL_TEXTUREACCESS_TARGET, width * scale, height * scale);
}
else
{

View File

@ -65,8 +65,8 @@ static int16_t _clickRepeatTicks;
static int32_t game_get_next_input(int32_t* x, int32_t* y);
static void input_widget_over(int32_t x, int32_t y, rct_window* w, rct_widgetindex widgetIndex);
static void
input_widget_over_change_check(rct_windowclass windowClass, rct_windownumber windowNumber, rct_widgetindex widgetIndex);
static void input_widget_over_change_check(
rct_windowclass windowClass, rct_windownumber windowNumber, rct_widgetindex widgetIndex);
static void input_widget_over_flatbutton_invalidate();
void process_mouse_over(int32_t x, int32_t y);
void process_mouse_tool(int32_t x, int32_t y);
@ -949,8 +949,8 @@ static void input_widget_over(int32_t x, int32_t y, rct_window* w, rct_widgetind
*
* rct2: 0x006E9269
*/
static void
input_widget_over_change_check(rct_windowclass windowClass, rct_windownumber windowNumber, rct_widgetindex widgetIndex)
static void input_widget_over_change_check(
rct_windowclass windowClass, rct_windownumber windowNumber, rct_widgetindex widgetIndex)
{
// Prevents invalid widgets being clicked source of bug is elsewhere
if (widgetIndex == -1)
@ -1113,8 +1113,8 @@ void process_mouse_over(int32_t x, int32_t y)
break;
}
cursorId = gCurrentToolId;
subWindow
= window_find_by_number(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
subWindow = window_find_by_number(
gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number);
if (subWindow == nullptr)
break;

View File

@ -11,8 +11,8 @@
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Localisation.h>
static void
graph_draw_months_uint8_t(rct_drawpixelinfo* dpi, const uint8_t* history, int32_t count, int32_t baseX, int32_t baseY)
static void graph_draw_months_uint8_t(
rct_drawpixelinfo* dpi, const uint8_t* history, int32_t count, int32_t baseX, int32_t baseY)
{
int32_t i, x, y, yearOver32, currentMonth, currentDay;
@ -38,8 +38,8 @@ static void
}
}
static void
graph_draw_line_a_uint8_t(rct_drawpixelinfo* dpi, const uint8_t* history, int32_t count, int32_t baseX, int32_t baseY)
static void graph_draw_line_a_uint8_t(
rct_drawpixelinfo* dpi, const uint8_t* history, int32_t count, int32_t baseX, int32_t baseY)
{
int32_t i, x, y, lastX, lastY;
lastX = -1;
@ -66,8 +66,8 @@ static void
}
}
static void
graph_draw_line_b_uint8_t(rct_drawpixelinfo* dpi, const uint8_t* history, int32_t count, int32_t baseX, int32_t baseY)
static void graph_draw_line_b_uint8_t(
rct_drawpixelinfo* dpi, const uint8_t* history, int32_t count, int32_t baseX, int32_t baseY)
{
int32_t i, x, y, lastX, lastY;
@ -99,8 +99,8 @@ void graph_draw_uint8_t(rct_drawpixelinfo* dpi, uint8_t* history, int32_t count,
graph_draw_line_b_uint8_t(dpi, history, count, baseX, baseY);
}
static void
graph_draw_months_money32(rct_drawpixelinfo* dpi, const money32* history, int32_t count, int32_t baseX, int32_t baseY)
static void graph_draw_months_money32(
rct_drawpixelinfo* dpi, const money32* history, int32_t count, int32_t baseX, int32_t baseY)
{
int32_t i, x, y, yearOver32, currentMonth, currentDay;

View File

@ -634,8 +634,8 @@ static rct_peep* viewport_interaction_get_closest_peep(int32_t x, int32_t y, int
if (peep->sprite_left == LOCATION_NULL)
continue;
distance
= abs(((peep->sprite_left + peep->sprite_right) / 2) - x) + abs(((peep->sprite_top + peep->sprite_bottom) / 2) - y);
distance = abs(((peep->sprite_left + peep->sprite_right) / 2) - x)
+ abs(((peep->sprite_top + peep->sprite_bottom) / 2) - y);
if (distance > maxDistance)
continue;

View File

@ -191,8 +191,8 @@ static void widget_button_draw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget
int32_t b = w->y + widget->bottom;
// Check if the button is pressed down
uint8_t press
= widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0;
uint8_t press = widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET
: 0;
// Get the colour
uint8_t colour = w->colours[widget->colour];
@ -312,8 +312,8 @@ static void widget_text_button(rct_drawpixelinfo* dpi, rct_window* w, rct_widget
uint8_t colour = w->colours[widget->colour];
// Border
uint8_t press
= widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET : 0;
uint8_t press = widget_is_pressed(w, widgetIndex) || widget_is_active_tool(w, widgetIndex) ? INSET_RECT_FLAG_BORDER_INSET
: 0;
gfx_fill_rect_inset(dpi, l, t, r, b, colour, press);
// Button caption

View File

@ -20,5 +20,5 @@ namespace OpenRCT2
class GameState;
}
std::unique_ptr<ITitleSequencePlayer>
CreateTitleSequencePlayer(IScenarioRepository& scenarioRepository, OpenRCT2::GameState& gameState);
std::unique_ptr<ITitleSequencePlayer> CreateTitleSequencePlayer(
IScenarioRepository& scenarioRepository, OpenRCT2::GameState& gameState);

View File

@ -331,14 +331,14 @@ static void window_banner_invalidate(rct_window* w)
}
w->pressed_widgets &= ~(1ULL << WIDX_BANNER_NO_ENTRY);
w->disabled_widgets
&= ~((1ULL << WIDX_BANNER_TEXT) | (1ULL << WIDX_TEXT_COLOUR_DROPDOWN) | (1ULL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON));
w->disabled_widgets &= ~(
(1ULL << WIDX_BANNER_TEXT) | (1ULL << WIDX_TEXT_COLOUR_DROPDOWN) | (1ULL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON));
if (banner->flags & BANNER_FLAG_NO_ENTRY)
{
w->pressed_widgets |= (1ULL << WIDX_BANNER_NO_ENTRY);
w->disabled_widgets
|= (1ULL << WIDX_BANNER_TEXT) | (1ULL << WIDX_TEXT_COLOUR_DROPDOWN) | (1ULL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON);
w->disabled_widgets |= (1ULL << WIDX_BANNER_TEXT) | (1ULL << WIDX_TEXT_COLOUR_DROPDOWN)
| (1ULL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON);
}
colour_btn->image = SPRITE_ID_PALETTE_COLOUR_1(banner->colour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;

View File

@ -1252,8 +1252,8 @@ static void window_cheats_invalidate(rct_window* w)
widget_set_checkbox_value(w, WIDX_DISABLE_LITTERING, gCheatsDisableLittering);
break;
case WINDOW_CHEATS_PAGE_MISC:
w->widgets[WIDX_OPEN_CLOSE_PARK].text
= (gParkFlags & PARK_FLAGS_PARK_OPEN) ? STR_CHEAT_CLOSE_PARK : STR_CHEAT_OPEN_PARK;
w->widgets[WIDX_OPEN_CLOSE_PARK].text = (gParkFlags & PARK_FLAGS_PARK_OPEN) ? STR_CHEAT_CLOSE_PARK
: STR_CHEAT_OPEN_PARK;
widget_set_checkbox_value(w, WIDX_FORCE_PARK_RATING, get_forced_park_rating() >= 0);
w->widgets[WIDX_SANDBOX_MODE].text = gCheatsSandboxMode ? STR_CHEAT_SANDBOX_MODE_DISABLE : STR_CHEAT_SANDBOX_MODE;
w->widgets[WIDX_FREEZE_CLIMATE].text = gCheatsFreezeClimate ? STR_CHEAT_UNFREEZE_CLIMATE : STR_CHEAT_FREEZE_CLIMATE;

View File

@ -22,8 +22,8 @@
#define DROPDOWN_ITEM_HEIGHT 12
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 };
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 };
enum
{

View File

@ -564,8 +564,8 @@ static void window_editor_inventions_list_tooltip(rct_window* w, rct_widgetindex
*
* rct2: 0x00685291
*/
static void
window_editor_inventions_list_cursor(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t* cursorId)
static void window_editor_inventions_list_cursor(
rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t* cursorId)
{
rct_research_item* researchItem;
int32_t scrollIndex;
@ -815,8 +815,9 @@ static void window_editor_inventions_list_scrollpaint(rct_window* w, rct_drawpix
if (researchItem->type == RESEARCH_ENTRY_TYPE_RIDE
&& !RideGroupManager::RideTypeIsIndependent(researchItem->baseRideType))
{
const rct_string_id rideGroupName
= get_ride_naming(researchItem->baseRideType, get_ride_entry(researchItem->entryIndex)).name;
const rct_string_id rideGroupName = get_ride_naming(
researchItem->baseRideType, get_ride_entry(researchItem->entryIndex))
.name;
format_string(
groupNamePtr, Util::CountOf(groupNameBuffer), STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME, (void*)&rideGroupName);
format_string(vehicleNamePtr, Util::CountOf(vehicleNameBuffer), itemNameId, nullptr);
@ -859,8 +860,9 @@ static void window_editor_inventions_list_drag_open(rct_research_item* researchI
ptr = buffer;
if (researchItem->type == RESEARCH_ENTRY_TYPE_RIDE && !RideGroupManager::RideTypeIsIndependent(researchItem->baseRideType))
{
const rct_string_id rideGroupName
= get_ride_naming(researchItem->baseRideType, get_ride_entry(researchItem->entryIndex)).name;
const rct_string_id rideGroupName = get_ride_naming(
researchItem->baseRideType, get_ride_entry(researchItem->entryIndex))
.name;
rct_string_id args[] = { rideGroupName, stringId };
format_string(ptr, 256, STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME, &args);
}
@ -951,8 +953,8 @@ static rct_string_id window_editor_inventions_list_prepare_name(const rct_resear
if (researchItem->type == RESEARCH_ENTRY_TYPE_RIDE && !RideGroupManager::RideTypeIsIndependent(researchItem->baseRideType))
{
drawString = withGap ? STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME_DRAG : STR_WINDOW_COLOUR_2_STRINGID_STRINGID;
rct_string_id rideGroupName
= get_ride_naming(researchItem->baseRideType, get_ride_entry(researchItem->entryIndex)).name;
rct_string_id rideGroupName = get_ride_naming(researchItem->baseRideType, get_ride_entry(researchItem->entryIndex))
.name;
set_format_arg(0, rct_string_id, rideGroupName);
set_format_arg(2, rct_string_id, stringId);
}

View File

@ -1156,8 +1156,8 @@ static void window_editor_object_selection_scrollpaint(rct_window* w, rct_drawpi
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && (*listItem.flags & OBJECT_SELECTION_FLAG_SELECTED))
{
x = 2;
gCurrentFontSpriteBase
= colour == COLOUR_BRIGHT_GREEN ? FONT_SPRITE_BASE_MEDIUM_EXTRA_DARK : FONT_SPRITE_BASE_MEDIUM_DARK;
gCurrentFontSpriteBase = colour == COLOUR_BRIGHT_GREEN ? FONT_SPRITE_BASE_MEDIUM_EXTRA_DARK
: FONT_SPRITE_BASE_MEDIUM_DARK;
colour2 = NOT_TRANSLUCENT(w->colours[1]);
if (*listItem.flags & (OBJECT_SELECTION_FLAG_IN_USE | OBJECT_SELECTION_FLAG_ALWAYS_REQUIRED))
colour2 |= COLOUR_FLAG_INSET;

View File

@ -895,8 +895,9 @@ static void window_editor_objective_options_main_invalidate(rct_window* w)
break;
}
window_editor_objective_options_main_widgets[WIDX_CLOSE].type
= (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WWT_EMPTY : WWT_CLOSEBOX;
window_editor_objective_options_main_widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
? WWT_EMPTY
: WWT_CLOSEBOX;
window_editor_objective_options_anchor_border_widgets(w);
}
@ -1140,8 +1141,8 @@ static void window_editor_objective_options_rides_update(rct_window* w)
*
* rct2: 0x006724BF
*/
static void
window_editor_objective_options_rides_scrollgetheight(rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height)
static void window_editor_objective_options_rides_scrollgetheight(
rct_window* w, int32_t scrollIndex, int32_t* width, int32_t* height)
{
*height = w->no_list_items * 12;
}
@ -1200,8 +1201,9 @@ static void window_editor_objective_options_rides_invalidate(rct_window* w)
window_editor_objective_options_set_pressed_tab(w);
window_editor_objective_options_main_widgets[WIDX_CLOSE].type
= (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WWT_EMPTY : WWT_CLOSEBOX;
window_editor_objective_options_main_widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
? WWT_EMPTY
: WWT_CLOSEBOX;
window_editor_objective_options_anchor_border_widgets(w);
}
@ -1256,8 +1258,8 @@ static void window_editor_objective_options_rides_scrollpaint(rct_window* w, rct
ride = get_ride(w->list_item_positions[i]);
if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE)
{
gCurrentFontSpriteBase
= stringId == STR_WINDOW_COLOUR_2_STRINGID ? FONT_SPRITE_BASE_MEDIUM_EXTRA_DARK : FONT_SPRITE_BASE_MEDIUM_DARK;
gCurrentFontSpriteBase = stringId == STR_WINDOW_COLOUR_2_STRINGID ? FONT_SPRITE_BASE_MEDIUM_EXTRA_DARK
: FONT_SPRITE_BASE_MEDIUM_DARK;
gfx_draw_string(dpi, (char*)CheckBoxMarkString, w->colours[1] & 0x7F, 2, y);
}

View File

@ -568,12 +568,13 @@ static void window_footpath_invalidate(rct_window* w)
// Press / unpress footpath and queue type buttons
w->pressed_widgets &= ~(1 << WIDX_FOOTPATH_TYPE);
w->pressed_widgets &= ~(1 << WIDX_QUEUELINE_TYPE);
w->pressed_widgets
|= gFootpathSelectedType == SELECTED_PATH_TYPE_NORMAL ? (1 << WIDX_FOOTPATH_TYPE) : (1 << WIDX_QUEUELINE_TYPE);
w->pressed_widgets |= gFootpathSelectedType == SELECTED_PATH_TYPE_NORMAL ? (1 << WIDX_FOOTPATH_TYPE)
: (1 << WIDX_QUEUELINE_TYPE);
// Enable / disable construct button
window_footpath_widgets[WIDX_CONSTRUCT].type
= gFootpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL ? WWT_IMGBTN : WWT_EMPTY;
window_footpath_widgets[WIDX_CONSTRUCT].type = gFootpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL
? WWT_IMGBTN
: WWT_EMPTY;
// Set footpath and queue type button images
selectedPath = gFootpathSelectedId;
@ -969,8 +970,8 @@ static void window_footpath_construct()
footpath_get_next_path_info(&type, &x, &y, &z, &slope);
gGameCommandErrorTitle = STR_CANT_BUILD_FOOTPATH_HERE;
money32 cost
= footpath_place_remove_intersecting(type, x, y, z, slope, GAME_COMMAND_FLAG_APPLY, gFootpathConstructDirection);
money32 cost = footpath_place_remove_intersecting(
type, x, y, z, slope, GAME_COMMAND_FLAG_APPLY, gFootpathConstructDirection);
if (cost != MONEY32_UNDEFINED)
{
@ -1194,8 +1195,8 @@ static void window_footpath_set_enabled_and_pressed_widgets()
direction = gFootpathConstructValidDirections;
if (direction != 255)
{
disabledWidgets
|= (1 << WIDX_DIRECTION_NW) | (1 << WIDX_DIRECTION_NE) | (1 << WIDX_DIRECTION_SW) | (1 << WIDX_DIRECTION_SE);
disabledWidgets |= (1 << WIDX_DIRECTION_NW) | (1 << WIDX_DIRECTION_NE) | (1 << WIDX_DIRECTION_SW)
| (1 << WIDX_DIRECTION_SE);
direction = (direction + currentRotation) & 3;
disabledWidgets &= ~(1 << (WIDX_DIRECTION_NW + direction));

View File

@ -745,8 +745,8 @@ static void window_game_bottom_toolbar_update(rct_window* w)
*
* rct2: 0x0066C644
*/
static void
window_game_bottom_toolbar_cursor(rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t* cursorId)
static void window_game_bottom_toolbar_cursor(
rct_window* w, rct_widgetindex widgetIndex, int32_t x, int32_t y, int32_t* cursorId)
{
switch (widgetIndex)
{

View File

@ -1373,8 +1373,8 @@ void window_guest_stats_invalidate(rct_window* w)
*
* ebp: colour, contains flag BAR_BLINK for blinking
*/
static void
window_guest_stats_bars_paint(int32_t value, int32_t x, int32_t y, rct_window* w, rct_drawpixelinfo* dpi, int32_t colour)
static void window_guest_stats_bars_paint(
int32_t value, int32_t x, int32_t y, rct_window* w, rct_drawpixelinfo* dpi, int32_t colour)
{
if (font_get_line_height(gCurrentFontSpriteBase) > 10)
{
@ -1651,8 +1651,8 @@ void window_guest_rides_scroll_get_size(rct_window* w, int32_t scrollIndex, int3
window_invalidate(w);
}
int32_t visable_height
= *height - window_guest_rides_widgets[WIDX_RIDE_SCROLL].bottom + window_guest_rides_widgets[WIDX_RIDE_SCROLL].top + 21;
int32_t visable_height = *height - window_guest_rides_widgets[WIDX_RIDE_SCROLL].bottom
+ window_guest_rides_widgets[WIDX_RIDE_SCROLL].top + 21;
if (visable_height < 0)
visable_height = 0;

View File

@ -1018,8 +1018,8 @@ static void window_guest_list_find_groups()
_window_guest_list_group_index[groupIndex] = groupIndex;
faceIndex = groupIndex * 56;
_window_guest_list_groups_guest_faces[faceIndex++]
= get_peep_face_sprite_small(peep) - SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY;
_window_guest_list_groups_guest_faces[faceIndex++] = get_peep_face_sprite_small(peep)
- SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY;
// Find more peeps that belong to same group
FOR_ALL_GUESTS (spriteIndex2, peep2)
@ -1041,8 +1041,8 @@ static void window_guest_list_find_groups()
// Add face sprite, cap at 56 though
if (_window_guest_list_groups_num_guests[groupIndex] >= 56)
continue;
_window_guest_list_groups_guest_faces[faceIndex++]
= get_peep_face_sprite_small(peep2) - SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY;
_window_guest_list_groups_guest_faces[faceIndex++] = get_peep_face_sprite_small(peep2)
- SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY;
}
if (_window_guest_list_filter_arguments[0] == 0)

View File

@ -136,8 +136,8 @@ rct_window* window_install_track_open(const utf8* path)
rct_window* w = window_create(x, y, WW, WH, &window_install_track_events, WC_INSTALL_TRACK, 0);
w->widgets = window_install_track_widgets;
w->enabled_widgets
= (1 << WIDX_CLOSE) | (1 << WIDX_ROTATE) | (1 << WIDX_TOGGLE_SCENERY) | (1 << WIDX_INSTALL) | (1 << WIDX_CANCEL);
w->enabled_widgets = (1 << WIDX_CLOSE) | (1 << WIDX_ROTATE) | (1 << WIDX_TOGGLE_SCENERY) | (1 << WIDX_INSTALL)
| (1 << WIDX_CANCEL);
window_init_scroll_widgets(w);
w->track_list.track_list_being_updated = false;
window_push_others_right(w);

View File

@ -245,8 +245,8 @@ rct_window* window_loadsave_open(int32_t type, const char* defaultName)
break;
case LOADSAVETYPE_TRACK:
w->widgets[WIDX_TITLE].text
= isSave ? STR_FILE_DIALOG_TITLE_SAVE_TRACK : STR_FILE_DIALOG_TITLE_INSTALL_NEW_TRACK_DESIGN;
w->widgets[WIDX_TITLE].text = isSave ? STR_FILE_DIALOG_TITLE_SAVE_TRACK
: STR_FILE_DIALOG_TITLE_INSTALL_NEW_TRACK_DESIGN;
if (window_loadsave_get_dir(gConfigGeneral.last_save_track_directory, path, "track", sizeof(path)))
{
window_loadsave_populate_list(w, isSave, path, isSave ? ".td6" : ".td6;.td4");
@ -1092,20 +1092,21 @@ enum
WIDX_OVERWRITE_CANCEL
};
static rct_widget window_overwrite_prompt_widgets[]
= { { WWT_FRAME, 0, 0, OVERWRITE_WW - 1, 0, OVERWRITE_WH - 1, STR_NONE, STR_NONE },
{ WWT_CAPTION, 0, 1, OVERWRITE_WW - 2, 1, 14, STR_FILEBROWSER_OVERWRITE_TITLE, STR_WINDOW_TITLE_TIP },
{ WWT_CLOSEBOX, 0, OVERWRITE_WW - 13, OVERWRITE_WW - 3, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP },
{ WWT_BUTTON, 0, 10, 94, OVERWRITE_WH - 20, OVERWRITE_WH - 9, STR_FILEBROWSER_OVERWRITE_TITLE, STR_NONE },
{ WWT_BUTTON,
0,
OVERWRITE_WW - 95,
OVERWRITE_WW - 11,
OVERWRITE_WH - 20,
OVERWRITE_WH - 9,
STR_SAVE_PROMPT_CANCEL,
STR_NONE },
{ WIDGETS_END } };
static rct_widget window_overwrite_prompt_widgets[] = {
{ WWT_FRAME, 0, 0, OVERWRITE_WW - 1, 0, OVERWRITE_WH - 1, STR_NONE, STR_NONE },
{ WWT_CAPTION, 0, 1, OVERWRITE_WW - 2, 1, 14, STR_FILEBROWSER_OVERWRITE_TITLE, STR_WINDOW_TITLE_TIP },
{ WWT_CLOSEBOX, 0, OVERWRITE_WW - 13, OVERWRITE_WW - 3, 2, 13, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP },
{ WWT_BUTTON, 0, 10, 94, OVERWRITE_WH - 20, OVERWRITE_WH - 9, STR_FILEBROWSER_OVERWRITE_TITLE, STR_NONE },
{ WWT_BUTTON,
0,
OVERWRITE_WW - 95,
OVERWRITE_WW - 11,
OVERWRITE_WH - 20,
OVERWRITE_WH - 9,
STR_SAVE_PROMPT_CANCEL,
STR_NONE },
{ WIDGETS_END }
};
static void window_overwrite_prompt_mouseup(rct_window* w, rct_widgetindex widgetIndex);
static void window_overwrite_prompt_paint(rct_window* w, rct_drawpixelinfo* dpi);

View File

@ -1215,8 +1215,8 @@ static void window_map_set_land_rights_tool_update(int32_t x, int32_t y)
*
* rct2: 0x00666EEF
*/
static void
place_park_entrance_get_map_position(int32_t x, int32_t y, int16_t* mapX, int16_t* mapY, int16_t* mapZ, int32_t* direction)
static void place_park_entrance_get_map_position(
int32_t x, int32_t y, int16_t* mapX, int16_t* mapY, int16_t* mapZ, int32_t* direction)
{
rct_tile_element* tileElement;

View File

@ -652,8 +652,8 @@ static void window_mapgen_base_dropdown(rct_window* w, rct_widgetindex widgetInd
if (dropdownIndex == -1)
dropdownIndex = gDropdownHighlightedIndex;
type
= (dropdownIndex == -1) ? _floorTexture : (uint32_t)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
type = (dropdownIndex == -1) ? _floorTexture
: (uint32_t)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
if (gLandToolTerrainSurface == type)
{
@ -977,8 +977,8 @@ static void window_mapgen_simplex_dropdown(rct_window* w, rct_widgetindex widget
if (dropdownIndex == -1)
dropdownIndex = gDropdownHighlightedIndex;
type
= (dropdownIndex == -1) ? _floorTexture : (uint32_t)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
type = (dropdownIndex == -1) ? _floorTexture
: (uint32_t)gDropdownItemsArgs[dropdownIndex] - SPR_FLOOR_TEXTURE_GRASS;
if (gLandToolTerrainSurface == type)
{

View File

@ -269,8 +269,8 @@ static ride_list_item window_new_ride_scroll_get_ride_list_item_at(rct_window* w
static void window_new_ride_paint_ride_information(
rct_window* w, rct_drawpixelinfo* dpi, ride_list_item item, int32_t x, int32_t y, int32_t width);
static void window_new_ride_select(rct_window* w);
static ride_list_item*
window_new_ride_iterate_over_ride_group(uint8_t rideType, uint8_t rideGroupIndex, ride_list_item* nextListItem);
static ride_list_item* window_new_ride_iterate_over_ride_group(
uint8_t rideType, uint8_t rideGroupIndex, ride_list_item* nextListItem);
static ride_list_item _lastTrackDesignCountRideType;
static int32_t _lastTrackDesignCount;
@ -342,8 +342,8 @@ static void window_new_ride_populate_list()
nextListItem->entry_index = RIDE_ENTRY_INDEX_NULL;
}
static ride_list_item*
window_new_ride_iterate_over_ride_group(uint8_t rideType, uint8_t rideGroupIndex, ride_list_item* nextListItem)
static ride_list_item* window_new_ride_iterate_over_ride_group(
uint8_t rideType, uint8_t rideGroupIndex, ride_list_item* nextListItem)
{
bool buttonForRideTypeCreated = false;
bool allowDrawingOverLastButton = false;
@ -661,8 +661,8 @@ static void window_new_ride_set_pressed_tab(rct_window* w)
w->pressed_widgets |= 1LL << (WIDX_TAB_1 + _windowNewRideCurrentTab);
}
static constexpr const int32_t ThrillRidesTabAnimationSequence[]
= { 5, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0 };
static constexpr const int32_t ThrillRidesTabAnimationSequence[] = { 5, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0,
0, 0, 0, 1, 2, 3, 4, 0, 0, 0 };
static void window_new_ride_draw_tab_image(rct_drawpixelinfo* dpi, rct_window* w, int32_t page, int32_t spriteIndex)
{
@ -830,8 +830,8 @@ static void window_new_ride_invalidate(rct_window* w)
{
uint8_t type = gResearchLastItem.type;
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image
= (type == RESEARCH_ENTRY_TYPE_RIDE) ? SPR_NEW_RIDE : SPR_NEW_SCENERY;
window_new_ride_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image = (type == RESEARCH_ENTRY_TYPE_RIDE) ? SPR_NEW_RIDE
: SPR_NEW_SCENERY;
}
}
}

View File

@ -896,8 +896,8 @@ static void window_options_mouseup(rct_window* w, rct_widgetindex widgetIndex)
window_invalidate(w);
break;
case WIDX_ALLOW_LOADING_WITH_INCORRECT_CHECKSUM:
gConfigGeneral.allow_loading_with_incorrect_checksum
= !gConfigGeneral.allow_loading_with_incorrect_checksum;
gConfigGeneral.allow_loading_with_incorrect_checksum = !gConfigGeneral
.allow_loading_with_incorrect_checksum;
config_save_default();
window_invalidate(w);
break;
@ -1682,11 +1682,11 @@ static void window_options_invalidate(rct_window* w)
widget_set_checkbox_value(w, WIDX_STEAM_OVERLAY_PAUSE, gConfigGeneral.steam_overlay_pause);
// Dropdown captions for straightforward strings.
window_options_display_widgets[WIDX_FULLSCREEN].text
= window_options_fullscreen_mode_names[gConfigGeneral.fullscreen_mode];
window_options_display_widgets[WIDX_FULLSCREEN].text = window_options_fullscreen_mode_names[gConfigGeneral
.fullscreen_mode];
window_options_display_widgets[WIDX_DRAWING_ENGINE].text = DrawingEngineStringIds[gConfigGeneral.drawing_engine];
window_options_display_widgets[WIDX_SCALE_QUALITY].text
= window_options_scale_quality_names[gConfigGeneral.scale_quality - 1];
window_options_display_widgets[WIDX_SCALE_QUALITY].text = window_options_scale_quality_names
[gConfigGeneral.scale_quality - 1];
break;
}
@ -1699,11 +1699,12 @@ static void window_options_invalidate(rct_window* w)
widget_set_checkbox_value(w, WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, gConfigGeneral.show_guest_purchases);
widget_set_checkbox_value(w, WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners);
rct_string_id VirtualFloorStyleStrings[]
= { STR_VIRTUAL_FLOOR_STYLE_DISABLED, STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT, STR_VIRTUAL_FLOOR_STYLE_GLASSY };
rct_string_id VirtualFloorStyleStrings[] = { STR_VIRTUAL_FLOOR_STYLE_DISABLED,
STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT,
STR_VIRTUAL_FLOOR_STYLE_GLASSY };
window_options_rendering_widgets[WIDX_VIRTUAL_FLOOR].text
= VirtualFloorStyleStrings[gConfigGeneral.virtual_floor_style];
window_options_rendering_widgets[WIDX_VIRTUAL_FLOOR].text = VirtualFloorStyleStrings[gConfigGeneral
.virtual_floor_style];
widget_set_checkbox_value(w, WIDX_ENABLE_LIGHT_FX_CHECKBOX, gConfigGeneral.enable_light_fx);
if (gConfigGeneral.day_night_cycle
@ -1766,12 +1767,13 @@ static void window_options_invalidate(rct_window* w)
window_options_culture_widgets[WIDX_DATE_FORMAT].text = DateFormatStringIds[gConfigGeneral.date_format];
// Temperature: celsius/fahrenheit
window_options_culture_widgets[WIDX_TEMPERATURE].text
= gConfigGeneral.temperature_format == TEMPERATURE_FORMAT_F ? STR_FAHRENHEIT : STR_CELSIUS;
window_options_culture_widgets[WIDX_TEMPERATURE].text = gConfigGeneral.temperature_format == TEMPERATURE_FORMAT_F
? STR_FAHRENHEIT
: STR_CELSIUS;
// Height: units/real values
window_options_culture_widgets[WIDX_HEIGHT_LABELS].text
= gConfigGeneral.show_height_as_units ? STR_UNITS : STR_REAL_VALUES;
window_options_culture_widgets[WIDX_HEIGHT_LABELS].text = gConfigGeneral.show_height_as_units ? STR_UNITS
: STR_REAL_VALUES;
break;
@ -1877,8 +1879,8 @@ static void window_options_invalidate(rct_window* w)
w->disabled_widgets |= (1ULL << WIDX_SCENARIO_UNLOCKING);
}
window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].text
= RideInspectionIntervalNames[gConfigGeneral.default_inspection_interval];
window_options_misc_widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].text = RideInspectionIntervalNames
[gConfigGeneral.default_inspection_interval];
break;
}
@ -1921,11 +1923,11 @@ static void window_options_update(rct_window* w)
if (w->page == WINDOW_OPTIONS_PAGE_AUDIO)
{
rct_widget* widget = &window_options_audio_widgets[WIDX_SOUND_VOLUME];
uint8_t sound_volume
= (uint8_t)(((float)w->scrolls[0].h_left / (w->scrolls[0].h_right - ((widget->right - widget->left) - 1))) * 100);
uint8_t sound_volume = (uint8_t)(
((float)w->scrolls[0].h_left / (w->scrolls[0].h_right - ((widget->right - widget->left) - 1))) * 100);
widget = &window_options_audio_widgets[WIDX_MUSIC_VOLUME];
uint8_t ride_music_volume
= (uint8_t)(((float)w->scrolls[1].h_left / (w->scrolls[1].h_right - ((widget->right - widget->left) - 1))) * 100);
uint8_t ride_music_volume = (uint8_t)(
((float)w->scrolls[1].h_left / (w->scrolls[1].h_right - ((widget->right - widget->left) - 1))) * 100);
if (sound_volume != gConfigSound.sound_volume)
{
gConfigSound.sound_volume = sound_volume;

View File

@ -769,10 +769,10 @@ static void window_park_entrance_invalidate(rct_window* w)
set_format_arg(0, rct_string_id, gParkName);
set_format_arg(2, uint32_t, gParkNameArgs);
window_park_entrance_widgets[WIDX_OPEN_OR_CLOSE].image = park_is_open() ? SPR_OPEN : SPR_CLOSED;
window_park_entrance_widgets[WIDX_CLOSE_LIGHT].image
= SPR_G2_RCT1_CLOSE_BUTTON_0 + !park_is_open() * 2 + widget_is_pressed(w, WIDX_CLOSE_LIGHT);
window_park_entrance_widgets[WIDX_OPEN_LIGHT].image
= SPR_G2_RCT1_OPEN_BUTTON_0 + park_is_open() * 2 + widget_is_pressed(w, WIDX_OPEN_LIGHT);
window_park_entrance_widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + !park_is_open() * 2
+ widget_is_pressed(w, WIDX_CLOSE_LIGHT);
window_park_entrance_widgets[WIDX_OPEN_LIGHT].image = SPR_G2_RCT1_OPEN_BUTTON_0 + park_is_open() * 2
+ widget_is_pressed(w, WIDX_OPEN_LIGHT);
// Only allow closing of park for guest / rating objective
if (gScenarioObjectiveType == OBJECTIVE_GUESTS_AND_RATING)

View File

@ -316,8 +316,9 @@ static void window_research_development_invalidate(rct_window* w)
{
uint8_t type = gResearchLastItem.type;
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WWT_FLATBTN;
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image
= type == RESEARCH_ENTRY_TYPE_RIDE ? SPR_NEW_RIDE : SPR_NEW_SCENERY;
window_research_development_widgets[WIDX_LAST_DEVELOPMENT_BUTTON].image = type == RESEARCH_ENTRY_TYPE_RIDE
? SPR_NEW_RIDE
: SPR_NEW_SCENERY;
}
}

View File

@ -1331,8 +1331,8 @@ static void window_ride_draw_tab_vehicle(rct_drawpixelinfo* dpi, rct_window* w)
y /= 4;
}
const uint8_t vehicle
= ride_entry_get_vehicle_at_position(ride->subtype, ride->num_cars_per_train, rideEntry->tab_vehicle);
const uint8_t vehicle = ride_entry_get_vehicle_at_position(
ride->subtype, ride->num_cars_per_train, rideEntry->tab_vehicle);
rct_ride_entry_vehicle* rideVehicleEntry = &rideEntry->vehicles[vehicle];
vehicle_colour vehicleColour = ride_get_vehicle_colour(ride, 0);
@ -2300,8 +2300,9 @@ static void populate_vehicle_type_dropdown(Ride* ride)
continue;
}
VehicleTypeLabel label
= { rideEntryIndex, currentRideEntry->naming.name, ls.GetString(currentRideEntry->naming.name) };
VehicleTypeLabel label = { rideEntryIndex,
currentRideEntry->naming.name,
ls.GetString(currentRideEntry->naming.name) };
VehicleDropdownData.push_back(label);
}
}
@ -2531,12 +2532,12 @@ static void window_ride_main_invalidate(rct_window* w)
};
window_ride_main_widgets[WIDX_OPEN].image = spriteIds[ride->status];
window_ride_main_widgets[WIDX_CLOSE_LIGHT].image
= SPR_G2_RCT1_CLOSE_BUTTON_0 + (ride->status == RIDE_STATUS_CLOSED) * 2 + widget_is_pressed(w, WIDX_CLOSE_LIGHT);
window_ride_main_widgets[WIDX_TEST_LIGHT].image
= SPR_G2_RCT1_TEST_BUTTON_0 + (ride->status == RIDE_STATUS_TESTING) * 2 + widget_is_pressed(w, WIDX_TEST_LIGHT);
window_ride_main_widgets[WIDX_OPEN_LIGHT].image
= SPR_G2_RCT1_OPEN_BUTTON_0 + (ride->status == RIDE_STATUS_OPEN) * 2 + widget_is_pressed(w, WIDX_OPEN_LIGHT);
window_ride_main_widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + (ride->status == RIDE_STATUS_CLOSED) * 2
+ widget_is_pressed(w, WIDX_CLOSE_LIGHT);
window_ride_main_widgets[WIDX_TEST_LIGHT].image = SPR_G2_RCT1_TEST_BUTTON_0 + (ride->status == RIDE_STATUS_TESTING) * 2
+ widget_is_pressed(w, WIDX_TEST_LIGHT);
window_ride_main_widgets[WIDX_OPEN_LIGHT].image = SPR_G2_RCT1_OPEN_BUTTON_0 + (ride->status == RIDE_STATUS_OPEN) * 2
+ widget_is_pressed(w, WIDX_OPEN_LIGHT);
window_ride_anchor_border_widgets(w);
@ -3105,8 +3106,8 @@ static void window_ride_vehicle_scrollpaint(rct_window* w, rct_drawpixelinfo* dp
int32_t startX = std::max(2, ((widget->right - widget->left) - ((ride->num_vehicles - 1) * 36)) / 2 - 25);
int32_t startY = widget->bottom - widget->top - 4;
rct_ride_entry_vehicle* rideVehicleEntry
= &rideEntry->vehicles[ride_entry_get_vehicle_at_position(ride->subtype, ride->num_cars_per_train, 0)];
rct_ride_entry_vehicle* rideVehicleEntry = &rideEntry->vehicles[ride_entry_get_vehicle_at_position(
ride->subtype, ride->num_cars_per_train, 0)];
startY += rideVehicleEntry->tab_height;
// For each train
@ -3119,8 +3120,8 @@ static void window_ride_vehicle_scrollpaint(rct_window* w, rct_drawpixelinfo* dp
// For each car in train
for (int32_t j = 0; j < ride->num_cars_per_train; j++)
{
rideVehicleEntry
= &rideEntry->vehicles[ride_entry_get_vehicle_at_position(ride->subtype, ride->num_cars_per_train, j)];
rideVehicleEntry = &rideEntry
->vehicles[ride_entry_get_vehicle_at_position(ride->subtype, ride->num_cars_per_train, j)];
x += rideVehicleEntry->spacing / 17432;
y -= (rideVehicleEntry->spacing / 2) / 17432;
@ -3592,9 +3593,10 @@ static void window_ride_operating_invalidate(rct_window* w)
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].type = WWT_CHECKBOX;
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].tooltip
= STR_LEAVE_IF_ANOTHER_VEHICLE_ARRIVES_TIP;
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text
= RideNameConvention[ride->type].vehicle == RIDE_COMPONENT_TYPE_BOAT ? STR_LEAVE_IF_ANOTHER_BOAT_ARRIVES
: STR_LEAVE_IF_ANOTHER_TRAIN_ARRIVES;
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text = RideNameConvention[ride->type].vehicle
== RIDE_COMPONENT_TYPE_BOAT
? STR_LEAVE_IF_ANOTHER_BOAT_ARRIVES
: STR_LEAVE_IF_ANOTHER_TRAIN_ARRIVES;
}
else
{
@ -3825,8 +3827,8 @@ static void window_ride_locate_mechanic(rct_window* w)
*
* rct2: 0x006B7D08
*/
static void
window_ride_maintenance_draw_bar(rct_window* w, rct_drawpixelinfo* dpi, int32_t x, int32_t y, int32_t value, int32_t colour)
static void window_ride_maintenance_draw_bar(
rct_window* w, rct_drawpixelinfo* dpi, int32_t x, int32_t y, int32_t value, int32_t colour)
{
gfx_fill_rect_inset(dpi, x, y, x + 149, y + 8, w->colours[1], INSET_RECT_F_30);
if (colour & BAR_BLINK)
@ -4282,12 +4284,13 @@ static void window_ride_maintenance_paint(rct_window* w, rct_drawpixelinfo* dpi)
#pragma region Colour
static constexpr const uint8_t window_ride_entrance_style_list[]
= { RIDE_ENTRANCE_STYLE_PLAIN, RIDE_ENTRANCE_STYLE_CANVAS_TENT, RIDE_ENTRANCE_STYLE_WOODEN,
RIDE_ENTRANCE_STYLE_CASTLE_BROWN, RIDE_ENTRANCE_STYLE_CASTLE_GREY, RIDE_ENTRANCE_STYLE_LOG_CABIN,
RIDE_ENTRANCE_STYLE_JUNGLE, RIDE_ENTRANCE_STYLE_CLASSICAL_ROMAN, RIDE_ENTRANCE_STYLE_ABSTRACT,
RIDE_ENTRANCE_STYLE_SNOW_ICE, RIDE_ENTRANCE_STYLE_PAGODA, RIDE_ENTRANCE_STYLE_SPACE,
RIDE_ENTRANCE_STYLE_NONE };
static constexpr const uint8_t window_ride_entrance_style_list[] = {
RIDE_ENTRANCE_STYLE_PLAIN, RIDE_ENTRANCE_STYLE_CANVAS_TENT, RIDE_ENTRANCE_STYLE_WOODEN,
RIDE_ENTRANCE_STYLE_CASTLE_BROWN, RIDE_ENTRANCE_STYLE_CASTLE_GREY, RIDE_ENTRANCE_STYLE_LOG_CABIN,
RIDE_ENTRANCE_STYLE_JUNGLE, RIDE_ENTRANCE_STYLE_CLASSICAL_ROMAN, RIDE_ENTRANCE_STYLE_ABSTRACT,
RIDE_ENTRANCE_STYLE_SNOW_ICE, RIDE_ENTRANCE_STYLE_PAGODA, RIDE_ENTRANCE_STYLE_SPACE,
RIDE_ENTRANCE_STYLE_NONE
};
static uint32_t window_ride_get_colour_button_image(int32_t colour)
{
@ -4495,8 +4498,8 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
for (i = 0; i < 3; i++)
{
gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL;
gDropdownItemsArgs[i]
= (RideComponentNames[RideNameConvention[ride->type].vehicle].singular << 16) | VehicleColourSchemeNames[i];
gDropdownItemsArgs[i] = (RideComponentNames[RideNameConvention[ride->type].vehicle].singular << 16)
| VehicleColourSchemeNames[i];
}
window_dropdown_show_text_custom_width(
@ -4721,8 +4724,8 @@ static void window_ride_colour_invalidate(rct_window* w)
if (window_ride_has_track_colour(ride, 1))
{
window_ride_colour_widgets[WIDX_TRACK_ADDITIONAL_COLOUR].type = WWT_COLOURBTN;
window_ride_colour_widgets[WIDX_TRACK_ADDITIONAL_COLOUR].image
= window_ride_get_colour_button_image(trackColour.additional);
window_ride_colour_widgets[WIDX_TRACK_ADDITIONAL_COLOUR].image = window_ride_get_colour_button_image(
trackColour.additional);
}
else
{
@ -4800,13 +4803,13 @@ static void window_ride_colour_invalidate(rct_window* w)
if (allowChangingAdditionalColour1)
{
window_ride_colour_widgets[WIDX_VEHICLE_ADDITIONAL_COLOUR_1].type = WWT_COLOURBTN;
window_ride_colour_widgets[WIDX_VEHICLE_ADDITIONAL_COLOUR_1].image
= window_ride_get_colour_button_image(vehicleColour.additional_1);
window_ride_colour_widgets[WIDX_VEHICLE_ADDITIONAL_COLOUR_1].image = window_ride_get_colour_button_image(
vehicleColour.additional_1);
if (allowChangingAdditionalColour2)
{
window_ride_colour_widgets[WIDX_VEHICLE_ADDITIONAL_COLOUR_2].type = WWT_COLOURBTN;
window_ride_colour_widgets[WIDX_VEHICLE_ADDITIONAL_COLOUR_2].image
= window_ride_get_colour_button_image(vehicleColour.additional_2);
window_ride_colour_widgets[WIDX_VEHICLE_ADDITIONAL_COLOUR_2].image = window_ride_get_colour_button_image(
vehicleColour.additional_2);
}
else
{
@ -4839,8 +4842,9 @@ static void window_ride_colour_invalidate(rct_window* w)
{
window_ride_colour_widgets[WIDX_VEHICLE_COLOUR_INDEX].type = WWT_DROPDOWN;
window_ride_colour_widgets[WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN].type = WWT_BUTTON;
window_ride_colour_widgets[WIDX_VEHICLE_COLOUR_INDEX].text
= vehicleColourSchemeType == 1 ? STR_RIDE_COLOUR_TRAIN_VALUE : STR_RIDE_COLOUR_VEHICLE_VALUE;
window_ride_colour_widgets[WIDX_VEHICLE_COLOUR_INDEX].text = vehicleColourSchemeType == 1
? STR_RIDE_COLOUR_TRAIN_VALUE
: STR_RIDE_COLOUR_VEHICLE_VALUE;
}
else
{
@ -4932,8 +4936,8 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi)
int32_t x = w->x + (widget->left + widget->right) / 2 - 8;
int32_t y = w->y + (widget->bottom + widget->top) / 2 - 6;
uint8_t shopItem
= rideEntry->shop_item_secondary == SHOP_ITEM_NONE ? rideEntry->shop_item : rideEntry->shop_item_secondary;
uint8_t shopItem = rideEntry->shop_item_secondary == SHOP_ITEM_NONE ? rideEntry->shop_item
: rideEntry->shop_item_secondary;
int32_t spriteIndex = ShopItemImage[shopItem];
spriteIndex |= SPRITE_ID_PALETTE_COLOUR_1(ride->track_colour_main[0]);
@ -5007,11 +5011,11 @@ static void window_ride_colour_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi
y = vehiclePreviewWidget->bottom - vehiclePreviewWidget->top - 15;
// ?
trainCarIndex
= (ride->colour_scheme_type & 3) == RIDE_COLOUR_SCHEME_DIFFERENT_PER_CAR ? w->vehicleIndex : rideEntry->tab_vehicle;
trainCarIndex = (ride->colour_scheme_type & 3) == RIDE_COLOUR_SCHEME_DIFFERENT_PER_CAR ? w->vehicleIndex
: rideEntry->tab_vehicle;
rct_ride_entry_vehicle* rideVehicleEntry
= &rideEntry->vehicles[ride_entry_get_vehicle_at_position(ride->subtype, ride->num_cars_per_train, trainCarIndex)];
rct_ride_entry_vehicle* rideVehicleEntry = &rideEntry->vehicles[ride_entry_get_vehicle_at_position(
ride->subtype, ride->num_cars_per_train, trainCarIndex)];
y += rideVehicleEntry->tab_height;
@ -5594,8 +5598,8 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
rct_string_id ratingName = get_rating_name(ride->excitement);
set_format_arg(0, uint32_t, ride->excitement);
set_format_arg(4, rct_string_id, ratingName);
rct_string_id stringId
= ride->excitement == RIDE_RATING_UNDEFINED ? STR_EXCITEMENT_RATING_NOT_YET_AVAILABLE : STR_EXCITEMENT_RATING;
rct_string_id stringId = ride->excitement == RIDE_RATING_UNDEFINED ? STR_EXCITEMENT_RATING_NOT_YET_AVAILABLE
: STR_EXCITEMENT_RATING;
gfx_draw_string_left(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, x, y);
y += LIST_ROW_HEIGHT;

View File

@ -479,8 +479,8 @@ static void sub_6CBCE2(
static void window_ride_construction_update_map_selection();
static void window_ride_construction_update_possible_ride_configurations();
static void window_ride_construction_update_widgets(rct_window* w);
static void
window_ride_construction_select_map_tiles(Ride* ride, int32_t trackType, int32_t trackDirection, int32_t x, int32_t y);
static void window_ride_construction_select_map_tiles(
Ride* ride, int32_t trackType, int32_t trackDirection, int32_t x, int32_t y);
static void window_ride_construction_show_special_track_dropdown(rct_window* w, rct_widget* widget);
static void ride_selected_track_set_seat_rotation(int32_t seatRotation);
static void loc_6C7502(int32_t al);
@ -1879,8 +1879,8 @@ static void window_ride_construction_mouseup_demolish(rct_window* w)
return;
}
const rct_preview_track* trackBlock
= get_track_def_from_ride_index(_currentRideIndex, track_element_get_type(tileElement));
const rct_preview_track* trackBlock = get_track_def_from_ride_index(
_currentRideIndex, track_element_get_type(tileElement));
z = (tileElement->base_height * 8) - trackBlock->z;
gGotoStartPlacementMode = true;
}
@ -2204,8 +2204,8 @@ static void window_ride_construction_invalidate(rct_window* w)
set_format_arg(2, uint16_t, brakeSpeed2);
}
window_ride_construction_widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].text
= RideConstructionSeatAngleRotationStrings[_currentSeatRotationAngle];
window_ride_construction_widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].text = RideConstructionSeatAngleRotationStrings
[_currentSeatRotationAngle];
// Set window title arguments
set_format_arg(4, rct_string_id, ride->name);
@ -2517,8 +2517,8 @@ void window_ride_construction_update_enabled_track_pieces()
{
Ride* ride = get_ride(_currentRideIndex);
rct_ride_entry* rideEntry = get_ride_entry_by_ride(ride);
int32_t rideType
= (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? RideData4[ride->type].alternate_type : ride->type;
int32_t rideType = (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? RideData4[ride->type].alternate_type
: ride->type;
if (rideEntry == nullptr)
return;
@ -2569,8 +2569,8 @@ void sub_6C94D8()
}
else
{
_currentTrackPrice
= place_provisional_track_piece(rideIndex, type, direction, liftHillAndAlternativeState, x, y, z);
_currentTrackPrice = place_provisional_track_piece(
rideIndex, type, direction, liftHillAndAlternativeState, x, y, z);
window_ride_construction_update_active_elements();
}
}
@ -3313,8 +3313,8 @@ static void window_ride_construction_update_widgets(rct_window* w)
window_invalidate(w);
}
static void
window_ride_construction_select_map_tiles(Ride* ride, int32_t trackType, int32_t trackDirection, int32_t x, int32_t y)
static void window_ride_construction_select_map_tiles(
Ride* ride, int32_t trackType, int32_t trackDirection, int32_t x, int32_t y)
{
// If the scenery tool is active, we do not display our tiles as it
// will conflict with larger scenery objects selecting tiles
@ -3574,8 +3574,8 @@ void ride_construction_toolupdate_construct(int32_t screenX, int32_t screenY)
{
window_ride_construction_update_state(
&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr);
_currentTrackPrice
= place_provisional_track_piece(rideIndex, trackType, trackDirection, liftHillAndAlternativeState, x, y, z);
_currentTrackPrice = place_provisional_track_piece(
rideIndex, trackType, trackDirection, liftHillAndAlternativeState, x, y, z);
if (_currentTrackPrice != MONEY32_UNDEFINED)
break;
@ -3601,8 +3601,8 @@ void ride_construction_toolupdate_construct(int32_t screenX, int32_t screenY)
{
window_ride_construction_update_state(
&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr);
_currentTrackPrice
= place_provisional_track_piece(rideIndex, trackType, trackDirection, liftHillAndAlternativeState, x, y, z);
_currentTrackPrice = place_provisional_track_piece(
rideIndex, trackType, trackDirection, liftHillAndAlternativeState, x, y, z);
if (_currentTrackPrice != MONEY32_UNDEFINED)
break;
@ -3721,8 +3721,8 @@ void ride_construction_toolupdate_entrance_exit(int32_t screenX, int32_t screenY
|| y != gRideEntranceExitGhostPosition.y || direction != gRideEntranceExitGhostPosition.direction
|| stationNum != gRideEntranceExitGhostStationIndex)
{
_currentTrackPrice
= ride_entrance_exit_place_ghost(_currentRideIndex, x, y, direction, gRideEntranceExitPlaceType, stationNum);
_currentTrackPrice = ride_entrance_exit_place_ghost(
_currentRideIndex, x, y, direction, gRideEntranceExitPlaceType, stationNum);
window_ride_construction_update_active_elements();
}
}

View File

@ -503,8 +503,8 @@ static void window_ride_list_tooltip(rct_window* w, rct_widgetindex widgetIndex,
*/
static void window_ride_list_invalidate(rct_window* w)
{
window_ride_list_widgets[WIDX_CURRENT_INFORMATION_TYPE].text
= ride_info_type_string_mapping[_window_ride_list_information_type];
window_ride_list_widgets[WIDX_CURRENT_INFORMATION_TYPE].text = ride_info_type_string_mapping
[_window_ride_list_information_type];
// Set correct active tab
for (int32_t i = 0; i < 3; i++)
@ -563,10 +563,10 @@ static void window_ride_list_invalidate(rct_window* w)
allOpen = false;
}
}
w->widgets[WIDX_CLOSE_LIGHT].image
= SPR_G2_RCT1_CLOSE_BUTTON_0 + (allClosed == 1) * 2 + widget_is_pressed(w, WIDX_CLOSE_LIGHT);
w->widgets[WIDX_OPEN_LIGHT].image
= SPR_G2_RCT1_OPEN_BUTTON_0 + (allOpen == 1) * 2 + widget_is_pressed(w, WIDX_OPEN_LIGHT);
w->widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + (allClosed == 1) * 2
+ widget_is_pressed(w, WIDX_CLOSE_LIGHT);
w->widgets[WIDX_OPEN_LIGHT].image = SPR_G2_RCT1_OPEN_BUTTON_0 + (allOpen == 1) * 2
+ widget_is_pressed(w, WIDX_OPEN_LIGHT);
w->widgets[WIDX_QUICK_DEMOLISH].top = w->widgets[WIDX_OPEN_LIGHT].bottom + 3;
}
else
@ -750,8 +750,8 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
if (gRideClassifications[ride->type] == RIDE_CLASS_RIDE)
{
set_format_arg(2, uint16_t, ride->guests_favourite);
formatSecondary
= ride->guests_favourite == 1 ? STR_GUESTS_FAVOURITE_LABEL : STR_GUESTS_FAVOURITE_PLURAL_LABEL;
formatSecondary = ride->guests_favourite == 1 ? STR_GUESTS_FAVOURITE_LABEL
: STR_GUESTS_FAVOURITE_PLURAL_LABEL;
}
break;
}

View File

@ -168,8 +168,8 @@ rct_window* window_save_prompt_open()
log_warning("Invalid save prompt mode %u", prompt_mode);
return nullptr;
}
window
= window_create_centred(width, height, &window_save_prompt_events, WC_SAVE_PROMPT, WF_TRANSPARENT | WF_STICK_TO_FRONT);
window = window_create_centred(
width, height, &window_save_prompt_events, WC_SAVE_PROMPT, WF_TRANSPARENT | WF_STICK_TO_FRONT);
window->widgets = widgets;
window->enabled_widgets = enabled_widgets;

View File

@ -826,8 +826,8 @@ static void window_scenery_update(rct_window* w)
}
else if (tabSelectedSceneryId >= 0x300)
{ // large scenery
gCurrentToolId
= static_cast<TOOL_IDX>(get_large_scenery_entry(tabSelectedSceneryId - 0x300)->large_scenery.tool_id);
gCurrentToolId = static_cast<TOOL_IDX>(
get_large_scenery_entry(tabSelectedSceneryId - 0x300)->large_scenery.tool_id);
}
else if (tabSelectedSceneryId >= 0x200)
{ // wall
@ -1006,12 +1006,13 @@ void window_scenery_invalidate(rct_window* w)
}
}
window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].image
= SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryPrimaryColour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].image
= SPRITE_ID_PALETTE_COLOUR_1(gWindowScenerySecondaryColour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
window_scenery_widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].image
= SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryTertiaryColour) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryPrimaryColour)
| IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(
gWindowScenerySecondaryColour)
| IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
window_scenery_widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].image = SPRITE_ID_PALETTE_COLOUR_1(gWindowSceneryTertiaryColour)
| IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
window_scenery_widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WWT_EMPTY;
window_scenery_widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WWT_EMPTY;

View File

@ -822,8 +822,8 @@ void window_staff_options_invalidate(rct_window* w)
window_staff_options_widgets[WIDX_CHECKBOX_4].text = STR_STAFF_OPTION_MOW_GRASS;
window_staff_options_widgets[WIDX_COSTUME_BOX].type = WWT_EMPTY;
window_staff_options_widgets[WIDX_COSTUME_BTN].type = WWT_EMPTY;
w->pressed_widgets
&= ~((1 << WIDX_CHECKBOX_1) | (1 << WIDX_CHECKBOX_2) | (1 << WIDX_CHECKBOX_3) | (1 << WIDX_CHECKBOX_4));
w->pressed_widgets &= ~(
(1 << WIDX_CHECKBOX_1) | (1 << WIDX_CHECKBOX_2) | (1 << WIDX_CHECKBOX_3) | (1 << WIDX_CHECKBOX_4));
w->pressed_widgets |= peep->staff_orders << WIDX_CHECKBOX_1;
break;
case STAFF_TYPE_MECHANIC:

View File

@ -524,8 +524,9 @@ void window_staff_list_invalidate(rct_window* w)
if (tabIndex < 3)
{
window_staff_list_widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WWT_COLOURBTN;
window_staff_list_widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].image
= SPRITE_ID_PALETTE_COLOUR_1((uint32_t)staff_get_colour(tabIndex)) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
window_staff_list_widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].image = SPRITE_ID_PALETTE_COLOUR_1(
(uint32_t)staff_get_colour(tabIndex))
| IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
}
if (_quick_fire_mode)
w->pressed_widgets |= (1ULL << WIDX_STAFF_LIST_QUICK_FIRE);

View File

@ -641,8 +641,8 @@ void window_themes_scrollgetsize(rct_window* w, int32_t scrollIndex, int32_t* wi
return;
int32_t scrollHeight = get_colour_scheme_tab_count() * _row_height;
int32_t i
= scrollHeight - window_themes_widgets[WIDX_THEMES_LIST].bottom + window_themes_widgets[WIDX_THEMES_LIST].top + 21;
int32_t i = scrollHeight - window_themes_widgets[WIDX_THEMES_LIST].bottom + window_themes_widgets[WIDX_THEMES_LIST].top
+ 21;
if (i < 0)
i = 0;
if (i < w->scrolls[0].v_top)
@ -676,14 +676,16 @@ void window_themes_scrollmousedown(rct_window* w, int32_t scrollIndex, int32_t x
else
{
window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].type = WWT_COLOURBTN;
window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].left
= _button_offset_x + _colour_index_2 * 12 + window_themes_widgets[WIDX_THEMES_LIST].left;
window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].left = _button_offset_x + _colour_index_2 * 12
+ window_themes_widgets[WIDX_THEMES_LIST].left;
window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].top = _colour_index_1 * _row_height + _button_offset_y
- w->scrolls[0].v_top + window_themes_widgets[WIDX_THEMES_LIST].top;
window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].right
= window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].left + 12;
window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].bottom
= window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].top + 12;
window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].right = window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK]
.left
+ 12;
window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].bottom = window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK]
.top
+ 12;
uint8_t colour = theme_get_colour(wc, _colour_index_2);
window_dropdown_show_colour(w, &(window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK]), w->colours[1], colour);
@ -951,8 +953,8 @@ void window_themes_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t sc
gfx_draw_string_left(dpi, theme_desc_get_name(wc), nullptr, w->colours[1], 2, y + 4);
uint8_t colour = theme_get_colour(wc, j);
uint32_t image
= SPRITE_ID_PALETTE_COLOUR_1(colour & ~COLOUR_FLAG_TRANSLUCENT) | IMAGE_TYPE_TRANSPARENT | SPR_PALETTE_BTN;
uint32_t image = SPRITE_ID_PALETTE_COLOUR_1(colour & ~COLOUR_FLAG_TRANSLUCENT) | IMAGE_TYPE_TRANSPARENT
| SPR_PALETTE_BTN;
if (i == _colour_index_1 && j == _colour_index_2)
{
image = SPRITE_ID_PALETTE_COLOUR_1(colour & ~COLOUR_FLAG_TRANSLUCENT) | IMAGE_TYPE_TRANSPARENT

View File

@ -2083,8 +2083,8 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
}
else
{
int16_t rideEntranceIndex
= (tileElement->properties.entrance.index & 0x30) >> 4; // TODO: use mask or function
int16_t rideEntranceIndex = (tileElement->properties.entrance.index & 0x30)
>> 4; // TODO: use mask or function
if (tileElement->properties.entrance.type == ENTRANCE_TYPE_RIDE_ENTRANCE)
{
// Ride entrance ID

View File

@ -244,8 +244,8 @@ void window_title_command_editor_open(TitleSequence* sequence, int32_t index, bo
if (window_find_by_class(WC_TITLE_COMMAND_EDITOR) != nullptr)
return;
rct_window* window
= window_create_centred(WW, WH, &window_title_command_editor_events, WC_TITLE_COMMAND_EDITOR, WF_STICK_TO_FRONT);
rct_window* window = window_create_centred(
WW, WH, &window_title_command_editor_events, WC_TITLE_COMMAND_EDITOR, WF_STICK_TO_FRONT);
window_title_command_editor_widgets[WIDX_TEXTBOX_FULL].string = textbox1Buffer;
window_title_command_editor_widgets[WIDX_TEXTBOX_X].string = textbox1Buffer;
window_title_command_editor_widgets[WIDX_TEXTBOX_Y].string = textbox2Buffer;

View File

@ -59,8 +59,8 @@ static rct_window_event_list window_title_logo_events = {
*/
rct_window* window_title_logo_open()
{
rct_window* window
= window_create(0, 0, 232, 136, &window_title_logo_events, WC_TITLE_LOGO, WF_STICK_TO_BACK | WF_TRANSPARENT);
rct_window* window = window_create(
0, 0, 232, 136, &window_title_logo_events, WC_TITLE_LOGO, WF_STICK_TO_BACK | WF_TRANSPARENT);
window->widgets = window_title_logo_widgets;
window_init_scroll_widgets(window);
window->colours[0] = TRANSLUCENT(COLOUR_GREY);

View File

@ -530,8 +530,9 @@ static void window_scenarioselect_scrollpaint(rct_window* w, rct_drawpixelinfo*
rct_string_id highlighted_format = (theme_get_flags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT)
? STR_WHITE_STRING
: STR_WINDOW_COLOUR_2_STRINGID;
rct_string_id unhighlighted_format
= (theme_get_flags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT) ? STR_WHITE_STRING : STR_BLACK_STRING;
rct_string_id unhighlighted_format = (theme_get_flags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT)
? STR_WHITE_STRING
: STR_BLACK_STRING;
bool wide = gConfigGeneral.scenario_select_mode == SCENARIO_SELECT_MODE_ORIGIN || _titleEditor;
@ -614,8 +615,8 @@ static void window_scenarioselect_scrollpaint(rct_window* w, rct_drawpixelinfo*
}
}
static void
draw_category_heading(rct_window* w, rct_drawpixelinfo* dpi, int32_t left, int32_t right, int32_t y, rct_string_id stringId)
static void draw_category_heading(
rct_window* w, rct_drawpixelinfo* dpi, int32_t left, int32_t right, int32_t y, rct_string_id stringId)
{
uint8_t baseColour = w->colours[1];
uint8_t lightColour = ColourMapA[baseColour].lighter;

View File

@ -2299,11 +2299,11 @@ static void top_toolbar_tool_update_water(int16_t x, int16_t y)
if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE))
return;
money32 lower_cost
= lower_water(gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y, 0);
money32 lower_cost = lower_water(
gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y, 0);
money32 raise_cost
= raise_water(gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y, 0);
money32 raise_cost = raise_water(
gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y, 0);
if (gWaterToolRaiseCost != raise_cost || gWaterToolLowerCost != lower_cost)
{
@ -2396,11 +2396,11 @@ static void top_toolbar_tool_update_water(int16_t x, int16_t y)
if (!state_changed)
return;
money32 lower_cost
= lower_water(gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y, 0);
money32 lower_cost = lower_water(
gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y, 0);
money32 raise_cost
= raise_water(gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y, 0);
money32 raise_cost = raise_water(
gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y, 0);
if (gWaterToolRaiseCost != raise_cost || gWaterToolLowerCost != lower_cost)
{

View File

@ -528,8 +528,8 @@ static void window_track_place_draw_mini_preview_track(
uint8_t rotation = (_currentTrackPieceDirection + get_current_rotation()) & 3;
rct_td6_track_element* trackElement = td6->track_elements;
const rct_preview_track** trackBlockArray
= (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_TRACK)) ? TrackBlocks : FlatRideTrackBlocks;
const rct_preview_track** trackBlockArray = (ride_type_has_flag(td6->type, RIDE_TYPE_FLAG_HAS_TRACK)) ? TrackBlocks
: FlatRideTrackBlocks;
while (trackElement->type != 255)
{

View File

@ -127,8 +127,8 @@ static void window_view_clipping_set_clipheight(rct_window* w, const uint8_t cli
gClipHeight = clipheight;
rct_widget* widget = &window_view_clipping_widgets[WIDX_CLIP_HEIGHT_SLIDER];
const float clip_height_ratio = (float)gClipHeight / 255;
w->scrolls[0].h_left
= (int16_t)std::ceil(clip_height_ratio * (w->scrolls[0].h_right - ((widget->right - widget->left) - 1)));
w->scrolls[0].h_left = (int16_t)std::ceil(
clip_height_ratio * (w->scrolls[0].h_right - ((widget->right - widget->left) - 1)));
}
rct_window* window_view_clipping_open()

View File

@ -562,8 +562,8 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc)
spriteFileEntries[spriteFileHeader.num_entries - 1] = spriteElement;
memcpy(spriteFileData + (spriteFileHeader.total_size - bufferLength), buffer, bufferLength);
spriteFileEntries[spriteFileHeader.num_entries - 1].offset
= spriteFileData + (spriteFileHeader.total_size - bufferLength);
spriteFileEntries[spriteFileHeader.num_entries - 1].offset = spriteFileData
+ (spriteFileHeader.total_size - bufferLength);
free(buffer);
if (!sprite_file_save(spriteFilePath))
@ -689,8 +689,8 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc)
spriteFileHeader.num_entries++;
spriteFileHeader.total_size += bufferLength;
spriteFileEntries
= (rct_g1_element*)realloc(spriteFileEntries, spriteFileHeader.num_entries * sizeof(rct_g1_element));
spriteFileEntries = (rct_g1_element*)realloc(
spriteFileEntries, spriteFileHeader.num_entries * sizeof(rct_g1_element));
sprite_entries_make_relative();
spriteFileData = (uint8_t*)realloc(spriteFileData, spriteFileHeader.total_size);
@ -698,8 +698,8 @@ int32_t cmdline_for_sprite(const char** argv, int32_t argc)
spriteFileEntries[spriteFileHeader.num_entries - 1] = spriteElement;
memcpy(spriteFileData + (spriteFileHeader.total_size - bufferLength), buffer, bufferLength);
spriteFileEntries[spriteFileHeader.num_entries - 1].offset
= spriteFileData + (spriteFileHeader.total_size - bufferLength);
spriteFileEntries[spriteFileHeader.num_entries - 1].offset = spriteFileData
+ (spriteFileHeader.total_size - bufferLength);
free(buffer);

View File

@ -497,8 +497,8 @@ namespace OpenRCT2
try
{
auto result
= parkImporter->LoadFromStream(stream, info.Type == FILE_TYPE::SCENARIO, false, path.c_str());
auto result = parkImporter->LoadFromStream(
stream, info.Type == FILE_TYPE::SCENARIO, false, path.c_str());
_objectManager->LoadObjects(result.RequiredObjects.data(), result.RequiredObjects.size());
parkImporter->Import();
String::Set(gScenarioSavePath, Util::CountOf(gScenarioSavePath), path.c_str());

View File

@ -35,8 +35,9 @@ static FILE* diagnostic_get_stream(DIAGNOSTIC_LEVEL level)
#ifdef __ANDROID__
int _android_log_priority[DIAGNOSTIC_LEVEL_COUNT]
= { ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, ANDROID_LOG_VERBOSE, ANDROID_LOG_INFO };
int _android_log_priority[DIAGNOSTIC_LEVEL_COUNT] = {
ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, ANDROID_LOG_VERBOSE, ANDROID_LOG_INFO
};
void diagnostic_log(DIAGNOSTIC_LEVEL diagnosticLevel, const char* format, ...)
{

View File

@ -409,8 +409,8 @@ int32_t game_do_command_p(
}
// Log certain commands if we are in multiplayer and logging is enabled
bool serverLog
= (network_get_mode() == NETWORK_MODE_SERVER) && gGameCommandNestLevel == 1 && gConfigNetwork.log_server_actions;
bool serverLog = (network_get_mode() == NETWORK_MODE_SERVER) && gGameCommandNestLevel == 1
&& gConfigNetwork.log_server_actions;
bool clientLog = (network_get_mode() == NETWORK_MODE_CLIENT) && (flags & GAME_COMMAND_FLAG_NETWORKED)
&& gGameCommandNestLevel == 1 && gConfigNetwork.log_server_actions;
if (serverLog || clientLog)

View File

@ -118,10 +118,10 @@ enum
ERROR_TYPE_FILE_LOAD = 255
};
using GAME_COMMAND_POINTER
= void(int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
using GAME_COMMAND_CALLBACK_POINTER
= void(int32_t eax, int32_t ebx, int32_t ecx, int32_t edx, int32_t esi, int32_t edi, int32_t ebp);
using GAME_COMMAND_POINTER = void(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
using GAME_COMMAND_CALLBACK_POINTER = void(
int32_t eax, int32_t ebx, int32_t ecx, int32_t edx, int32_t esi, int32_t edi, int32_t ebp);
extern GAME_COMMAND_CALLBACK_POINTER* game_command_callback;
int32_t game_command_callback_get_index(GAME_COMMAND_CALLBACK_POINTER* callback);

View File

@ -92,8 +92,8 @@ void intro_update()
}
// Play the track friction sound
_soundChannel
= Mixer_Play_Effect(SOUND_TRACK_FRICTION_3, MIXER_LOOP_INFINITE, MIXER_VOLUME_MAX, 0.25f, 0.75, true);
_soundChannel = Mixer_Play_Effect(
SOUND_TRACK_FRICTION_3, MIXER_LOOP_INFINITE, MIXER_VOLUME_MAX, 0.25f, 0.75, true);
}
// Check if logo is off the screen...ish

View File

@ -65,8 +65,8 @@ namespace ParkImporter
{
std::unique_ptr<IParkImporter> Create(const std::string& hintPath);
std::unique_ptr<IParkImporter> CreateS4();
std::unique_ptr<IParkImporter>
CreateS6(std::shared_ptr<IObjectRepository> objectRepository, std::shared_ptr<IObjectManager> objectManager);
std::unique_ptr<IParkImporter> CreateS6(
std::shared_ptr<IObjectRepository> objectRepository, std::shared_ptr<IObjectManager> objectManager);
bool ExtensionIsRCT1(const std::string& extension);
bool ExtensionIsScenario(const std::string& extension);

View File

@ -69,8 +69,8 @@ public:
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_CANT_NAME_GUEST, STR_NONE);
}
rct_string_id newUserStringId
= user_string_allocate(USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
rct_string_id newUserStringId = user_string_allocate(
USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
if (newUserStringId == 0)
{
// TODO: Probably exhausted, introduce new error.
@ -83,8 +83,8 @@ public:
GameActionResult::Ptr Execute() const override
{
rct_string_id newUserStringId
= user_string_allocate(USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
rct_string_id newUserStringId = user_string_allocate(
USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
if (newUserStringId == 0)
{
// TODO: Probably exhausted, introduce new error.

View File

@ -217,8 +217,8 @@ public:
uint8_t baseHeight = _z >> 3;
uint8_t clearanceHeight = (_z + 32) >> 3;
rct_tile_element* tileElement
= map_get_track_element_at_of_type_from_ride(_x, _y, baseHeight, TRACK_ELEM_MAZE, _rideIndex);
rct_tile_element* tileElement = map_get_track_element_at_of_type_from_ride(
_x, _y, baseHeight, TRACK_ELEM_MAZE, _rideIndex);
if (tileElement == nullptr)
{
Ride* ride = get_ride(_rideIndex);

View File

@ -65,8 +65,8 @@ public:
GA_ERROR::INVALID_PARAMETERS, STR_CANT_RENAME_RIDE_ATTRACTION, STR_INVALID_RIDE_ATTRACTION_NAME);
}
rct_string_id newUserStringId
= user_string_allocate(USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
rct_string_id newUserStringId = user_string_allocate(
USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
if (newUserStringId == 0)
{
// TODO: Probably exhausted, introduce new error.
@ -79,8 +79,8 @@ public:
GameActionResult::Ptr Execute() const override
{
rct_string_id newUserStringId
= user_string_allocate(USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
rct_string_id newUserStringId = user_string_allocate(
USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
Ride* ride = get_ride(_rideIndex);
if (ride->type == RIDE_TYPE_NULL)

View File

@ -71,8 +71,8 @@ public:
GA_ERROR::INVALID_PARAMETERS, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE);
}
rct_string_id newUserStringId
= user_string_allocate(USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
rct_string_id newUserStringId = user_string_allocate(
USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
if (newUserStringId == 0)
{
// TODO: Probably exhausted, introduce new error.
@ -86,8 +86,8 @@ public:
GameActionResult::Ptr Execute() const override
{
rct_string_id newUserStringId
= user_string_allocate(USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
rct_string_id newUserStringId = user_string_allocate(
USER_STRING_HIGH_ID_NUMBER | USER_STRING_DUPLICATION_PERMITTED, _name.c_str());
if (newUserStringId == 0)
{
// TODO: Probably exhausted, introduce new error.

View File

@ -43,8 +43,8 @@ namespace OpenRCT2::Audio
{
return nullptr;
}
IAudioChannel*
PlaySoundPanned(int32_t /*soundId*/, int32_t /*pan*/, int16_t /*x*/, int16_t /*y*/, int16_t /*z*/) override
IAudioChannel* PlaySoundPanned(
int32_t /*soundId*/, int32_t /*pan*/, int16_t /*x*/, int16_t /*y*/, int16_t /*z*/) override
{
return nullptr;
}

View File

@ -17,8 +17,8 @@ static exitcode_t HandleUri(const std::string& uri);
#ifndef DISABLE_NETWORK
static exitcode_t HandleUriJoin(const std::vector<std::string>& args);
static bool
TryParseHostnamePort(const std::string& hostnamePort, std::string* outHostname, int32_t* outPort, int32_t defaultPort);
static bool TryParseHostnamePort(
const std::string& hostnamePort, std::string* outHostname, int32_t* outPort, int32_t defaultPort);
#endif
exitcode_t CommandLine::HandleCommandUri(CommandLineArgEnumerator* enumerator)
@ -75,8 +75,8 @@ static exitcode_t HandleUriJoin(const std::vector<std::string>& args)
}
}
static bool
TryParseHostnamePort(const std::string& hostnamePort, std::string* outHostname, int32_t* outPort, int32_t defaultPort)
static bool TryParseHostnamePort(
const std::string& hostnamePort, std::string* outHostname, int32_t* outPort, int32_t defaultPort)
{
try
{

View File

@ -139,8 +139,8 @@ namespace Config
model->confirmation_prompt = reader->GetBoolean("confirmation_prompt", false);
model->currency_format = reader->GetEnum<int32_t>("currency_format", platform_get_locale_currency(), Enum_Currency);
model->custom_currency_rate = reader->GetInt32("custom_currency_rate", 10);
model->custom_currency_affix
= reader->GetEnum<int32_t>("custom_currency_affix", CURRENCY_SUFFIX, Enum_CurrencySymbolAffix);
model->custom_currency_affix = reader->GetEnum<int32_t>(
"custom_currency_affix", CURRENCY_SUFFIX, Enum_CurrencySymbolAffix);
model->custom_currency_symbol = reader->GetCString("custom_currency_symbol", "Ctm");
model->edge_scrolling = reader->GetBoolean("edge_scrolling", true);
model->edge_scrolling_speed = reader->GetInt32("edge_scrolling_speed", 12);
@ -157,8 +157,8 @@ namespace Config
model->save_plugin_data = reader->GetBoolean("save_plugin_data", true);
model->debugging_tools = reader->GetBoolean("debugging_tools", false);
model->show_height_as_units = reader->GetBoolean("show_height_as_units", false);
model->temperature_format
= reader->GetEnum<int32_t>("temperature_format", platform_get_locale_temperature_format(), Enum_Temperature);
model->temperature_format = reader->GetEnum<int32_t>(
"temperature_format", platform_get_locale_temperature_format(), Enum_Temperature);
model->window_height = reader->GetInt32("window_height", -1);
model->window_snap_proximity = reader->GetInt32("window_snap_proximity", 5);
model->window_width = reader->GetInt32("window_width", -1);
@ -166,8 +166,8 @@ namespace Config
model->drawing_engine = reader->GetEnum<int32_t>("drawing_engine", DRAWING_ENGINE_SOFTWARE, Enum_DrawingEngine);
model->uncap_fps = reader->GetBoolean("uncap_fps", false);
model->use_vsync = reader->GetBoolean("use_vsync", true);
model->virtual_floor_style
= reader->GetEnum<int32_t>("virtual_floor_style", VIRTUAL_FLOOR_STYLE_GLASSY, Enum_VirtualFloorStyle);
model->virtual_floor_style = reader->GetEnum<int32_t>(
"virtual_floor_style", VIRTUAL_FLOOR_STYLE_GLASSY, Enum_VirtualFloorStyle);
// Default config setting is false until ghost trains are implemented #4540
model->test_unfinished_tracks = reader->GetBoolean("test_unfinished_tracks", false);

View File

@ -163,8 +163,8 @@ private:
stats.TotalFiles++;
stats.TotalFileSize += fileInfo->Size;
stats.FileDateModifiedChecksum
^= (uint32_t)(fileInfo->LastModified >> 32) ^ (uint32_t)(fileInfo->LastModified & 0xFFFFFFFF);
stats.FileDateModifiedChecksum ^= (uint32_t)(fileInfo->LastModified >> 32)
^ (uint32_t)(fileInfo->LastModified & 0xFFFFFFFF);
stats.FileDateModifiedChecksum = ror32(stats.FileDateModifiedChecksum, 5);
stats.PathChecksum += GetPathChecksum(path);
}

View File

@ -265,8 +265,8 @@ private:
{
result.Type = DIRECTORY_CHILD_TYPE::DC_FILE;
result.Size = ((uint64_t)child->nFileSizeHigh << 32ULL) | (uint64_t)child->nFileSizeLow;
result.LastModified
= ((uint64_t)child->ftLastWriteTime.dwHighDateTime << 32ULL) | (uint64_t)child->ftLastWriteTime.dwLowDateTime;
result.LastModified = ((uint64_t)child->ftLastWriteTime.dwHighDateTime << 32ULL)
| (uint64_t)child->ftLastWriteTime.dwLowDateTime;
}
return result;
}
@ -370,8 +370,8 @@ void Path::QueryDirectory(QueryDirectoryResult* result, const std::string& patte
result->TotalFiles++;
result->TotalFileSize += fileInfo->Size;
result->FileDateModifiedChecksum
^= (uint32_t)(fileInfo->LastModified >> 32) ^ (uint32_t)(fileInfo->LastModified & 0xFFFFFFFF);
result->FileDateModifiedChecksum ^= (uint32_t)(fileInfo->LastModified >> 32)
^ (uint32_t)(fileInfo->LastModified & 0xFFFFFFFF);
result->FileDateModifiedChecksum = ror32(result->FileDateModifiedChecksum, 5);
result->PathChecksum += GetPathChecksum(path);
}

View File

@ -40,10 +40,10 @@ static std::list<ImageList> _allocatedLists;
[[maybe_unused]] static bool AllocatedListContains(uint32_t baseImageId, uint32_t count)
{
bool contains
= std::any_of(_allocatedLists.begin(), _allocatedLists.end(), [baseImageId, count](const ImageList& imageList) -> bool {
return imageList.BaseId == baseImageId && imageList.Count == count;
});
bool contains = std::any_of(
_allocatedLists.begin(), _allocatedLists.end(), [baseImageId, count](const ImageList& imageList) -> bool {
return imageList.BaseId == baseImageId && imageList.Count == count;
});
return contains;
}

View File

@ -20,8 +20,8 @@ using ImportResult = ImageImporter::ImportResult;
constexpr int32_t PALETTE_TRANSPARENT = -1;
ImportResult
ImageImporter::Import(const Image& image, int32_t offsetX, int32_t offsetY, IMPORT_FLAGS flags, IMPORT_MODE mode) const
ImportResult ImageImporter::Import(
const Image& image, int32_t offsetX, int32_t offsetY, IMPORT_FLAGS flags, IMPORT_MODE mode) const
{
if (image.Width > 256 || image.Height > 256)
{
@ -37,8 +37,8 @@ ImportResult
const auto height = image.Height;
auto pixels = GetPixels(image.Pixels.data(), width, height, flags, mode);
auto [buffer, bufferLength]
= flags & IMPORT_FLAGS::RLE ? EncodeRLE(pixels.data(), width, height) : EncodeRaw(pixels.data(), width, height);
auto [buffer, bufferLength] = flags & IMPORT_FLAGS::RLE ? EncodeRLE(pixels.data(), width, height)
: EncodeRaw(pixels.data(), width, height);
rct_g1_element outElement;
outElement.offset = (uint8_t*)buffer;
@ -56,8 +56,8 @@ ImportResult
return result;
}
std::vector<int32_t>
ImageImporter::GetPixels(const uint8_t* pixels, uint32_t width, uint32_t height, IMPORT_FLAGS flags, IMPORT_MODE mode)
std::vector<int32_t> ImageImporter::GetPixels(
const uint8_t* pixels, uint32_t width, uint32_t height, IMPORT_FLAGS flags, IMPORT_MODE mode)
{
std::vector<int32_t> buffer;
buffer.reserve(width * height);

View File

@ -54,13 +54,13 @@ namespace OpenRCT2::Drawing
private:
static const PaletteBGRA StandardPalette[256];
static std::vector<int32_t>
GetPixels(const uint8_t* pixels, uint32_t width, uint32_t height, IMPORT_FLAGS flags, IMPORT_MODE mode);
static std::vector<int32_t> GetPixels(
const uint8_t* pixels, uint32_t width, uint32_t height, IMPORT_FLAGS flags, IMPORT_MODE mode);
static std::tuple<void*, size_t> EncodeRaw(const int32_t* pixels, uint32_t width, uint32_t height);
static std::tuple<void*, size_t> EncodeRLE(const int32_t* pixels, uint32_t width, uint32_t height);
static int32_t
CalculatePaletteIndex(IMPORT_MODE mode, int16_t* rgbaSrc, int32_t x, int32_t y, int32_t width, int32_t height);
static int32_t CalculatePaletteIndex(
IMPORT_MODE mode, int16_t* rgbaSrc, int32_t x, int32_t y, int32_t width, int32_t height);
static int32_t GetPaletteIndex(const PaletteBGRA* palette, int16_t* colour);
static bool IsTransparentPixel(const int16_t* colour);
static bool IsChangablePixel(int32_t paletteIndex);

View File

@ -434,8 +434,8 @@ void lightfx_prepare_light_list()
// log_warning("sample-count: %i, occlusion: %i", totalSamplePoints, lightIntensityOccluded / totalSamplePoints);
entry->lightIntensity
= std::min<uint32_t>(0xFF, (entry->lightIntensity * lightIntensityOccluded) / (totalSamplePoints * 100));
entry->lightIntensity = std::min<uint32_t>(
0xFF, (entry->lightIntensity * lightIntensityOccluded) / (totalSamplePoints * 100));
entry->lightIntensity = std::max<uint32_t>(0x00, entry->lightIntensity - _current_view_zoom_front * 5);
}

View File

@ -39,10 +39,10 @@ static rct_draw_scroll_text _drawScrollTextList[MAX_SCROLLING_TEXT_ENTRIES];
static uint8_t _characterBitmaps[FONT_SPRITE_GLYPH_COUNT + SPR_G2_GLYPH_COUNT][8];
static uint32_t _drawSCrollNextIndex = 0;
static void
scrolling_text_set_bitmap_for_sprite(utf8* text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets);
static void
scrolling_text_set_bitmap_for_ttf(utf8* text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets);
static void scrolling_text_set_bitmap_for_sprite(
utf8* text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets);
static void scrolling_text_set_bitmap_for_ttf(
utf8* text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets);
void scrolling_text_initialise_bitmaps()
{
@ -1508,8 +1508,8 @@ int32_t scrolling_text_setup(paint_session* session, rct_string_id stringId, uin
return imageId;
}
static void
scrolling_text_set_bitmap_for_sprite(utf8* text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets)
static void scrolling_text_set_bitmap_for_sprite(
utf8* text, int32_t scroll, uint8_t* bitmap, const int16_t* scrollPositionOffsets)
{
uint8_t characterColour = scrolling_text_get_colour(gCommonFormatArgs[7]);

View File

@ -181,8 +181,8 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor)
y = _chatBottom - inputLineHeight - 5;
lineCh = lineBuffer;
inputLineHeight
= gfx_draw_string_left_wrapped(dpi, (void*)&lineCh, x, y + 3, _chatWidth - 10, STR_STRING, TEXT_COLOUR_255);
inputLineHeight = gfx_draw_string_left_wrapped(
dpi, (void*)&lineCh, x, y + 3, _chatWidth - 10, STR_STRING, TEXT_COLOUR_255);
gfx_set_dirty_blocks(x, y, x + _chatWidth, y + inputLineHeight + 15);
// TODO: Show caret if the input text has multiple lines

View File

@ -419,8 +419,8 @@ static int32_t cc_staff(InteractiveConsole& console, const utf8** argv, int32_t
return 1;
}
peep = GET_PEEP(int_val[0]);
bool is_entertainer
= peep != nullptr && peep->type == PEEP_TYPE_STAFF && peep->staff_type == STAFF_TYPE_ENTERTAINER;
bool is_entertainer = peep != nullptr && peep->type == PEEP_TYPE_STAFF
&& peep->staff_type == STAFF_TYPE_ENTERTAINER;
if (!is_entertainer)
{
console.WriteLineError("Specified staff is not entertainer");
@ -976,8 +976,8 @@ static int32_t cc_set(InteractiveConsole& console, const utf8** argv, int32_t ar
return 0;
}
static int32_t
cc_twitch([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const utf8** argv, [[maybe_unused]] int32_t argc)
static int32_t cc_twitch(
[[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const utf8** argv, [[maybe_unused]] int32_t argc)
{
#ifdef DISABLE_TWITCH
console.WriteLineError("OpenRCT2 build not compiled with Twitch integration.");
@ -1139,16 +1139,16 @@ static int32_t cc_open(InteractiveConsole& console, const utf8** argv, int32_t a
return 0;
}
static int32_t
cc_remove_unused_objects(InteractiveConsole& console, [[maybe_unused]] const utf8** argv, [[maybe_unused]] int32_t argc)
static int32_t cc_remove_unused_objects(
InteractiveConsole& console, [[maybe_unused]] const utf8** argv, [[maybe_unused]] int32_t argc)
{
int32_t result = editor_remove_unused_objects();
console.WriteFormatLine("%d unused object entries have been removed.", result);
return 0;
}
static int32_t
cc_remove_park_fences(InteractiveConsole& console, [[maybe_unused]] const utf8** argv, [[maybe_unused]] int32_t argc)
static int32_t cc_remove_park_fences(
InteractiveConsole& console, [[maybe_unused]] const utf8** argv, [[maybe_unused]] int32_t argc)
{
tile_element_iterator it;
tile_element_iterator_begin(&it);
@ -1212,8 +1212,8 @@ static int32_t cc_show_limits(InteractiveConsole& console, [[maybe_unused]] cons
return 0;
}
static int32_t
cc_for_date([[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const utf8** argv, [[maybe_unused]] int32_t argc)
static int32_t cc_for_date(
[[maybe_unused]] InteractiveConsole& console, [[maybe_unused]] const utf8** argv, [[maybe_unused]] int32_t argc)
{
int32_t year = 0;
int32_t month = 0;

View File

@ -253,8 +253,8 @@ void viewport_adjust_for_map_height(int16_t* x, int16_t* y, int16_t* z)
/*
* rct2: 0x006E7FF3
*/
static void
viewport_redraw_after_shift(rct_drawpixelinfo* dpi, rct_window* window, rct_viewport* viewport, int32_t x, int32_t y)
static void viewport_redraw_after_shift(
rct_drawpixelinfo* dpi, rct_window* window, rct_viewport* viewport, int32_t x, int32_t y)
{
// sub-divide by intersecting windows
if (window != nullptr)
@ -375,8 +375,8 @@ static void
}
}
static void
viewport_shift_pixels(rct_drawpixelinfo* dpi, rct_window* window, rct_viewport* viewport, int16_t x_diff, int16_t y_diff)
static void viewport_shift_pixels(
rct_drawpixelinfo* dpi, rct_window* window, rct_viewport* viewport, int16_t x_diff, int16_t y_diff)
{
for (auto i = window_get_index(window); i < g_window_list.size(); i++)
{

View File

@ -77,8 +77,8 @@ static constexpr const float window_scroll_locations[][2] = {
};
// 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);
static int32_t window_draw_split(
rct_drawpixelinfo* dpi, rct_window* w, int32_t left, int32_t top, int32_t right, int32_t bottom);
static void window_draw_single(rct_drawpixelinfo* dpi, rct_window* w, int32_t left, int32_t top, int32_t right, int32_t bottom);
size_t window_get_index(const rct_window* w)
@ -1167,8 +1167,8 @@ void window_draw(rct_drawpixelinfo* dpi, rct_window* w, int32_t left, int32_t to
* Splits a drawing of a window into regions that can be seen and are not hidden
* by other opaque overlapping windows.
*/
static int32_t
window_draw_split(rct_drawpixelinfo* dpi, rct_window* w, int32_t left, int32_t top, int32_t right, int32_t bottom)
static int32_t window_draw_split(
rct_drawpixelinfo* dpi, rct_window* w, int32_t left, int32_t top, int32_t right, int32_t bottom)
{
// Divide the draws up for only the visible regions of the window recursively
for (auto i = window_get_index(w) + 1; i < g_window_list.size(); i++)

View File

@ -86,8 +86,8 @@ void LocalisationService::OpenLanguage(int32_t id, IObjectManager& objectManager
if (id != LANGUAGE_ENGLISH_UK)
{
filename = GetLanguagePath(LANGUAGE_ENGLISH_UK);
_languageFallback
= std::unique_ptr<ILanguagePack>(LanguagePackFactory::FromFile(LANGUAGE_ENGLISH_UK, filename.c_str()));
_languageFallback = std::unique_ptr<ILanguagePack>(
LanguagePackFactory::FromFile(LANGUAGE_ENGLISH_UK, filename.c_str()));
}
filename = GetLanguagePath(id);
@ -113,8 +113,8 @@ void LocalisationService::CloseLanguages()
_currentLanguage = LANGUAGE_UNDEFINED;
}
std::tuple<rct_string_id, rct_string_id, rct_string_id>
LocalisationService::GetLocalisedScenarioStrings(const std::string& scenarioFilename) const
std::tuple<rct_string_id, rct_string_id, rct_string_id> LocalisationService::GetLocalisedScenarioStrings(
const std::string& scenarioFilename) const
{
auto result0 = _languageCurrent->GetScenarioOverrideStringId(scenarioFilename.c_str(), 0);
auto result1 = _languageCurrent->GetScenarioOverrideStringId(scenarioFilename.c_str(), 1);

View File

@ -54,8 +54,8 @@ namespace OpenRCT2::Localisation
~LocalisationService();
const char* GetString(rct_string_id id) const;
std::tuple<rct_string_id, rct_string_id, rct_string_id>
GetLocalisedScenarioStrings(const std::string& scenarioFilename) const;
std::tuple<rct_string_id, rct_string_id, rct_string_id> GetLocalisedScenarioStrings(
const std::string& scenarioFilename) const;
rct_string_id GetObjectOverrideStringId(const char* identifier, uint8_t index) const;
std::string GetLanguagePath(uint32_t languageId) const;

View File

@ -33,8 +33,8 @@ uint32_t utf8_get_next(const utf8* char_ptr, const utf8** nextchar_ptr)
}
else if ((char_ptr[0] & 0xF8) == 0xF0)
{
result
= ((char_ptr[0] & 0x07) << 18) | ((char_ptr[1] & 0x3F) << 12) | ((char_ptr[1] & 0x3F) << 6) | (char_ptr[2] & 0x3F);
result = ((char_ptr[0] & 0x07) << 18) | ((char_ptr[1] & 0x3F) << 12) | ((char_ptr[1] & 0x3F) << 6)
| (char_ptr[2] & 0x3F);
numBytes = 4;
}
else

View File

@ -543,8 +543,9 @@ static bool award_is_deserved_best_custom_designed_rides(int32_t activeAwardType
}
/** At least 5 colourful rides and more than half of the rides are colourful. */
static constexpr const uint8_t dazzling_ride_colours[]
= { COLOUR_BRIGHT_PURPLE, COLOUR_BRIGHT_GREEN, COLOUR_LIGHT_ORANGE, COLOUR_BRIGHT_PINK };
static constexpr const uint8_t dazzling_ride_colours[] = {
COLOUR_BRIGHT_PURPLE, COLOUR_BRIGHT_GREEN, COLOUR_LIGHT_ORANGE, COLOUR_BRIGHT_PINK
};
static bool award_is_deserved_most_dazzling_ride_colours(int32_t activeAwardTypes)
{

View File

@ -694,8 +694,8 @@ bool Network::CheckSRAND(uint32_t tick, uint32_t srand0)
server_srand0_tick = 0;
// Check that the server and client sprite hashes match
const char* client_sprite_hash = sprite_checksum();
const bool sprites_mismatch
= server_sprite_hash[0] != '\0' && strcmp(client_sprite_hash, server_sprite_hash.c_str()) != 0;
const bool sprites_mismatch = server_sprite_hash[0] != '\0'
&& strcmp(client_sprite_hash, server_sprite_hash.c_str()) != 0;
// Check PRNG values and sprite hashes, if exist
if ((srand0 != server_srand0) || sprites_mismatch)
{
@ -2093,8 +2093,8 @@ void Network::Server_Handle_AUTH(NetworkConnection& connection, NetworkPacket& p
throw std::runtime_error("Failed to load public key.");
}
bool verified
= connection.Key.Verify(connection.Challenge.data(), connection.Challenge.size(), signature, sigsize);
bool verified = connection.Key.Verify(
connection.Challenge.data(), connection.Challenge.size(), signature, sigsize);
const std::string hash = connection.Key.PublicKeyHash();
if (verified)
{

View File

@ -103,8 +103,8 @@ void FootpathItemObject::ReadJson(IReadObjectContext* context, const json_t* roo
{
auto properties = json_object_get(root, "properties");
_legacyType.path_bit.draw_type = ParseDrawType(ObjectJsonHelpers::GetString(properties, "renderAs"));
_legacyType.path_bit.tool_id
= ObjectJsonHelpers::ParseCursor(ObjectJsonHelpers::GetString(properties, "cursor"), CURSOR_LAMPPOST_DOWN);
_legacyType.path_bit.tool_id = ObjectJsonHelpers::ParseCursor(
ObjectJsonHelpers::GetString(properties, "cursor"), CURSOR_LAMPPOST_DOWN);
_legacyType.path_bit.price = json_integer_value(json_object_get(properties, "price"));
SetPrimarySceneryGroup(ObjectJsonHelpers::GetString(json_object_get(properties, "sceneryGroup")));

View File

@ -125,8 +125,8 @@ void LargeSceneryObject::ReadJson(IReadObjectContext* context, const json_t* roo
{
auto properties = json_object_get(root, "properties");
_legacyType.large_scenery.tool_id
= ObjectJsonHelpers::ParseCursor(ObjectJsonHelpers::GetString(properties, "cursor"), CURSOR_STATUE_DOWN);
_legacyType.large_scenery.tool_id = ObjectJsonHelpers::ParseCursor(
ObjectJsonHelpers::GetString(properties, "cursor"), CURSOR_STATUE_DOWN);
_legacyType.large_scenery.price = json_integer_value(json_object_get(properties, "price"));
_legacyType.large_scenery.removal_price = json_integer_value(json_object_get(properties, "removalPrice"));

View File

@ -152,8 +152,8 @@ public:
namespace ObjectFactory
{
static Object*
CreateObjectFromJson(IObjectRepository& objectRepository, const json_t* jRoot, const IFileDataRetriever* fileRetriever);
static Object* CreateObjectFromJson(
IObjectRepository& objectRepository, const json_t* jRoot, const IFileDataRetriever* fileRetriever);
static void ReadObjectLegacy(Object* object, IReadObjectContext* context, IStream* stream)
{
@ -357,8 +357,8 @@ namespace ObjectFactory
return result;
}
Object*
CreateObjectFromJson(IObjectRepository& objectRepository, const json_t* jRoot, const IFileDataRetriever* fileRetriever)
Object* CreateObjectFromJson(
IObjectRepository& objectRepository, const json_t* jRoot, const IFileDataRetriever* fileRetriever)
{
log_verbose("CreateObjectFromJson(...)");

View File

@ -215,8 +215,8 @@ namespace ObjectJsonHelpers
return objectPath;
}
static std::vector<rct_g1_element>
LoadObjectImages(IReadObjectContext* context, const std::string& name, const std::vector<int32_t>& range)
static std::vector<rct_g1_element> LoadObjectImages(
IReadObjectContext* context, const std::string& name, const std::vector<int32_t>& range)
{
std::vector<rct_g1_element> result;
auto objectPath = FindLegacyObject(name);

View File

@ -443,8 +443,8 @@ private:
}
}
static void
SaveObject(const utf8* path, const rct_object_entry* entry, const void* data, size_t dataSize, bool fixChecksum = true)
static void SaveObject(
const utf8* path, const rct_object_entry* entry, const void* data, size_t dataSize, bool fixChecksum = true)
{
if (fixChecksum)
{

View File

@ -171,8 +171,8 @@ void RideObject::Load()
// again. This has been changed to use the calculation results directly - num_vertical_frames and
// num_horizontal_frames are no longer set on the vehicle entry.
// 0x6DE946
vehicleEntry->base_num_frames
= CalculateNumVerticalFrames(vehicleEntry) * CalculateNumHorizontalFrames(vehicleEntry);
vehicleEntry->base_num_frames = CalculateNumVerticalFrames(vehicleEntry)
* CalculateNumHorizontalFrames(vehicleEntry);
vehicleEntry->base_image_id = cur_vehicle_images_offset;
int32_t image_index = vehicleEntry->base_image_id;

View File

@ -234,8 +234,8 @@ void SmallSceneryObject::ReadJson(IReadObjectContext* context, const json_t* roo
auto properties = json_object_get(root, "properties");
_legacyType.small_scenery.height = json_integer_value(json_object_get(properties, "height"));
_legacyType.small_scenery.tool_id
= ObjectJsonHelpers::ParseCursor(ObjectJsonHelpers::GetString(properties, "cursor"), CURSOR_STATUE_DOWN);
_legacyType.small_scenery.tool_id = ObjectJsonHelpers::ParseCursor(
ObjectJsonHelpers::GetString(properties, "cursor"), CURSOR_STATUE_DOWN);
_legacyType.small_scenery.price = json_integer_value(json_object_get(properties, "price"));
_legacyType.small_scenery.removal_price = json_integer_value(json_object_get(properties, "removalPrice"));
_legacyType.small_scenery.animation_delay = json_integer_value(json_object_get(properties, "animationDelay"));

View File

@ -88,8 +88,8 @@ void WallObject::ReadJson(IReadObjectContext* context, const json_t* root)
{
auto properties = json_object_get(root, "properties");
_legacyType.wall.tool_id
= ObjectJsonHelpers::ParseCursor(ObjectJsonHelpers::GetString(properties, "cursor"), CURSOR_FENCE_DOWN);
_legacyType.wall.tool_id = ObjectJsonHelpers::ParseCursor(
ObjectJsonHelpers::GetString(properties, "cursor"), CURSOR_FENCE_DOWN);
_legacyType.wall.height = json_integer_value(json_object_get(properties, "height"));
_legacyType.wall.price = json_integer_value(json_object_get(properties, "price"));

View File

@ -50,8 +50,8 @@ bool gPaintBlockedTiles;
static void paint_session_init(paint_session* session, rct_drawpixelinfo* dpi);
static void paint_attached_ps(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t viewFlags);
static void
paint_ps_image_with_bounding_boxes(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int16_t x, int16_t y);
static void paint_ps_image_with_bounding_boxes(
rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int16_t x, int16_t y);
static void paint_ps_image(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t imageId, int16_t x, int16_t y);
static uint32_t paint_ps_colourify_image(uint32_t imageId, uint8_t spriteType, uint32_t viewFlags);
@ -474,8 +474,8 @@ paint_struct paint_session_arrange(paint_session* session)
}
} while (++quadrantIndex <= session->QuadrantFrontIndex);
paint_struct* ps_cache
= paint_arrange_structs_helper(&psHead, session->QuadrantBackIndex & 0xFFFF, PAINT_QUADRANT_FLAG_NEXT, rotation);
paint_struct* ps_cache = paint_arrange_structs_helper(
&psHead, session->QuadrantBackIndex & 0xFFFF, PAINT_QUADRANT_FLAG_NEXT, rotation);
quadrantIndex = session->QuadrantBackIndex;
while (++quadrantIndex < session->QuadrantFrontIndex)

View File

@ -425,8 +425,8 @@ void virtual_floor_paint(paint_session* session)
if (!weAreOccupied && !weAreLit)
{
int32_t imageColourFlats
= SPR_G2_SURFACE_GLASSY_RECOLOURABLE | IMAGE_TYPE_REMAP | IMAGE_TYPE_TRANSPARENT | PALETTE_WATER << 19;
int32_t imageColourFlats = SPR_G2_SURFACE_GLASSY_RECOLOURABLE | IMAGE_TYPE_REMAP | IMAGE_TYPE_TRANSPARENT
| PALETTE_WATER << 19;
sub_98197C(session, imageColourFlats, 0, 0, 30, 30, 0, _virtualFloorHeight, 2, 2, _virtualFloorHeight - 3);
}
}

View File

@ -81,8 +81,8 @@ void peep_paint(paint_session* session, const rct_peep* peep, int32_t imageDirec
// In the following 4 calls to sub_98197C/sub_98199C, we add 5 (instead of 3) to the
// bound_box_offset_z to make sure peeps are drawn on top of railways
uint32_t baseImageId = (imageDirection >> 3) + sprite.sprite_animation[spriteType].base_image + imageOffset * 4;
uint32_t imageId
= baseImageId | peep->tshirt_colour << 19 | peep->trousers_colour << 24 | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS;
uint32_t imageId = baseImageId | peep->tshirt_colour << 19 | peep->trousers_colour << 24 | IMAGE_TYPE_REMAP
| IMAGE_TYPE_REMAP_2_PLUS;
sub_98197C(session, imageId, 0, 0, 1, 1, 11, peep->z, 0, 0, peep->z + 5);
if (baseImageId >= 10717 && baseImageId < 10749)

View File

@ -27,8 +27,8 @@ static uint32_t _unk9E32BC;
*
* rct2: 0x0066508C, 0x00665540
*/
static void
ride_entrance_exit_paint(paint_session* session, uint8_t direction, int32_t height, const rct_tile_element* tile_element)
static void ride_entrance_exit_paint(
paint_session* session, uint8_t direction, int32_t height, const rct_tile_element* tile_element)
{
uint8_t is_exit = tile_element->properties.entrance.type == ENTRANCE_TYPE_RIDE_EXIT;

View File

@ -466,8 +466,9 @@ static void sub_6A4101(
direction += session->CurrentRotation;
direction &= 3;
LocationXYZ16 boundBoxOffsets
= { BannerBoundBoxes[direction][0].x, BannerBoundBoxes[direction][0].y, static_cast<int16_t>(height + 2) };
LocationXYZ16 boundBoxOffsets = { BannerBoundBoxes[direction][0].x,
BannerBoundBoxes[direction][0].y,
static_cast<int16_t>(height + 2) };
uint32_t imageId = (direction << 1) + base_image_id + 101;
@ -769,8 +770,8 @@ static void sub_6A3F61(
}
// Draw additional path bits (bins, benches, lamps, queue screens)
rct_scenery_entry* sceneryEntry
= get_footpath_item_entry(footpath_element_get_path_scenery_index(tile_element));
rct_scenery_entry* sceneryEntry = get_footpath_item_entry(
footpath_element_get_path_scenery_index(tile_element));
if ((gCurrentViewportFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)
&& !(tile_element->flags & TILE_ELEMENT_FLAG_BROKEN)

View File

@ -175,8 +175,8 @@ void scenery_paint(paint_session* session, uint8_t direction, int32_t height, co
{
// Draw translucent overlay:
// TODO: Name palette entries
int32_t image_id
= (baseImageid & 0x7FFFF) + (GlassPaletteIds[scenery_small_get_primary_colour(tileElement)] << 19) + 0x40000004;
int32_t image_id = (baseImageid & 0x7FFFF) + (GlassPaletteIds[scenery_small_get_primary_colour(tileElement)] << 19)
+ 0x40000004;
sub_98199C(
session,
image_id,

View File

@ -1484,8 +1484,8 @@ void surface_paint(paint_session* session, uint8_t direction, uint16_t height, c
image_offset = byte_97B740[surfaceShape & 0xF];
}
const int32_t image_id
= (SPR_WATER_MASK + image_offset) | IMAGE_TYPE_REMAP | IMAGE_TYPE_TRANSPARENT | PALETTE_WATER << 19;
const int32_t image_id = (SPR_WATER_MASK + image_offset) | IMAGE_TYPE_REMAP | IMAGE_TYPE_TRANSPARENT
| PALETTE_WATER << 19;
sub_98196C(session, image_id, 0, 0, 32, 32, -1, waterHeight);
paint_attach_to_previous_ps(session, SPR_WATER_OVERLAY + image_offset, 0, 0);

View File

@ -38,8 +38,8 @@ uint16_t testPaintVerticalTunnelHeight;
static void blank_tiles_paint(paint_session* session, int32_t x, int32_t y);
static void sub_68B3FB(paint_session* session, int32_t x, int32_t y);
const int32_t SEGMENTS_ALL
= SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4;
const int32_t SEGMENTS_ALL = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC
| SEGMENT_D0 | SEGMENT_D4;
/**
*
@ -435,8 +435,8 @@ void paint_util_force_set_general_support_height(paint_session* session, int16_t
session->Support.slope = slope;
}
const uint16_t segment_offsets[9]
= { SEGMENT_B4, SEGMENT_B8, SEGMENT_BC, SEGMENT_C0, SEGMENT_C4, SEGMENT_C8, SEGMENT_CC, SEGMENT_D0, SEGMENT_D4 };
const uint16_t segment_offsets[9] = { SEGMENT_B4, SEGMENT_B8, SEGMENT_BC, SEGMENT_C0, SEGMENT_C4,
SEGMENT_C8, SEGMENT_CC, SEGMENT_D0, SEGMENT_D4 };
void paint_util_set_segment_support_height(paint_session* session, int32_t segments, uint16_t height, uint8_t slope)
{

View File

@ -3480,8 +3480,8 @@ static void peep_update_ride_leave_entrance_spiral_slide(rct_peep* peep, Ride* r
peep->sub_state = PEEP_RIDE_APPROACH_SPIRAL_SLIDE;
}
static uint8_t
peep_get_waypointed_seat_location(rct_peep* peep, Ride* ride, rct_ride_entry_vehicle* vehicle_type, uint8_t track_direction)
static uint8_t peep_get_waypointed_seat_location(
rct_peep* peep, Ride* ride, rct_ride_entry_vehicle* vehicle_type, uint8_t track_direction)
{
// The seatlocation can be split into segments around the ride base
// to decide the segment first split off the segmentable seat location

View File

@ -1761,8 +1761,8 @@ static int32_t guest_path_find_park_entrance(rct_peep* peep, [[maybe_unused]] rc
if (gParkEntrances[entranceNum].x == LOCATION_NULL)
continue;
uint16_t dist
= abs(gParkEntrances[entranceNum].x - peep->next_x) + abs(gParkEntrances[entranceNum].y - peep->next_y);
uint16_t dist = abs(gParkEntrances[entranceNum].x - peep->next_x)
+ abs(gParkEntrances[entranceNum].y - peep->next_y);
if (dist >= nearestDist)
continue;

View File

@ -1022,8 +1022,8 @@ void rct_peep::UpdateFalling()
// If a path check if we are on it
if (tile_element->GetType() == TILE_ELEMENT_TYPE_PATH)
{
int32_t height
= map_height_from_slope(x, y, tile_element->properties.surface.slope) + tile_element->base_height * 8;
int32_t height = map_height_from_slope(x, y, tile_element->properties.surface.slope)
+ tile_element->base_height * 8;
if (height < z - 1 || height > z + 4)
continue;
@ -2427,8 +2427,8 @@ static void peep_return_to_centre_of_tile(rct_peep* peep)
*
* rct2: 0x00693f2C
*/
static void
peep_interact_with_entrance(rct_peep* peep, int16_t x, int16_t y, rct_tile_element* tile_element, uint8_t& pathing_result)
static void peep_interact_with_entrance(
rct_peep* peep, int16_t x, int16_t y, rct_tile_element* tile_element, uint8_t& pathing_result)
{
uint8_t entranceType = tile_element->properties.entrance.type;
uint8_t rideIndex = tile_element->properties.entrance.ride_index;

View File

@ -357,13 +357,13 @@ enum PEEP_FLAGS : uint32_t
PEEP_FLAGS_CONTAGIOUS = (1 << 22), // Makes any peeps in surrounding tiles sick
PEEP_FLAGS_JOY = (1 << 23), // Makes the peep jump in joy
PEEP_FLAGS_ANGRY = (1 << 24),
PEEP_FLAGS_ICE_CREAM = (1 << 25), // Gives passing peeps ice cream and they wave back
PEEP_FLAGS_NICE_RIDE_DEPRECATED
= (1 << 26), // Used to make the peep think "Nice ride! But not as good as the Phoenix..." on exiting a ride
PEEP_FLAGS_INTAMIN_DEPRECATED
= (1 << 27), // Used to make the peep think "I'm so excited - It's an Intamin ride!" while riding on a Intamin ride.
PEEP_FLAGS_HERE_WE_ARE = (1 << 28), // Makes the peep think "...and here we are on X!" while riding a ride
PEEP_FLAGS_TWITCH = (1u << 31), // Added for twitch integration
PEEP_FLAGS_ICE_CREAM = (1 << 25), // Gives passing peeps ice cream and they wave back
PEEP_FLAGS_NICE_RIDE_DEPRECATED = (1 << 26), // Used to make the peep think "Nice ride! But not as good as the Phoenix..."
// on exiting a ride
PEEP_FLAGS_INTAMIN_DEPRECATED = (1 << 27), // Used to make the peep think "I'm so excited - It's an Intamin ride!" while
// riding on a Intamin ride.
PEEP_FLAGS_HERE_WE_ARE = (1 << 28), // Makes the peep think "...and here we are on X!" while riding a ride
PEEP_FLAGS_TWITCH = (1u << 31), // Added for twitch integration
};
enum PEEP_NEXT_FLAGS

View File

@ -921,8 +921,8 @@ static uint8_t staff_handyman_direction_to_nearest_litter(rct_peep* peep)
return 0xFF;
}
LocationXY16 litterTile
= { static_cast<int16_t>(nearestLitter->x & 0xFFE0), static_cast<int16_t>(nearestLitter->y & 0xFFE0) };
LocationXY16 litterTile = { static_cast<int16_t>(nearestLitter->x & 0xFFE0),
static_cast<int16_t>(nearestLitter->y & 0xFFE0) };
if (!staff_is_location_in_patrol(peep, litterTile.x, litterTile.y))
{
@ -1324,8 +1324,8 @@ static uint8_t staff_mechanic_direction_path(rct_peep* peep, uint8_t validDirect
pathfind_logging_enable(peep);
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
int32_t pathfindDirection
= peep_pathfind_choose_direction({ peep->next_x / 32, peep->next_y / 32, peep->next_z }, peep);
int32_t pathfindDirection = peep_pathfind_choose_direction(
{ peep->next_x / 32, peep->next_y / 32, peep->next_z }, peep);
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
pathfind_logging_disable();
@ -1637,8 +1637,8 @@ uint32_t staff_get_available_entertainer_costumes()
entertainerCostumes >>= 4;
// Fix #6593: force enable the default costumes, which normally get enabled through the default scenery groups.
entertainerCostumes
|= (1 << ENTERTAINER_COSTUME_PANDA) | (1 << ENTERTAINER_COSTUME_TIGER) | (1 << ENTERTAINER_COSTUME_ELEPHANT);
entertainerCostumes |= (1 << ENTERTAINER_COSTUME_PANDA) | (1 << ENTERTAINER_COSTUME_TIGER)
| (1 << ENTERTAINER_COSTUME_ELEPHANT);
return entertainerCostumes;
}

View File

@ -49,9 +49,9 @@ static bool OnCrash(
{
if (!succeeded)
{
constexpr const char* DumpFailedMessage
= "Failed to create the dump. Please file an issue with OpenRCT2 on GitHub and provide latest save, and provide "
"information about what you did before the crash occurred.";
constexpr const char* DumpFailedMessage = "Failed to create the dump. Please file an issue with OpenRCT2 on GitHub and "
"provide latest save, and provide "
"information about what you did before the crash occurred.";
printf("%s\n", DumpFailedMessage);
if (!gOpenRCT2SilentBreakpad)
{
@ -107,9 +107,9 @@ static bool OnCrash(
return succeeded;
}
constexpr const wchar_t* MessageFormat
= L"A crash has occurred and a dump was created at\n%s.\n\nPlease file an issue with OpenRCT2 on GitHub, and provide "
L"the dump and saved game there.\n\nVersion: %s\nCommit: %s";
constexpr const wchar_t* MessageFormat = L"A crash has occurred and a dump was created at\n%s.\n\nPlease file an issue "
L"with OpenRCT2 on GitHub, and provide "
L"the dump and saved game there.\n\nVersion: %s\nCommit: %s";
wchar_t message[MAX_PATH * 2];
swprintf_s(message, MessageFormat, dumpFilePath, WSZ(OPENRCT2_VERSION), _wszCommitSha1Short);

View File

@ -50,8 +50,8 @@ utf8* macos_str_decomp_to_precomp(utf8* input)
bool platform_get_font_path(TTFFontDescriptor* font, utf8* buffer, size_t size)
{
@autoreleasepool {
CTFontDescriptorRef fontRef
= CTFontDescriptorCreateWithNameAndSize((CFStringRef)[NSString stringWithUTF8String:font->font_name], 0.0);
CTFontDescriptorRef fontRef = CTFontDescriptorCreateWithNameAndSize(
(CFStringRef)[NSString stringWithUTF8String:font->font_name], 0.0);
CFURLRef url = (CFURLRef)CTFontDescriptorCopyAttribute(fontRef, kCTFontURLAttribute);
if (url)
{
@ -102,8 +102,8 @@ bool platform_has_matching_language(NSString* preferredLocale, uint16_t* languag
NSString* languageCode = [[preferredLocale componentsSeparatedByString:@"-"] firstObject];
for (int i = 1; i < LANGUAGE_COUNT; i++)
{
NSString* optionLanguageCode =
[[[NSString stringWithUTF8String:LanguagesDescriptors[i].locale] componentsSeparatedByString:@"-"] firstObject];
NSString* optionLanguageCode = [
[[NSString stringWithUTF8String:LanguagesDescriptors[i].locale] componentsSeparatedByString:@"-"] firstObject];
if ([languageCode isEqualToString:optionLanguageCode])
{
*languageIdentifier = i;
@ -168,7 +168,8 @@ bool platform_get_steam_path(utf8* outPath, size_t outSize)
if (homeDir != NULL)
{
safe_strcpy(steamPath, homeDir, sizeof(steamPath));
safe_strcat_path(steamPath, "Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/steamapps", sizeof(steamPath));
safe_strcat_path(
steamPath, "Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/MacOS/steamapps", sizeof(steamPath));
if (platform_directory_exists(steamPath))
{
safe_strcpy(outPath, steamPath, outSize);

View File

@ -167,8 +167,8 @@ public:
return result;
}
ParkLoadResult
LoadFromStream(IStream* stream, bool isScenario, [[maybe_unused]] bool skipObjectCheck, const utf8* path) override
ParkLoadResult LoadFromStream(
IStream* stream, bool isScenario, [[maybe_unused]] bool skipObjectCheck, const utf8* path) override
{
_s4 = *ReadAndDecodeS4(stream, isScenario);
_s4Path = path;
@ -999,8 +999,8 @@ private:
for (int i = 0; i < RCT1_MAX_TRAINS_PER_RIDE; i++)
{
// RCT1 had no third colour
RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor
= RCT1::GetColourSchemeCopyDescriptor(src->vehicle_type);
RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor(
src->vehicle_type);
if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1)
{
dst->vehicle_colours[i].body_colour = RCT1::GetColour(src->vehicle_colours[i].body);
@ -1235,8 +1235,8 @@ private:
{
rct1_ride* srcRide = &_s4.rides[src->ride];
uint8_t vehicleTypeIndex = srcRide->vehicle_type;
RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor
= RCT1::GetColourSchemeCopyDescriptor(vehicleTypeIndex);
RCT1::RCT1VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor(
vehicleTypeIndex);
// RCT1 had no third colour
if (colourSchemeCopyDescriptor.colour1 == COPY_COLOUR_1)
@ -1758,8 +1758,9 @@ private:
{
for (size_t i = 0; i < RCT12_MAX_PEEP_SPAWNS; i++)
{
gPeepSpawns[i]
= { _s4.peep_spawn[i].x, _s4.peep_spawn[i].y, _s4.peep_spawn[i].z * 16, _s4.peep_spawn[i].direction };
gPeepSpawns[i] = {
_s4.peep_spawn[i].x, _s4.peep_spawn[i].y, _s4.peep_spawn[i].z * 16, _s4.peep_spawn[i].direction
};
}
for (size_t i = RCT12_MAX_PEEP_SPAWNS; i < MAX_PEEP_SPAWNS; i++)

View File

@ -137,8 +137,8 @@ void S6Exporter::Save(IStream* stream, bool isScenario)
// Read all written bytes back into a single buffer
stream->SetPosition(0);
auto data
= std::unique_ptr<uint8_t, std::function<void(uint8_t*)>>(stream->ReadArray<uint8_t>(fileSize), Memory::Free<uint8_t>);
auto data = std::unique_ptr<uint8_t, std::function<void(uint8_t*)>>(
stream->ReadArray<uint8_t>(fileSize), Memory::Free<uint8_t>);
uint32_t checksum = sawyercoding_calculate_checksum(data.get(), fileSize);
// Write the checksum on the end

View File

@ -805,8 +805,9 @@ public:
for (size_t i = 0; i < RCT12_MAX_PEEP_SPAWNS; i++)
{
gPeepSpawns[i]
= { _s6.peep_spawns[i].x, _s6.peep_spawns[i].y, _s6.peep_spawns[i].z * 16, _s6.peep_spawns[i].direction };
gPeepSpawns[i] = {
_s6.peep_spawns[i].x, _s6.peep_spawns[i].y, _s6.peep_spawns[i].z * 16, _s6.peep_spawns[i].direction
};
}
for (size_t i = RCT12_MAX_PEEP_SPAWNS; i < MAX_PEEP_SPAWNS; i++)
@ -834,8 +835,8 @@ public:
}
};
std::unique_ptr<IParkImporter>
ParkImporter::CreateS6(std::shared_ptr<IObjectRepository> objectRepository, std::shared_ptr<IObjectManager> objectManager)
std::unique_ptr<IParkImporter> ParkImporter::CreateS6(
std::shared_ptr<IObjectRepository> objectRepository, std::shared_ptr<IObjectManager> objectManager)
{
return std::make_unique<S6Importer>(objectRepository, objectManager);
}

View File

@ -246,8 +246,8 @@ static bool sub_6DF01A_loop(rct_vehicle* vehicle)
{
_vehicleVAngleEndF64E36 = TrackDefinitions[trackType].vangle_end;
_vehicleBankEndF64E37 = TrackDefinitions[trackType].bank_end;
rct_tile_element* trackElement
= map_get_track_element_at_of_type_seq(vehicle->track_x, vehicle->track_y, vehicle->track_z / 8, trackType, 0);
rct_tile_element* trackElement = map_get_track_element_at_of_type_seq(
vehicle->track_x, vehicle->track_y, vehicle->track_z / 8, trackType, 0);
CoordsXYE input;
CoordsXYE output;
@ -321,8 +321,8 @@ static bool sub_6DF21B_loop(rct_vehicle* vehicle)
_vehicleVAngleEndF64E36 = TrackDefinitions[trackType].vangle_start;
_vehicleBankEndF64E37 = TrackDefinitions[trackType].bank_start;
rct_tile_element* trackElement
= map_get_track_element_at_of_type_seq(vehicle->track_x, vehicle->track_y, vehicle->track_z / 8, trackType, 0);
rct_tile_element* trackElement = map_get_track_element_at_of_type_seq(
vehicle->track_x, vehicle->track_y, vehicle->track_z / 8, trackType, 0);
CoordsXYE input;

Some files were not shown because too many files have changed in this diff Show More