mirror of https://github.com/OpenRCT2/OpenRCT2.git
* Issue #11565, created overload for gfx_draw_string_left_clipped Co-authored-by: Tushar <tushar.97@hotmail.com> Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
parent
4c88630070
commit
2cf95adc4b
|
@ -413,7 +413,7 @@ static void widget_text(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetindex w
|
|||
stringId = STR_STRING;
|
||||
formatArgs = &widget->string;
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, stringId, formatArgs, colour, l + 1, t, r - l);
|
||||
gfx_draw_string_left_clipped(dpi, stringId, formatArgs, colour, { l + 1, t }, r - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -668,7 +668,7 @@ void CustomListView::PaintCell(
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(text);
|
||||
gfx_draw_string_left_clipped(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, pos.x, pos.y, size.width);
|
||||
gfx_draw_string_left_clipped(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, pos, size.width);
|
||||
}
|
||||
|
||||
std::optional<RowColumn> CustomListView::GetItemIndexAt(const ScreenCoordsXY& pos)
|
||||
|
|
|
@ -395,10 +395,10 @@ static void window_dropdown_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
colour = NOT_TRANSLUCENT(w->colours[0]) | COLOUR_FLAG_INSET;
|
||||
|
||||
// Draw item string
|
||||
ScreenCoordsXY screenCoords = { w->windowPos.x + 2 + (cell_x * _dropdown_item_width),
|
||||
w->windowPos.y + 2 + (cell_y * _dropdown_item_height) };
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, item, static_cast<void*>(&gDropdownItemsArgs[i]), colour,
|
||||
w->windowPos.x + 2 + (cell_x * _dropdown_item_width), w->windowPos.y + 2 + (cell_y * _dropdown_item_height),
|
||||
w->width - 5);
|
||||
dpi, item, static_cast<void*>(&gDropdownItemsArgs[i]), colour, screenCoords, w->width - 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1028,18 +1028,18 @@ static void window_editor_object_selection_paint(rct_window* w, rct_drawpixelinf
|
|||
{
|
||||
stringId = _listSortType == RIDE_SORT_TYPE ? static_cast<rct_string_id>(_listSortDescending ? STR_DOWN : STR_UP)
|
||||
: STR_NONE;
|
||||
ScreenCoordsXY screenCoords = { w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 };
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_OBJECTS_SORT_TYPE, &stringId, w->colours[1], w->windowPos.x + widget->left + 1,
|
||||
w->windowPos.y + widget->top + 1, widget->right - widget->left);
|
||||
dpi, STR_OBJECTS_SORT_TYPE, &stringId, w->colours[1], screenCoords, widget->right - widget->left);
|
||||
}
|
||||
widget = &w->widgets[WIDX_LIST_SORT_RIDE];
|
||||
if (widget->type != WWT_EMPTY)
|
||||
{
|
||||
stringId = _listSortType == RIDE_SORT_RIDE ? static_cast<rct_string_id>(_listSortDescending ? STR_DOWN : STR_UP)
|
||||
: STR_NONE;
|
||||
ScreenCoordsXY screenCoord = { w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 };
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_OBJECTS_SORT_RIDE, &stringId, w->colours[1], w->windowPos.x + widget->left + 1,
|
||||
w->windowPos.y + widget->top + 1, widget->right - widget->left);
|
||||
dpi, STR_OBJECTS_SORT_RIDE, &stringId, w->colours[1], screenCoord, widget->right - widget->left);
|
||||
}
|
||||
|
||||
if (w->selected_list_item == -1 || _loadedObject == nullptr)
|
||||
|
@ -1173,8 +1173,7 @@ static void window_editor_object_selection_scrollpaint(rct_window* w, rct_drawpi
|
|||
// Draw ride type
|
||||
rct_string_id rideTypeStringId = get_ride_type_string_id(listItem.repositoryItem);
|
||||
safe_strcpy(buffer, language_get_string(rideTypeStringId), 256 - (buffer - bufferWithColour));
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, &bufferWithColour, colour, screenCoords.x, screenCoords.y, width_limit - 15);
|
||||
gfx_draw_string_left_clipped(dpi, STR_STRING, &bufferWithColour, colour, screenCoords, width_limit - 15);
|
||||
screenCoords.x = w->widgets[WIDX_LIST_SORT_RIDE].left - w->widgets[WIDX_LIST].left;
|
||||
}
|
||||
|
||||
|
@ -1187,8 +1186,7 @@ static void window_editor_object_selection_scrollpaint(rct_window* w, rct_drawpi
|
|||
|
||||
*buffer = 0;
|
||||
}
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, &bufferWithColour, colour, screenCoords.x, screenCoords.y, width_limit);
|
||||
gfx_draw_string_left_clipped(dpi, STR_STRING, &bufferWithColour, colour, screenCoords, width_limit);
|
||||
}
|
||||
screenCoords.y += 12;
|
||||
}
|
||||
|
|
|
@ -961,7 +961,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(parkName);
|
||||
gfx_draw_string_left_clipped(dpi, STR_WINDOW_PARK_NAME, gCommonFormatArgs, COLOUR_BLACK, x, y, width);
|
||||
gfx_draw_string_left_clipped(dpi, STR_WINDOW_PARK_NAME, gCommonFormatArgs, COLOUR_BLACK, { x, y }, width);
|
||||
}
|
||||
|
||||
// Scenario name
|
||||
|
@ -972,7 +972,7 @@ static void window_editor_objective_options_main_paint(rct_window* w, rct_drawpi
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<const char*>(gS6Info.name);
|
||||
gfx_draw_string_left_clipped(dpi, STR_WINDOW_SCENARIO_NAME, gCommonFormatArgs, COLOUR_BLACK, x, y, width);
|
||||
gfx_draw_string_left_clipped(dpi, STR_WINDOW_SCENARIO_NAME, gCommonFormatArgs, COLOUR_BLACK, { x, y }, width);
|
||||
|
||||
// Scenario details label
|
||||
x = w->windowPos.x + 8;
|
||||
|
|
|
@ -1222,7 +1222,7 @@ static void window_finances_marketing_paint(rct_window* w, rct_drawpixelinfo* dp
|
|||
}
|
||||
|
||||
// Advertisement
|
||||
gfx_draw_string_left_clipped(dpi, MarketingCampaignNames[i][1], gCommonFormatArgs, COLOUR_BLACK, x + 4, y, 296);
|
||||
gfx_draw_string_left_clipped(dpi, MarketingCampaignNames[i][1], gCommonFormatArgs, COLOUR_BLACK, { x + 4, y }, 296);
|
||||
|
||||
// Duration
|
||||
uint16_t weeksRemaining = campaign->WeeksLeft;
|
||||
|
|
|
@ -1706,7 +1706,8 @@ void window_guest_rides_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
ride->FormatNameTo(gCommonFormatArgs);
|
||||
}
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, STR_FAVOURITE_RIDE, gCommonFormatArgs, COLOUR_BLACK, x, y, w->width - 14);
|
||||
ScreenCoordsXY coords = { x, y };
|
||||
gfx_draw_string_left_clipped(dpi, STR_FAVOURITE_RIDE, gCommonFormatArgs, COLOUR_BLACK, coords, w->width - 14);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -718,7 +718,7 @@ static void window_guest_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
{
|
||||
format = STR_ALL_GUESTS_SUMMARISED;
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, format, _window_guest_list_filter_arguments.args, COLOUR_BLACK, x, y, 310);
|
||||
gfx_draw_string_left_clipped(dpi, format, _window_guest_list_filter_arguments.args, COLOUR_BLACK, { x, y }, 310);
|
||||
|
||||
// Number of guests (list items)
|
||||
if (_window_guest_list_selected_tab == PAGE_INDIVIDUAL)
|
||||
|
@ -769,7 +769,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
// Guest name
|
||||
auto peep = GET_PEEP(spriteIndex);
|
||||
peep->FormatNameTo(gCommonFormatArgs);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y, 113);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y }, 113);
|
||||
|
||||
switch (_window_guest_list_selected_view)
|
||||
{
|
||||
|
@ -783,7 +783,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
|
||||
// Action
|
||||
peep->FormatActionTo(gCommonFormatArgs);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 133, y, 314);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 133, y }, 314);
|
||||
break;
|
||||
case VIEW_THOUGHTS:
|
||||
// For each thought
|
||||
|
@ -798,7 +798,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
break;
|
||||
|
||||
peep_thought_set_format_args(&peep->thoughts[j]);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 118, y, 329);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 118, y }, 329);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -843,7 +843,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
std::memcpy(
|
||||
gCommonFormatArgs, _window_guest_list_groups_arguments[i].args,
|
||||
std::min(sizeof(gCommonFormatArgs), sizeof(_window_guest_list_groups_arguments[i].args)));
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y, 414);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y }, 414);
|
||||
|
||||
// Draw guest count
|
||||
set_format_arg(0, rct_string_id, STR_GUESTS_COUNT_COMMA_SEP);
|
||||
|
|
|
@ -322,7 +322,7 @@ static void window_install_track_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
// Ride length
|
||||
set_format_arg(0, rct_string_id, STR_RIDE_LENGTH_ENTRY);
|
||||
set_format_arg(2, uint16_t, td6->ride_length);
|
||||
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, x, y, 214);
|
||||
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, { x, y }, 214);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
|
|
@ -718,7 +718,7 @@ static void window_loadsave_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
// Draw path text
|
||||
set_format_arg(0, uintptr_t, Platform::StrDecompToPrecomp(buffer));
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, w->windowPos.x + 4, w->windowPos.y + 20, w->width - 8);
|
||||
dpi, STR_STRING, gCommonFormatArgs, COLOUR_BLACK, { w->windowPos.x + 4, w->windowPos.y + 20 }, w->width - 8);
|
||||
|
||||
// Name button text
|
||||
rct_string_id id = STR_NONE;
|
||||
|
@ -780,7 +780,7 @@ static void window_loadsave_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
|||
set_format_arg(0, rct_string_id, STR_STRING);
|
||||
set_format_arg(2, char*, _listItems[i].name.c_str());
|
||||
int32_t max_file_width = w->widgets[WIDX_SORT_NAME].right - w->widgets[WIDX_SORT_NAME].left - 10;
|
||||
gfx_draw_string_left_clipped(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, 10, y, max_file_width);
|
||||
gfx_draw_string_left_clipped(dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, { 10, y }, max_file_width);
|
||||
|
||||
// Print formatted modified date, if this is a file
|
||||
if (_listItems[i].type == TYPE_FILE)
|
||||
|
@ -792,7 +792,7 @@ static void window_loadsave_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
|||
|
||||
set_format_arg(2, char*, _listItems[i].time_formatted.c_str());
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, dateAnchor + DATE_TIME_GAP, y, maxTimeWidth);
|
||||
dpi, stringId, gCommonFormatArgs, COLOUR_BLACK, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -700,7 +700,7 @@ static void window_multiplayer_players_scrollpaint(rct_window* w, rct_drawpixeli
|
|||
{
|
||||
set_format_arg(0, rct_string_id, network_get_action_name_string_id(action));
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, 256, screenCoords.y, 100);
|
||||
gfx_draw_string_left_clipped(dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, { 256, screenCoords.y }, 100);
|
||||
|
||||
// Draw ping
|
||||
lineCh = buffer;
|
||||
|
|
|
@ -981,7 +981,7 @@ static void window_new_ride_paint_ride_information(
|
|||
if (availabilityString[0] != 0)
|
||||
{
|
||||
const char* drawString = availabilityString;
|
||||
gfx_draw_string_left_clipped(dpi, STR_AVAILABLE_VEHICLES, &drawString, COLOUR_BLACK, x, y + 39, WW - 2);
|
||||
gfx_draw_string_left_clipped(dpi, STR_AVAILABLE_VEHICLES, &drawString, COLOUR_BLACK, { x, y + 39 }, WW - 2);
|
||||
}
|
||||
|
||||
if (item.Type != _lastTrackDesignCountRideType.Type || item.EntryIndex != _lastTrackDesignCountRideType.EntryIndex)
|
||||
|
|
|
@ -566,7 +566,7 @@ static void window_object_load_error_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
set_format_arg(0, rct_string_id, STR_OBJECT_ERROR_WINDOW_FILE);
|
||||
set_format_arg(2, utf8*, file_path.c_str());
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, w->windowPos.x + 5, w->windowPos.y + 43, WW - 5);
|
||||
dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, { w->windowPos.x + 5, w->windowPos.y + 43 }, WW - 5);
|
||||
}
|
||||
|
||||
static void window_object_load_error_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t scrollIndex)
|
||||
|
|
|
@ -2181,10 +2181,9 @@ static void window_options_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
int32_t widgetHeight = pathWidget.bottom - pathWidget.top;
|
||||
int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
|
||||
uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0;
|
||||
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1], w->windowPos.x + pathWidget.left + 1,
|
||||
w->windowPos.y + pathWidget.top + padding, 277);
|
||||
ScreenCoordsXY screenCoords = { w->windowPos.x + pathWidget.left + 1,
|
||||
w->windowPos.y + pathWidget.top + static_cast<int32_t>(padding) };
|
||||
gfx_draw_string_left_clipped(dpi, STR_STRING, gCommonFormatArgs, w->colours[1], screenCoords, 277);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5097,7 +5097,7 @@ static void window_ride_colour_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
}
|
||||
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STATION_STYLE, gCommonFormatArgs, COLOUR_BLACK, w->windowPos.x + 3, w->windowPos.y + 103, 97);
|
||||
dpi, STR_STATION_STYLE, gCommonFormatArgs, COLOUR_BLACK, { w->windowPos.x + 3, w->windowPos.y + 103 }, 97);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5827,7 +5827,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
set_format_arg(2 + (numTimes * 4), uint16_t, 0);
|
||||
set_format_arg(4 + (numTimes * 4), uint16_t, 0);
|
||||
set_format_arg(6 + (numTimes * 4), uint16_t, 0);
|
||||
gfx_draw_string_left_clipped(dpi, STR_RIDE_TIME, gCommonFormatArgs, COLOUR_BLACK, x, y, 308);
|
||||
gfx_draw_string_left_clipped(dpi, STR_RIDE_TIME, gCommonFormatArgs, COLOUR_BLACK, { x, y }, 308);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
@ -5860,7 +5860,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
set_format_arg(2 + (numLengths * 4), uint16_t, 0);
|
||||
set_format_arg(4 + (numLengths * 4), uint16_t, 0);
|
||||
set_format_arg(6 + (numLengths * 4), uint16_t, 0);
|
||||
gfx_draw_string_left_clipped(dpi, STR_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, x, y, 308);
|
||||
gfx_draw_string_left_clipped(dpi, STR_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, { x, y }, 308);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
|
|
|
@ -606,7 +606,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
|
||||
// Ride name
|
||||
ride->FormatNameTo(gCommonFormatArgs);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y - 1, 159);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y - 1 }, 159);
|
||||
|
||||
// Ride information
|
||||
auto formatSecondaryEnabled = true;
|
||||
|
@ -744,7 +744,7 @@ static void window_ride_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
|||
{
|
||||
set_format_arg(0, rct_string_id, formatSecondary);
|
||||
}
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 160, y - 1, 157);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 160, y - 1 }, 157);
|
||||
y += SCROLLABLE_ROW_HEIGHT;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1187,7 +1187,7 @@ void window_scenery_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(sceneryEntry != nullptr ? sceneryEntry->name : static_cast<rct_string_id>(STR_UNKNOWN_OBJECT_TYPE));
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, w->windowPos.x + 3, w->windowPos.y + w->height - 13,
|
||||
dpi, STR_BLACK_STRING, gCommonFormatArgs, COLOUR_BLACK, { w->windowPos.x + 3, w->windowPos.y + w->height - 13 },
|
||||
w->width - 19);
|
||||
}
|
||||
|
||||
|
|
|
@ -365,7 +365,7 @@ static void window_shortcut_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_SHORTCUT_ENTRY_FORMAT);
|
||||
ft.Add<rct_string_id>(ShortcutList[i].StringId);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y - 1, bindingOffset);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y - 1 }, bindingOffset);
|
||||
|
||||
char keybinding[128];
|
||||
keyboard_shortcuts_format_string(keybinding, 128, ShortcutList[i].ShortcutId);
|
||||
|
@ -376,7 +376,7 @@ static void window_shortcut_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
|
|||
ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<char*>(keybinding);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, bindingOffset, y - 1, maxWidth);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { bindingOffset, y - 1 }, maxWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -701,10 +701,10 @@ void window_staff_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_
|
|||
}
|
||||
|
||||
peep->FormatNameTo(gCommonFormatArgs);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, 0, y, nameColumnSize);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { 0, y }, nameColumnSize);
|
||||
|
||||
peep->FormatActionTo(gCommonFormatArgs);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, actionOffset, y, actionColumnSize);
|
||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { actionOffset, y }, actionColumnSize);
|
||||
|
||||
// True if a patrol path is set for the worker
|
||||
if (gStaffModes[peep->staff_id] & 2)
|
||||
|
|
|
@ -842,8 +842,8 @@ void window_themes_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
w->windowPos.y + window_themes_widgets[WIDX_THEMES_PRESETS].top + 1);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1],
|
||||
w->windowPos.x + window_themes_widgets[WIDX_THEMES_PRESETS].left + 1,
|
||||
w->windowPos.y + window_themes_widgets[WIDX_THEMES_PRESETS].top,
|
||||
{ w->windowPos.x + window_themes_widgets[WIDX_THEMES_PRESETS].left + 1,
|
||||
w->windowPos.y + window_themes_widgets[WIDX_THEMES_PRESETS].top },
|
||||
w->windowPos.x + window_themes_widgets[WIDX_THEMES_PRESETS_DROPDOWN].left
|
||||
- window_themes_widgets[WIDX_THEMES_PRESETS].left - 4);
|
||||
}
|
||||
|
|
|
@ -1754,32 +1754,32 @@ static void window_tile_inspector_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
if ((widget = &w->widgets[WIDX_COLUMN_TYPE])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_ELEMENT_TYPE, gCommonFormatArgs, w->colours[1], w->windowPos.x + widget->left + 1,
|
||||
w->windowPos.y + widget->top + 1, widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_ELEMENT_TYPE, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->right - widget->left);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_BASEHEIGHT])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1], w->windowPos.x + widget->left + 1,
|
||||
w->windowPos.y + widget->top + 1, widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_BASE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->right - widget->left);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_CLEARANCEHEIGHT])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_CLEARANGE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1], w->windowPos.x + widget->left + 1,
|
||||
w->windowPos.y + widget->top + 1, widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_CLEARANGE_HEIGHT_SHORT, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->right - widget->left);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_GHOSTFLAG])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, gCommonFormatArgs, w->colours[1], w->windowPos.x + widget->left + 1,
|
||||
w->windowPos.y + widget->top + 1, widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_FLAG_GHOST_SHORT, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->right - widget->left);
|
||||
}
|
||||
if ((widget = &w->widgets[WIDX_COLUMN_LASTFLAG])->type != WWT_EMPTY)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TILE_INSPECTOR_FLAG_LAST_SHORT, gCommonFormatArgs, w->colours[1], w->windowPos.x + widget->left + 1,
|
||||
w->windowPos.y + widget->top + 1, widget->right - widget->left);
|
||||
dpi, STR_TILE_INSPECTOR_FLAG_LAST_SHORT, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + widget->left + 1, w->windowPos.y + widget->top + 1 }, widget->right - widget->left);
|
||||
}
|
||||
|
||||
ScreenCoordsXY screenCoords(w->windowPos.x, w->windowPos.y);
|
||||
|
@ -2298,7 +2298,7 @@ static void window_tile_inspector_scrollpaint(rct_window* w, rct_drawpixelinfo*
|
|||
ft.Add<rct_string_id>(STR_STRING);
|
||||
ft.Add<char*>(typeName);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, stringFormat, gCommonFormatArgs, COLOUR_BLACK, x + COL_X_TYPE + 3, y, COL_X_BH); // 3px padding
|
||||
dpi, stringFormat, gCommonFormatArgs, COLOUR_BLACK, { x + COL_X_TYPE + 3, y }, COL_X_BH); // 3px padding
|
||||
|
||||
// Base height
|
||||
ft = Formatter::Common();
|
||||
|
|
|
@ -752,8 +752,8 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
|||
|
||||
// Command dropdown name
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, command_info.nameStringId, nullptr, w->colours[1], w->windowPos.x + w->widgets[WIDX_COMMAND].left + 1,
|
||||
w->windowPos.y + w->widgets[WIDX_COMMAND].top,
|
||||
dpi, command_info.nameStringId, nullptr, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_COMMAND].left + 1, w->windowPos.y + w->widgets[WIDX_COMMAND].top },
|
||||
w->widgets[WIDX_COMMAND_DROPDOWN].left - w->widgets[WIDX_COMMAND].left - 4);
|
||||
|
||||
// Label (e.g. "Location:")
|
||||
|
@ -763,8 +763,8 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
|||
if (command.Type == TITLE_SCRIPT_SPEED)
|
||||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, SpeedNames[command.Speed - 1], nullptr, w->colours[1], w->windowPos.x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->windowPos.y + w->widgets[WIDX_INPUT].top,
|
||||
dpi, SpeedNames[command.Speed - 1], nullptr, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
if (command.Type == TITLE_SCRIPT_FOLLOW)
|
||||
|
@ -786,8 +786,8 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
|||
w->windowPos.x + w->widgets[WIDX_VIEWPORT].left, w->windowPos.y + w->widgets[WIDX_VIEWPORT].top,
|
||||
w->windowPos.x + w->widgets[WIDX_VIEWPORT].right, w->windowPos.y + w->widgets[WIDX_VIEWPORT].bottom);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, spriteString, gCommonFormatArgs, colour, w->windowPos.x + w->widgets[WIDX_VIEWPORT].left + 2,
|
||||
w->windowPos.y + w->widgets[WIDX_VIEWPORT].top + 1,
|
||||
dpi, spriteString, gCommonFormatArgs, colour,
|
||||
{ w->windowPos.x + w->widgets[WIDX_VIEWPORT].left + 2, w->windowPos.y + w->widgets[WIDX_VIEWPORT].top + 1 },
|
||||
w->widgets[WIDX_VIEWPORT].right - w->widgets[WIDX_VIEWPORT].left - 2);
|
||||
}
|
||||
else if (command.Type == TITLE_SCRIPT_LOAD)
|
||||
|
@ -796,15 +796,15 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
|||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TITLE_COMMAND_EDITOR_NO_SAVE_SELECTED, nullptr, w->colours[1],
|
||||
w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top,
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
Formatter::Common().Add<uintptr_t>(reinterpret_cast<uintptr_t>(_sequence->Saves[command.SaveIndex]));
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1], w->windowPos.x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->windowPos.y + w->widgets[WIDX_INPUT].top,
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
}
|
||||
|
@ -814,7 +814,7 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
|||
{
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_TITLE_COMMAND_EDITOR_NO_SCENARIO_SELECTED, nullptr, w->colours[1],
|
||||
w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top,
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
else
|
||||
|
@ -832,8 +832,8 @@ static void window_title_command_editor_paint(rct_window* w, rct_drawpixelinfo*
|
|||
}
|
||||
Formatter::Common().Add<const char*>(name);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, nameString, gCommonFormatArgs, w->colours[1], w->windowPos.x + w->widgets[WIDX_INPUT].left + 1,
|
||||
w->windowPos.y + w->widgets[WIDX_INPUT].top,
|
||||
dpi, nameString, gCommonFormatArgs, w->colours[1],
|
||||
{ w->windowPos.x + w->widgets[WIDX_INPUT].left + 1, w->windowPos.y + w->widgets[WIDX_INPUT].top },
|
||||
w->widgets[WIDX_INPUT_DROPDOWN].left - w->widgets[WIDX_INPUT].left - 4);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -838,8 +838,8 @@ static void window_title_editor_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
w->windowPos.y + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top + 1);
|
||||
gfx_draw_string_left_clipped(
|
||||
dpi, STR_STRING, gCommonFormatArgs, w->colours[1],
|
||||
w->windowPos.x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left + 1,
|
||||
w->windowPos.y + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top,
|
||||
{ w->windowPos.x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left + 1,
|
||||
w->windowPos.y + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].top },
|
||||
w->windowPos.x + window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS_DROPDOWN].left
|
||||
- window_title_editor_widgets[WIDX_TITLE_EDITOR_PRESETS].left - 4);
|
||||
break;
|
||||
|
|
|
@ -625,7 +625,7 @@ static void window_track_list_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
auto ft = Formatter::Common();
|
||||
ft.Add<rct_string_id>(STR_RIDE_LENGTH_ENTRY);
|
||||
ft.Add<uint16_t>(_loadedTrackDesign->ride_length);
|
||||
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, x, y, 214);
|
||||
gfx_draw_string_left_clipped(dpi, STR_TRACK_LIST_RIDE_LENGTH, gCommonFormatArgs, COLOUR_BLACK, { x, y }, 214);
|
||||
y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
|
|
|
@ -548,7 +548,7 @@ void draw_string_right_underline(
|
|||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, int32_t x, int32_t y);
|
||||
|
||||
void gfx_draw_string_left_clipped(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, int32_t x, int32_t y, int32_t width);
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, const ScreenCoordsXY& coords, int32_t width);
|
||||
void gfx_draw_string_centred_clipped(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, int32_t x, int32_t y, int32_t width);
|
||||
void gfx_draw_string_right_clipped(
|
||||
|
|
|
@ -192,9 +192,9 @@ void draw_string_right_underline(rct_drawpixelinfo* dpi, rct_string_id format, v
|
|||
|
||||
// Ellipsised
|
||||
void gfx_draw_string_left_clipped(
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, int32_t x, int32_t y, int32_t width)
|
||||
rct_drawpixelinfo* dpi, rct_string_id format, void* args, uint8_t colour, const ScreenCoordsXY& coords, int32_t width)
|
||||
{
|
||||
DrawTextEllipsisedCompat(dpi, x, y, width, format, args, colour, TextAlignment::LEFT);
|
||||
DrawTextEllipsisedCompat(dpi, coords.x, coords.y, width, format, args, colour, TextAlignment::LEFT);
|
||||
}
|
||||
|
||||
void gfx_draw_string_centred_clipped(
|
||||
|
|
Loading…
Reference in New Issue