Remove snake_case from second chunk of Drawing (#19166)

This commit is contained in:
Duncan 2023-01-16 18:52:17 +00:00 committed by GitHub
parent 8a8d3105f3
commit 7f5934cc95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
109 changed files with 502 additions and 504 deletions

View File

@ -591,7 +591,7 @@ void OpenGLDrawingContext::DrawSprite(rct_drawpixelinfo* dpi, const ImageId imag
{
CalculcateClipping(dpi);
auto g1Element = gfx_get_g1_element(imageId);
auto g1Element = GfxGetG1Element(imageId);
if (g1Element == nullptr)
{
return;
@ -742,8 +742,8 @@ void OpenGLDrawingContext::DrawSpriteRawMasked(
{
CalculcateClipping(dpi);
auto g1ElementMask = gfx_get_g1_element(maskImage);
auto g1ElementColour = gfx_get_g1_element(colourImage);
auto g1ElementMask = GfxGetG1Element(maskImage);
auto g1ElementColour = GfxGetG1Element(colourImage);
if (g1ElementMask == nullptr || g1ElementColour == nullptr)
{
return;
@ -806,7 +806,7 @@ void OpenGLDrawingContext::DrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId
assert((colour & 0xFF) > 0u);
auto g1Element = gfx_get_g1_element(image);
auto g1Element = GfxGetG1Element(image);
if (g1Element == nullptr)
{
return;
@ -857,7 +857,7 @@ void OpenGLDrawingContext::DrawGlyph(
{
CalculcateClipping(dpi);
auto g1Element = gfx_get_g1_element(image);
auto g1Element = GfxGetG1Element(image);
if (g1Element == nullptr)
{
return;

View File

@ -219,8 +219,8 @@ void TextureCache::GeneratePaletteTexture()
auto g1Index = GetPaletteG1Index(i);
if (g1Index.has_value())
{
auto element = gfx_get_g1_element(g1Index.value());
gfx_draw_sprite_software(&dpi, ImageId(g1Index.value()), { -element->x_offset, y - element->y_offset });
auto element = GfxGetG1Element(g1Index.value());
GfxDrawSpriteSoftware(&dpi, ImageId(g1Index.value()), { -element->x_offset, y - element->y_offset });
}
}
@ -349,25 +349,25 @@ AtlasTextureInfo TextureCache::AllocateImage(int32_t imageWidth, int32_t imageHe
rct_drawpixelinfo TextureCache::GetImageAsDPI(const ImageId imageId)
{
auto g1Element = gfx_get_g1_element(imageId);
auto g1Element = GfxGetG1Element(imageId);
int32_t width = g1Element->width;
int32_t height = g1Element->height;
rct_drawpixelinfo dpi = CreateDPI(width, height);
gfx_draw_sprite_software(&dpi, imageId, { -g1Element->x_offset, -g1Element->y_offset });
GfxDrawSpriteSoftware(&dpi, imageId, { -g1Element->x_offset, -g1Element->y_offset });
return dpi;
}
rct_drawpixelinfo TextureCache::GetGlyphAsDPI(const ImageId imageId, const PaletteMap& palette)
{
auto g1Element = gfx_get_g1_element(imageId);
auto g1Element = GfxGetG1Element(imageId);
int32_t width = g1Element->width;
int32_t height = g1Element->height;
rct_drawpixelinfo dpi = CreateDPI(width, height);
const auto glyphCoords = ScreenCoordsXY{ -g1Element->x_offset, -g1Element->y_offset };
gfx_draw_sprite_palette_set_software(&dpi, imageId, glyphCoords, palette);
GfxDrawSpritePaletteSetSoftware(&dpi, imageId, glyphCoords, palette);
return dpi;
}

View File

@ -150,7 +150,7 @@ void InGameConsole::RefreshCaret(size_t position)
_selectionStart = position;
char tempString[TEXT_INPUT_SIZE] = { 0 };
std::memcpy(tempString, &_consoleCurrentLine, _selectionStart);
_caretScreenPosX = gfx_get_string_width_no_formatting(tempString, InGameConsoleGetFontStyle());
_caretScreenPosX = GfxGetStringWidthNoFormatting(tempString, InGameConsoleGetFontStyle());
}
void InGameConsole::Scroll(int32_t linesToScroll)
@ -318,7 +318,7 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
{
const size_t index = i + _consoleScrollPos;
lineBuffer = _colourFormatStr + _consoleLines[index];
gfx_draw_string(dpi, screenCoords, lineBuffer.c_str(), { textColour, InGameConsoleGetFontStyle() });
GfxDrawString(dpi, screenCoords, lineBuffer.c_str(), { textColour, InGameConsoleGetFontStyle() });
screenCoords.y += lineHeight;
}
@ -326,7 +326,7 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
// Draw current line
lineBuffer = _colourFormatStr + _consoleCurrentLine;
gfx_draw_string_no_formatting(dpi, screenCoords, lineBuffer.c_str(), { TEXT_COLOUR_255, InGameConsoleGetFontStyle() });
GfxDrawStringNoFormatting(dpi, screenCoords, lineBuffer.c_str(), { TEXT_COLOUR_255, InGameConsoleGetFontStyle() });
// Draw caret
if (_consoleCaretTicks < CONSOLE_CARET_FLASH_THRESHOLD)

View File

@ -143,7 +143,7 @@ static void WidgetFrameDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex w
// Draw the resize sprite at the bottom right corner
leftTop = w.windowPos + ScreenCoordsXY{ widget.right - 18, widget.bottom - 18 };
gfx_draw_sprite(dpi, ImageId(SPR_RESIZE, colour & 0x7F), leftTop);
GfxDrawSprite(dpi, ImageId(SPR_RESIZE, colour & 0x7F), leftTop);
}
/**
@ -174,7 +174,7 @@ static void WidgetResizeDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
// Draw the resize sprite at the bottom right corner
leftTop = w.windowPos + ScreenCoordsXY{ widget.right - 18, widget.bottom - 18 };
gfx_draw_sprite(dpi, ImageId(SPR_RESIZE, colour & 0x7F), leftTop);
GfxDrawSprite(dpi, ImageId(SPR_RESIZE, colour & 0x7F), leftTop);
}
/**
@ -255,7 +255,7 @@ static void WidgetTabDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex wid
auto image = widget.image.WithIndex(newIndex).WithPrimary(colour);
// Draw disabled image
gfx_draw_sprite(dpi, image, leftTop);
GfxDrawSprite(dpi, image, leftTop);
}
/**
@ -491,7 +491,7 @@ static void WidgetGroupboxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetInde
auto ft = Formatter();
ft.Add<utf8*>(buffer);
DrawTextBasic(dpi, { l, t }, STR_STRING, ft, { colour });
textRight = l + gfx_get_string_width(buffer, FontStyle::Medium) + 1;
textRight = l + GfxGetStringWidth(buffer, FontStyle::Medium) + 1;
}
// Border
@ -639,7 +639,7 @@ static void WidgetCheckboxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetInde
// fill it when checkbox is pressed
if (WidgetIsPressed(w, widgetIndex))
{
gfx_draw_string(
GfxDrawString(
dpi, { midLeft - ScreenCoordsXY{ 0, 5 } }, static_cast<const char*>(CheckBoxMarkString),
{ static_cast<colour_t>(NOT_TRANSLUCENT(colour)) });
}
@ -649,7 +649,7 @@ static void WidgetCheckboxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetInde
return;
auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget);
gfx_draw_string_left_centred(dpi, stringId, formatArgs, colour, { midLeft + ScreenCoordsXY{ 14, 0 } });
GfxDrawStringLeftCentred(dpi, stringId, formatArgs, colour, { midLeft + ScreenCoordsXY{ 14, 0 } });
}
/**
@ -741,7 +741,7 @@ static void WidgetHScrollbarDraw(
uint8_t flags = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
GfxFillRectInset(dpi, { { l, t }, { l + (SCROLLBAR_WIDTH - 1), b } }, colour, flags);
gfx_draw_string(dpi, { l + 1, t }, static_cast<const char*>(BlackLeftArrowString), {});
GfxDrawString(dpi, { l + 1, t }, static_cast<const char*>(BlackLeftArrowString), {});
}
// Thumb
@ -758,7 +758,7 @@ static void WidgetHScrollbarDraw(
uint8_t flags = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0;
GfxFillRectInset(dpi, { { r - (SCROLLBAR_WIDTH - 1), t }, { r, b } }, colour, flags);
gfx_draw_string(dpi, { r - 6, t }, static_cast<const char*>(BlackRightArrowString), {});
GfxDrawString(dpi, { r - 6, t }, static_cast<const char*>(BlackRightArrowString), {});
}
}
@ -778,7 +778,7 @@ static void WidgetVScrollbarDraw(
GfxFillRectInset(
dpi, { { l, t }, { r, t + (SCROLLBAR_WIDTH - 1) } }, colour,
((scroll.flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
gfx_draw_string(dpi, { l + 1, t - 1 }, static_cast<const char*>(BlackUpArrowString), {});
GfxDrawString(dpi, { l + 1, t - 1 }, static_cast<const char*>(BlackUpArrowString), {});
// Thumb
GfxFillRectInset(
@ -791,7 +791,7 @@ static void WidgetVScrollbarDraw(
GfxFillRectInset(
dpi, { { l, b - (SCROLLBAR_WIDTH - 1) }, { r, b } }, colour,
((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0));
gfx_draw_string(dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast<const char*>(BlackDownArrowString), {});
GfxDrawString(dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast<const char*>(BlackDownArrowString), {});
}
/**
@ -824,12 +824,12 @@ static void WidgetDrawImage(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex w
// Draw greyed out (light border bottom right shadow)
colour = w.colours[widget.colour];
colour = ColourMapA[NOT_TRANSLUCENT(colour)].lighter;
gfx_draw_sprite_solid(dpi, image, screenCoords + ScreenCoordsXY{ 1, 1 }, colour);
GfxDrawSpriteSolid(dpi, image, screenCoords + ScreenCoordsXY{ 1, 1 }, colour);
// Draw greyed out (dark)
colour = w.colours[widget.colour];
colour = ColourMapA[NOT_TRANSLUCENT(colour)].mid_light;
gfx_draw_sprite_solid(dpi, image, screenCoords, colour);
GfxDrawSpriteSolid(dpi, image, screenCoords, colour);
}
else
{
@ -843,7 +843,7 @@ static void WidgetDrawImage(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex w
else
image = image.WithPrimary(colour);
gfx_draw_sprite(dpi, image, screenCoords);
GfxDrawSprite(dpi, image, screenCoords);
}
}
@ -1149,9 +1149,8 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
if (widget.text != 0)
{
safe_strcpy(wrapped_string, widget.string, 512);
gfx_wrap_string(wrapped_string, bottomRight.x - topLeft.x - 5, FontStyle::Medium, &no_lines);
gfx_draw_string_no_formatting(
dpi, { topLeft.x + 2, topLeft.y }, wrapped_string, { w.colours[1], FontStyle::Medium });
GfxWrapString(wrapped_string, bottomRight.x - topLeft.x - 5, FontStyle::Medium, &no_lines);
GfxDrawStringNoFormatting(dpi, { topLeft.x + 2, topLeft.y }, wrapped_string, { w.colours[1], FontStyle::Medium });
}
return;
}
@ -1160,16 +1159,16 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
// String length needs to add 12 either side of box
// +13 for cursor when max length.
gfx_wrap_string(wrapped_string, bottomRight.x - topLeft.x - 5 - 6, FontStyle::Medium, &no_lines);
GfxWrapString(wrapped_string, bottomRight.x - topLeft.x - 5 - 6, FontStyle::Medium, &no_lines);
gfx_draw_string_no_formatting(dpi, { topLeft.x + 2, topLeft.y }, wrapped_string, { w.colours[1], FontStyle::Medium });
GfxDrawStringNoFormatting(dpi, { topLeft.x + 2, topLeft.y }, wrapped_string, { w.colours[1], FontStyle::Medium });
size_t string_length = get_string_size(wrapped_string) - 1;
// Make a copy of the string for measuring the width.
char temp_string[TEXT_INPUT_SIZE] = { 0 };
std::memcpy(temp_string, wrapped_string, std::min(string_length, gTextInput->SelectionStart));
int32_t cur_x = topLeft.x + gfx_get_string_width_no_formatting(temp_string, FontStyle::Medium) + 3;
int32_t cur_x = topLeft.x + GfxGetStringWidthNoFormatting(temp_string, FontStyle::Medium) + 3;
int32_t width = 6;
if (static_cast<uint32_t>(gTextInput->SelectionStart) < strlen(gTextBoxInput))
@ -1178,7 +1177,7 @@ static void WidgetTextBoxDraw(rct_drawpixelinfo* dpi, rct_window& w, WidgetIndex
// of the character that the cursor is under.
temp_string[1] = '\0';
temp_string[0] = gTextBoxInput[gTextInput->SelectionStart];
width = std::max(gfx_get_string_width_no_formatting(temp_string, FontStyle::Medium) - 2, 4);
width = std::max(GfxGetStringWidthNoFormatting(temp_string, FontStyle::Medium) - 2, 4);
}
if (gTextBoxFrameNo <= 15)

View File

@ -63,7 +63,7 @@ namespace OpenRCT2::Scripting
for (ImageIndex i = 0; i < range.Count; i++)
{
auto index = range.BaseId + i;
auto g1 = gfx_get_g1_element(index);
auto g1 = GfxGetG1Element(index);
if (g1 != nullptr)
{
// Free pixel data
@ -71,7 +71,7 @@ namespace OpenRCT2::Scripting
// Replace slot with empty element
rct_g1_element empty{};
gfx_set_g1_element(index, &empty);
GfxSetG1Element(index, &empty);
}
}
gfx_object_free_images(range.BaseId, range.Count);
@ -143,7 +143,7 @@ namespace OpenRCT2::Scripting
DukValue DukGetImageInfo(duk_context* ctx, ImageIndex id)
{
auto* g1 = gfx_get_g1_element(id);
auto* g1 = GfxGetG1Element(id);
if (g1 == nullptr)
{
return ToDuk(ctx, undefined);
@ -182,12 +182,12 @@ namespace OpenRCT2::Scripting
DukValue DukGetImagePixelData(duk_context* ctx, ImageIndex id)
{
auto* g1 = gfx_get_g1_element(id);
auto* g1 = GfxGetG1Element(id);
if (g1 == nullptr)
{
return ToDuk(ctx, undefined);
}
auto dataSize = g1_calculate_data_size(g1);
auto dataSize = G1CalculateDataSize(g1);
auto* type = GetPixelDataTypeForG1(*g1);
// Copy the G1 data to a JS buffer wrapped in a Uint8Array
@ -377,7 +377,7 @@ namespace OpenRCT2::Scripting
{
// Setup the g1 element
rct_g1_element el{};
auto* lastel = gfx_get_g1_element(id);
auto* lastel = GfxGetG1Element(id);
if (lastel != nullptr)
{
el = *lastel;
@ -396,7 +396,7 @@ namespace OpenRCT2::Scripting
{
el.flags |= G1_FLAG_RLE_COMPRESSION;
}
gfx_set_g1_element(id, &el);
GfxSetG1Element(id, &el);
drawing_engine_invalidate_image(id);
}
@ -426,7 +426,7 @@ namespace OpenRCT2::Scripting
dpi.height = size.height;
auto createNewImage = false;
auto g1 = gfx_get_g1_element(id);
auto g1 = GfxGetG1Element(id);
if (g1 == nullptr || g1->width != size.width || g1->height != size.height || (g1->flags & G1_FLAG_RLE_COMPRESSION))
{
createNewImage = true;
@ -439,7 +439,7 @@ namespace OpenRCT2::Scripting
std::memset(dpi.bits, 0, bufferSize);
// Draw the original image if we are creating a new one
gfx_draw_sprite(&dpi, ImageId(id), { 0, 0 });
GfxDrawSprite(&dpi, ImageId(id), { 0, 0 });
}
else
{
@ -461,7 +461,7 @@ namespace OpenRCT2::Scripting
newg1.width = size.width;
newg1.height = size.height;
newg1.flags = 0;
gfx_set_g1_element(id, &newg1);
GfxSetG1Element(id, &newg1);
}
drawing_engine_invalidate_image(id);

View File

@ -715,7 +715,7 @@ void CustomListView::PaintSeperator(
// Get string dimensions
format_string(gCommonStringFormatBuffer, sizeof(gCommonStringFormatBuffer), STR_STRING, ft.Data());
int32_t categoryStringHalfWidth = (gfx_get_string_width(gCommonStringFormatBuffer, FontStyle::Medium) / 2) + 4;
int32_t categoryStringHalfWidth = (GfxGetStringWidth(gCommonStringFormatBuffer, FontStyle::Medium) / 2) + 4;
int32_t strLeft = centreX - categoryStringHalfWidth;
int32_t strRight = centreX + categoryStringHalfWidth;

View File

@ -866,7 +866,7 @@ namespace OpenRCT2::Ui::Windows
auto imageOffset = frame % tab.imageFrameCount;
image = image.WithIndex(image.GetIndex() + imageOffset);
}
gfx_draw_sprite(&dpi, image, leftTop);
GfxDrawSprite(&dpi, image, leftTop);
}
tabIndex++;
}

View File

@ -156,8 +156,8 @@ namespace OpenRCT2::Scripting
DukValue measureText(const std::string& text)
{
auto width = gfx_get_string_width(text, FontStyle::Medium);
auto height = string_get_height_raw(text.c_str(), FontStyle::Medium);
auto width = GfxGetStringWidth(text, FontStyle::Medium);
auto height = StringGetHeightRaw(text.c_str(), FontStyle::Medium);
return ToDuk<ScreenSize>(_ctx, { width, height });
}
@ -205,7 +205,7 @@ namespace OpenRCT2::Scripting
}
}
gfx_draw_sprite(&_dpi, img.WithTertiary(_tertiaryColour.value_or(0)), { x, y });
GfxDrawSprite(&_dpi, img.WithTertiary(_tertiaryColour.value_or(0)), { x, y });
}
void line(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
@ -235,7 +235,7 @@ namespace OpenRCT2::Scripting
void text(const std::string& text, int32_t x, int32_t y)
{
gfx_draw_string(&_dpi, { x, y }, text.c_str(), { _colour.value_or(0) });
GfxDrawString(&_dpi, { x, y }, text.c_str(), { _colour.value_or(0) });
}
};
} // namespace OpenRCT2::Scripting

View File

@ -201,7 +201,7 @@ private:
// Draw logo on placeholder widget
ScreenCoordsXY logoCoords = windowPos
+ ScreenCoordsXY(widgets[WIDX_OPENRCT2_LOGO].left, widgets[WIDX_OPENRCT2_LOGO].top);
gfx_draw_sprite(&dpi, ImageId(SPR_G2_LOGO), logoCoords);
GfxDrawSprite(&dpi, ImageId(SPR_G2_LOGO), logoCoords);
// Version info
utf8 buffer[256];
utf8* ch = buffer;
@ -255,7 +255,7 @@ private:
DrawTextBasic(&dpi, screenCoords, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, {}, { TextAlignment::CENTRE });
// Images
gfx_draw_sprite(&dpi, ImageId(SPR_CREDITS_CHRIS_SAWYER_SMALL), { windowPos.x + 92, yPage + 24 });
GfxDrawSprite(&dpi, ImageId(SPR_CREDITS_CHRIS_SAWYER_SMALL), { windowPos.x + 92, yPage + 24 });
// Licence
}

View File

@ -196,7 +196,7 @@ public:
if (screenCoords.y + lineHeight < dpi.y || screenCoords.y >= dpi.y + dpi.height)
continue;
gfx_draw_string(&dpi, screenCoords, line.c_str(), { colours[0] });
GfxDrawString(&dpi, screenCoords, line.c_str(), { colours[0] });
}
}
@ -306,7 +306,7 @@ private:
_changelogLongestLineWidth = 0;
for (const auto& line : _changelogLines)
{
int32_t linewidth = gfx_get_string_width(line.c_str(), FontStyle::Medium);
int32_t linewidth = GfxGetStringWidth(line.c_str(), FontStyle::Medium);
_changelogLongestLineWidth = std::max(linewidth, _changelogLongestLineWidth);
}
}

View File

@ -662,7 +662,7 @@ private:
uint32_t sprite_idx = SPR_TAB_FINANCES_SUMMARY_0;
if (page == WINDOW_CHEATS_PAGE_MONEY)
sprite_idx += (frame_no / 2) % 8;
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top });
}
@ -672,14 +672,14 @@ private:
uint32_t sprite_idx = SPR_TAB_GUESTS_0;
if (page == WINDOW_CHEATS_PAGE_GUESTS)
sprite_idx += (frame_no / 3) % 8;
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top });
}
// Misc tab
if (!IsWidgetDisabled(WIDX_TAB_3))
{
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(SPR_TAB_PARK), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top });
}
@ -689,7 +689,7 @@ private:
uint32_t sprite_idx = SPR_TAB_RIDE_0;
if (page == WINDOW_CHEATS_PAGE_RIDES)
sprite_idx += (frame_no / 4) % 16;
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top });
}
}

View File

@ -208,8 +208,7 @@ public:
+ ScreenCoordsXY{ window_custom_currency_widgets[WIDX_SYMBOL_TEXT].left + 1,
window_custom_currency_widgets[WIDX_SYMBOL_TEXT].top };
gfx_draw_string(
&dpi, screenCoords, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, { colours[1] });
GfxDrawString(&dpi, screenCoords, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, { colours[1] });
auto drawPos = windowPos
+ ScreenCoordsXY{ window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1,

View File

@ -110,7 +110,7 @@ public:
const auto& stringIdx = widgets[widgetIndex].text;
auto string = ls.GetString(stringIdx);
Guard::ArgumentNotNull(string);
const auto strWidth = gfx_get_string_width(string, FontStyle::Medium);
const auto strWidth = GfxGetStringWidth(string, FontStyle::Medium);
newWidth = std::max<int16_t>(strWidth, newWidth);
}

View File

@ -186,7 +186,7 @@ public:
: ImageId::FromUInt32(static_cast<uint32_t>(gDropdownItems[i].Args));
if (item == Dropdown::FormatColourPicker && highlightedIndex == i)
image = image.WithIndexOffset(1);
gfx_draw_sprite(&dpi, image, screenCoords);
GfxDrawSprite(&dpi, image, screenCoords);
}
else
{
@ -353,7 +353,7 @@ void WindowDropdownShowText(const ScreenCoordsXY& screenPos, int32_t extray, uin
for (size_t i = 0; i < num_items; i++)
{
format_string(buffer, 256, gDropdownItems[i].Format, static_cast<void*>(&gDropdownItems[i].Args));
string_width = gfx_get_string_width(buffer, FontStyle::Medium);
string_width = GfxGetStringWidth(buffer, FontStyle::Medium);
max_string_width = std::max(string_width, max_string_width);
}

View File

@ -294,7 +294,7 @@ private:
+ ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].right - 1, widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 };
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(SPR_PREVIOUS),
windowPos + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 6, widgets[WIDX_PREVIOUS_IMAGE].top + 6 });
@ -331,7 +331,7 @@ private:
+ ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 1, widgets[WIDX_NEXT_IMAGE].bottom - 1 };
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30);
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(SPR_NEXT),
windowPos + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 29, widgets[WIDX_NEXT_IMAGE].top + 6 });

View File

@ -351,7 +351,7 @@ public:
// Tab image
auto screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top };
gfx_draw_sprite(&dpi, ImageId(SPR_TAB_FINANCES_RESEARCH_0 + (frame_no / 2) % 8), screenPos);
GfxDrawSprite(&dpi, ImageId(SPR_TAB_FINANCES_RESEARCH_0 + (frame_no / 2) % 8), screenPos);
// Pre-researched items label
screenPos = windowPos

View File

@ -725,7 +725,7 @@ public:
if (*listItem.flags & (ObjectSelectionFlags::InUse | ObjectSelectionFlags::AlwaysRequired))
colour2 |= COLOUR_FLAG_INSET;
gfx_draw_string(
GfxDrawString(
&dpi, screenCoords, static_cast<const char*>(CheckBoxMarkString),
{ static_cast<colour_t>(colour2), FontStyle::Medium, darkness });
}
@ -966,7 +966,7 @@ public:
{
auto image = ImageId(ObjectSelectionPages[i].Image);
auto screenPos = windowPos + ScreenCoordsXY{ widget.left, widget.top };
gfx_draw_sprite(&dpi, image, screenPos);
GfxDrawSprite(&dpi, image, screenPos);
}
}
@ -996,7 +996,7 @@ public:
spriteIndex += (i == 4 ? ThrillRidesTabAnimationSequence[frame] : frame);
auto screenPos = windowPos + ScreenCoordsXY{ widget.left, widget.top };
gfx_draw_sprite(&dpi, ImageId(spriteIndex, colours[1]), screenPos);
GfxDrawSprite(&dpi, ImageId(spriteIndex, colours[1]), screenPos);
}
}

View File

@ -240,7 +240,7 @@ static void WindowEditorObjectiveOptionsDrawTabImages(rct_window* w, rct_drawpix
if (w->page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN)
spriteIndex += (w->frame_no / 4) % 16;
gfx_draw_sprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget->left, widget->top });
GfxDrawSprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget->left, widget->top });
// Tab 2
if (!WidgetIsDisabled(*w, WIDX_TAB_2))
@ -250,7 +250,7 @@ static void WindowEditorObjectiveOptionsDrawTabImages(rct_window* w, rct_drawpix
if (w->page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES)
spriteIndex += (w->frame_no / 4) % 16;
gfx_draw_sprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget->left, widget->top });
GfxDrawSprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget->left, widget->top });
}
}
@ -1079,7 +1079,7 @@ static void WindowEditorObjectiveOptionsRidesScrollpaint(rct_window* w, rct_draw
if (ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE)
{
auto darkness = stringId == STR_WINDOW_COLOUR_2_STRINGID ? TextDarkness::ExtraDark : TextDarkness::Dark;
gfx_draw_string(
GfxDrawString(
dpi, { 2, y }, static_cast<const char*>(CheckBoxMarkString),
{ static_cast<colour_t>(w->colours[1] & 0x7F), FontStyle::Medium, darkness });
}

View File

@ -331,7 +331,7 @@ private:
if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL)
spriteIndex += (frame_no / 2) % 8;
gfx_draw_sprite(&dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
GfxDrawSprite(&dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
// Tab 2
widget = &widgets[WIDX_TAB_2];
@ -339,12 +339,12 @@ private:
if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS)
spriteIndex += (frame_no / 4) % 8;
gfx_draw_sprite(&dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
GfxDrawSprite(&dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
// Tab 3
widget = &widgets[WIDX_TAB_3];
spriteIndex = SPR_TAB_PARK;
gfx_draw_sprite(&dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
GfxDrawSprite(&dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top });
}
void SetPage(int32_t newPage)

View File

@ -93,7 +93,7 @@ public:
&dpi, ScreenRect{ rightBottom - ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } },
FilterPaletteID::PaletteDarken3);
draw_string_centred_raw(
DrawStringCentredRaw(
&dpi, { leftTop + ScreenCoordsXY{ (width + 1) / 2 - 1, 1 } }, _numLines, _text.data(), FontStyle::Medium);
}
@ -135,11 +135,11 @@ rct_window* WindowErrorOpen(std::string_view title, std::string_view message)
return nullptr;
}
int32_t width = gfx_get_string_width_new_lined(buffer.data(), FontStyle::Medium);
int32_t width = GfxGetStringWidthNewLined(buffer.data(), FontStyle::Medium);
width = std::clamp(width, 64, 196);
int32_t numLines{};
gfx_wrap_string(buffer.data(), width + 1, FontStyle::Medium, &numLines);
GfxWrapString(buffer.data(), width + 1, FontStyle::Medium, &numLines);
width = width + 3;
int32_t height = (numLines + 1) * font_get_line_height(FontStyle::Medium) + 4;

View File

@ -1011,7 +1011,7 @@ public:
spriteIndex += (frame % _windowFinancesTabAnimationFrames[this->page]);
}
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top });
}
}

View File

@ -482,7 +482,7 @@ public:
screenCoords = this->windowPos
+ ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(),
window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60 };
gfx_draw_sprite(&dpi, ImageId(image), screenCoords);
GfxDrawSprite(&dpi, ImageId(image), screenCoords);
}
// Draw build this... label
@ -623,7 +623,7 @@ private:
void WindowFootpathDrawDropdownButton(rct_drawpixelinfo* dpi, WidgetIndex widgetIndex, ImageIndex image)
{
const auto& widget = widgets[widgetIndex];
gfx_draw_sprite(dpi, ImageId(image), { windowPos.x + widget.left, windowPos.y + widget.top });
GfxDrawSprite(dpi, ImageId(image), { windowPos.x + widget.left, windowPos.y + widget.top });
}
/**

View File

@ -474,8 +474,8 @@ static void WindowGameBottomToolbarDrawParkRating(
}
// Draw thumbs on the sides
gfx_draw_sprite(dpi, ImageId(SPR_RATING_LOW), coords - ScreenCoordsXY{ 14, 0 });
gfx_draw_sprite(dpi, ImageId(SPR_RATING_HIGH), coords + ScreenCoordsXY{ 114, 0 });
GfxDrawSprite(dpi, ImageId(SPR_RATING_LOW), coords - ScreenCoordsXY{ 14, 0 });
GfxDrawSprite(dpi, ImageId(SPR_RATING_HIGH), coords + ScreenCoordsXY{ 114, 0 });
}
static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_window* w)
@ -532,7 +532,7 @@ static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_wi
// Current weather
auto currentWeatherSpriteId = ClimateGetWeatherSpriteId(gClimateCurrent);
gfx_draw_sprite(dpi, ImageId(currentWeatherSpriteId), screenCoords);
GfxDrawSprite(dpi, ImageId(currentWeatherSpriteId), screenCoords);
// Next weather
auto nextWeatherSpriteId = ClimateGetWeatherSpriteId(gClimateNext);
@ -540,8 +540,8 @@ static void WindowGameBottomToolbarDrawRightPanel(rct_drawpixelinfo* dpi, rct_wi
{
if (gClimateUpdateTimer < 960)
{
gfx_draw_sprite(dpi, ImageId(SPR_NEXT_WEATHER), screenCoords + ScreenCoordsXY{ 27, 5 });
gfx_draw_sprite(dpi, ImageId(nextWeatherSpriteId), screenCoords + ScreenCoordsXY{ 40, 0 });
GfxDrawSprite(dpi, ImageId(SPR_NEXT_WEATHER), screenCoords + ScreenCoordsXY{ 27, 5 });
GfxDrawSprite(dpi, ImageId(nextWeatherSpriteId), screenCoords + ScreenCoordsXY{ 40, 0 });
}
}
}
@ -578,7 +578,7 @@ static void WindowGameBottomToolbarDrawNewsItem(rct_drawpixelinfo* dpi, rct_wind
switch (newsItem->Type)
{
case News::ItemType::Ride:
gfx_draw_sprite(dpi, ImageId(SPR_RIDE), screenCoords);
GfxDrawSprite(dpi, ImageId(SPR_RIDE), screenCoords);
break;
case News::ItemType::PeepOnRide:
case News::ItemType::Peep:
@ -608,41 +608,41 @@ static void WindowGameBottomToolbarDrawNewsItem(rct_drawpixelinfo* dpi, rct_wind
image_id_base++;
auto image_id = ImageId(image_id_base, peep->TshirtColour, peep->TrousersColour);
gfx_draw_sprite(&cliped_dpi, image_id, clipCoords);
GfxDrawSprite(&cliped_dpi, image_id, clipCoords);
auto* guest = peep->As<Guest>();
if (guest != nullptr)
{
if (image_id_base >= 0x2A1D && image_id_base < 0x2A3D)
{
gfx_draw_sprite(&cliped_dpi, ImageId(image_id_base + 32, guest->BalloonColour), clipCoords);
GfxDrawSprite(&cliped_dpi, ImageId(image_id_base + 32, guest->BalloonColour), clipCoords);
}
else if (image_id_base >= 0x2BBD && image_id_base < 0x2BDD)
{
gfx_draw_sprite(&cliped_dpi, ImageId(image_id_base + 32, guest->UmbrellaColour), clipCoords);
GfxDrawSprite(&cliped_dpi, ImageId(image_id_base + 32, guest->UmbrellaColour), clipCoords);
}
else if (image_id_base >= 0x29DD && image_id_base < 0x29FD)
{
gfx_draw_sprite(&cliped_dpi, ImageId(image_id_base + 32, guest->HatColour), clipCoords);
GfxDrawSprite(&cliped_dpi, ImageId(image_id_base + 32, guest->HatColour), clipCoords);
}
}
break;
}
case News::ItemType::Money:
case News::ItemType::Campaign:
gfx_draw_sprite(dpi, ImageId(SPR_FINANCE), screenCoords);
GfxDrawSprite(dpi, ImageId(SPR_FINANCE), screenCoords);
break;
case News::ItemType::Research:
gfx_draw_sprite(dpi, ImageId(newsItem->Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords);
GfxDrawSprite(dpi, ImageId(newsItem->Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords);
break;
case News::ItemType::Peeps:
gfx_draw_sprite(dpi, ImageId(SPR_GUESTS), screenCoords);
GfxDrawSprite(dpi, ImageId(SPR_GUESTS), screenCoords);
break;
case News::ItemType::Award:
gfx_draw_sprite(dpi, ImageId(SPR_AWARD), screenCoords);
GfxDrawSprite(dpi, ImageId(SPR_AWARD), screenCoords);
break;
case News::ItemType::Graph:
gfx_draw_sprite(dpi, ImageId(SPR_GRAPH), screenCoords);
GfxDrawSprite(dpi, ImageId(SPR_GRAPH), screenCoords);
break;
case News::ItemType::Null:
case News::ItemType::Blank:

View File

@ -551,7 +551,7 @@ private:
animationFrame += animationFrameOffset;
auto spriteId = ImageId(animationFrame, peep->TshirtColour, peep->TrousersColour);
gfx_draw_sprite(&clipDpi, spriteId, screenCoords);
GfxDrawSprite(&clipDpi, spriteId, screenCoords);
auto* guest = peep->As<Guest>();
if (guest != nullptr)
@ -559,19 +559,19 @@ private:
// If holding a balloon
if (animationFrame >= 0x2A1D && animationFrame < 0x2A3D)
{
gfx_draw_sprite(&clipDpi, ImageId(animationFrame + 32, guest->BalloonColour), screenCoords);
GfxDrawSprite(&clipDpi, ImageId(animationFrame + 32, guest->BalloonColour), screenCoords);
}
// If holding umbrella
if (animationFrame >= 0x2BBD && animationFrame < 0x2BDD)
{
gfx_draw_sprite(&clipDpi, ImageId(animationFrame + 32, guest->UmbrellaColour), screenCoords);
GfxDrawSprite(&clipDpi, ImageId(animationFrame + 32, guest->UmbrellaColour), screenCoords);
}
// If wearing hat
if (animationFrame >= 0x29DD && animationFrame < 0x29FD)
{
gfx_draw_sprite(&clipDpi, ImageId(animationFrame + 32, guest->HatColour), screenCoords);
GfxDrawSprite(&clipDpi, ImageId(animationFrame + 32, guest->HatColour), screenCoords);
}
}
}
@ -754,7 +754,7 @@ private:
window_draw_viewport(&dpi, *this);
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
{
gfx_draw_sprite(&dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
GfxDrawSprite(&dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
}
}
@ -1015,7 +1015,7 @@ private:
break;
}
}
gfx_draw_sprite(&dpi, ImageId(imageId), screenCoords);
GfxDrawSprite(&dpi, ImageId(imageId), screenCoords);
}
void OnUpdateStats()
@ -1218,7 +1218,7 @@ private:
imageId += (frame_no / 4) & 0xF;
}
gfx_draw_sprite(&dpi, ImageId(imageId), screenCoords);
GfxDrawSprite(&dpi, ImageId(imageId), screenCoords);
}
void OnUpdateRides()
@ -1393,7 +1393,7 @@ private:
imageId += (frame_no / 2) & 0x7;
}
gfx_draw_sprite(&dpi, ImageId(imageId), screenCoords);
GfxDrawSprite(&dpi, ImageId(imageId), screenCoords);
}
void OnUpdateFinance()
@ -1531,7 +1531,7 @@ private:
imageId += (frame_no / 2) & 0x7;
}
gfx_draw_sprite(&dpi, ImageId(imageId), screenCoords);
GfxDrawSprite(&dpi, ImageId(imageId), screenCoords);
}
void OnUpdateThoughts()
@ -1606,7 +1606,7 @@ private:
const auto& widget = widgets[WIDX_TAB_6];
auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top };
gfx_draw_sprite(&dpi, ImageId(SPR_TAB_GUEST_INVENTORY), screenCoords);
GfxDrawSprite(&dpi, ImageId(SPR_TAB_GUEST_INVENTORY), screenCoords);
}
void OnUpdateInventory()
@ -1801,7 +1801,7 @@ private:
imageId += (frame_no / 2) & 0x3;
}
gfx_draw_sprite(&dpi, ImageId(imageId), screenCoords);
GfxDrawSprite(&dpi, ImageId(imageId), screenCoords);
}
void OnUpdateDebug()
@ -1863,7 +1863,7 @@ private:
format_string(buffer2, sizeof(buffer2), STR_PEEP_DEBUG_NEXT_SLOPE, ft2.Data());
safe_strcat(buffer, buffer2, sizeof(buffer));
}
gfx_draw_string(&dpi, screenCoords, buffer, {});
GfxDrawString(&dpi, screenCoords, buffer, {});
}
screenCoords.y += LIST_ROW_HEIGHT;
{

View File

@ -643,13 +643,13 @@ private:
// Tab 1 image
auto i = (_selectedTab == TabId::Individual ? _tabAnimationIndex & ~3 : 0);
i += GetPeepAnimation(PeepSpriteType::Normal).base_image + 1;
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(i, COLOUR_GREY, COLOUR_DARK_OLIVE_GREEN),
windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].midX(), widgets[WIDX_TAB_1].bottom - 6 });
// Tab 2 image
i = (_selectedTab == TabId::Summarised ? _tabAnimationIndex / 4 : 0);
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(SPR_TAB_GUESTS_0 + i),
windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top });
}
@ -686,11 +686,11 @@ private:
{
case GuestViewType::Actions:
// Guest face
gfx_draw_sprite(&dpi, ImageId(get_peep_face_sprite_small(peep)), { 118, y + 1 });
GfxDrawSprite(&dpi, ImageId(get_peep_face_sprite_small(peep)), { 118, y + 1 });
// Tracking icon
if (peep->PeepFlags & PEEP_FLAGS_TRACKING)
gfx_draw_sprite(&dpi, ImageId(STR_ENTER_SELECTION_SIZE), { 112, y + 1 });
GfxDrawSprite(&dpi, ImageId(STR_ENTER_SELECTION_SIZE), { 112, y + 1 });
// Action
ft = Formatter();
@ -745,7 +745,7 @@ private:
// Draw guest faces
for (uint32_t j = 0; j < std::size(group.Faces) && j < group.NumGuests; j++)
{
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(group.Faces[j] + SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY),
{ static_cast<int32_t>(j) * 8, y + 12 });
}

View File

@ -161,9 +161,9 @@ public:
g1temp.width = 370;
g1temp.height = 217;
g1temp.flags = G1_FLAG_HAS_TRANSPARENCY;
gfx_set_g1_element(SPR_TEMP, &g1temp);
GfxSetG1Element(SPR_TEMP, &g1temp);
drawing_engine_invalidate_image(SPR_TEMP);
gfx_draw_sprite(&dpi, ImageId(SPR_TEMP), screenPos);
GfxDrawSprite(&dpi, ImageId(SPR_TEMP), screenPos);
screenPos = windowPos + ScreenCoordsXY{ widget->midX(), widget->bottom - 12 };

View File

@ -252,7 +252,7 @@ public:
{
screenCoords = { windowPos.x + previewWidget->left, windowPos.y + previewWidget->top };
auto sprite = ImageId(gLandToolSize % 2 == 0 ? SPR_G2_MOUNTAIN_TOOL_EVEN : SPR_G2_MOUNTAIN_TOOL_ODD);
gfx_draw_sprite(&dpi, sprite, screenCoords);
GfxDrawSprite(&dpi, sprite, screenCoords);
WidgetDraw(&dpi, *this, WIDX_DECREMENT);
WidgetDraw(&dpi, *this, WIDX_INCREMENT);
}
@ -334,7 +334,7 @@ private:
void DrawDropdownButton(rct_drawpixelinfo& dpi, WidgetIndex widgetIndex, ImageId image)
{
const auto& widget = widgets[widgetIndex];
gfx_draw_sprite(&dpi, image, { windowPos.x + widget.left, windowPos.y + widget.top });
GfxDrawSprite(&dpi, image, { windowPos.x + widget.left, windowPos.y + widget.top });
}
};

View File

@ -673,7 +673,7 @@ public:
// Check how this date is represented (e.g. 2000-02-20, or 00/02/20)
std::string date = Platform::FormatShortDate(long_time);
maxDateWidth = gfx_get_string_width(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP;
maxDateWidth = GfxGetStringWidth(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP;
// Some locales do not use leading zeros for months and days, so let's try October, too.
tm.tm_mon = 10;
@ -682,11 +682,11 @@ public:
// Again, check how this date is represented (e.g. 2000-10-20, or 00/10/20)
date = Platform::FormatShortDate(long_time);
maxDateWidth = std::max(maxDateWidth, gfx_get_string_width(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP);
maxDateWidth = std::max(maxDateWidth, GfxGetStringWidth(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP);
// Time appears to be universally represented with two digits for minutes, so 12:00 or 00:00 should be representable.
std::string time = Platform::FormatTime(long_time);
maxTimeWidth = gfx_get_string_width(time.c_str(), FontStyle::Medium) + DATE_TIME_GAP;
maxTimeWidth = GfxGetStringWidth(time.c_str(), FontStyle::Medium) + DATE_TIME_GAP;
}
void SortList()
@ -744,7 +744,7 @@ public:
if (_shortenedDirectory[0] == '\0')
{
shorten_path(_shortenedDirectory, sizeof(_shortenedDirectory), _directory, width - 8, FontStyle::Medium);
ShortenPath(_shortenedDirectory, sizeof(_shortenedDirectory), _directory, width - 8, FontStyle::Medium);
}
// Format text

View File

@ -713,9 +713,9 @@ public:
g1temp.height = MAP_WINDOW_MAP_SIZE;
g1temp.x_offset = -8;
g1temp.y_offset = -8;
gfx_set_g1_element(SPR_TEMP, &g1temp);
GfxSetG1Element(SPR_TEMP, &g1temp);
drawing_engine_invalidate_image(SPR_TEMP);
gfx_draw_sprite(&dpi, ImageId(SPR_TEMP), { 0, 0 });
GfxDrawSprite(&dpi, ImageId(SPR_TEMP), { 0, 0 });
if (selected_tab == PAGE_PEEPS)
{
@ -875,7 +875,7 @@ public:
screenCoords = windowPos
+ ScreenCoordsXY{ widgets[WIDX_PEOPLE_STARTING_POSITION].left + 12,
widgets[WIDX_PEOPLE_STARTING_POSITION].top + 18 };
gfx_draw_sprite(&dpi, ImageId(SPR_6410, COLOUR_BRIGHT_RED, COLOUR_LIGHT_BROWN), screenCoords);
GfxDrawSprite(&dpi, ImageId(SPR_6410, COLOUR_BRIGHT_RED, COLOUR_LIGHT_BROWN), screenCoords);
}
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode)
@ -1282,7 +1282,7 @@ private:
if (selected_tab == PAGE_PEEPS)
guestTabImage += list_information_type / 4;
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(guestTabImage),
windowPos + ScreenCoordsXY{ widgets[WIDX_PEOPLE_TAB].left, widgets[WIDX_PEOPLE_TAB].top });
@ -1291,7 +1291,7 @@ private:
if (selected_tab == PAGE_RIDES)
rideTabImage += list_information_type / 4;
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(rideTabImage),
windowPos + ScreenCoordsXY{ widgets[WIDX_RIDES_TAB].left, widgets[WIDX_RIDES_TAB].top });
}

View File

@ -691,16 +691,16 @@ static void WindowMapgenDrawDropdownButton(rct_window* w, rct_drawpixelinfo* dpi
// Draw greyed out (light border bottom right shadow)
auto colour = w->colours[widget.colour];
colour = ColourMapA[NOT_TRANSLUCENT(colour)].lighter;
gfx_draw_sprite_solid(dpi, image, pos + ScreenCoordsXY{ 1, 1 }, colour);
GfxDrawSpriteSolid(dpi, image, pos + ScreenCoordsXY{ 1, 1 }, colour);
// Draw greyed out (dark)
colour = w->colours[widget.colour];
colour = ColourMapA[NOT_TRANSLUCENT(colour)].mid_light;
gfx_draw_sprite_solid(dpi, image, pos, colour);
GfxDrawSpriteSolid(dpi, image, pos, colour);
}
else
{
gfx_draw_sprite(dpi, image, pos);
GfxDrawSprite(dpi, image, pos);
}
}
@ -1369,7 +1369,7 @@ static void WindowMapgenDrawTabImage(rct_drawpixelinfo* dpi, rct_window* w, int3
spriteIndex += (frame % TabAnimationFrames[w->page]);
}
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(spriteIndex),
w->windowPos + ScreenCoordsXY{ w->widgets[widgetIndex].left, w->widgets[widgetIndex].top });
}

View File

@ -344,7 +344,7 @@ static ScreenCoordsXY WindowMultiplayerInformationGetSize()
// Server name is displayed word-wrapped, so figure out how high it will be.
{
u8string buffer = network_get_server_name();
gfx_wrap_string(buffer.data(), width, FontStyle::Medium, &numLines);
GfxWrapString(buffer.data(), width, FontStyle::Medium, &numLines);
height += ++numLines * lineHeight + (LIST_ROW_HEIGHT / 2);
}
@ -353,7 +353,7 @@ static ScreenCoordsXY WindowMultiplayerInformationGetSize()
if (!descString.empty())
{
u8string buffer = descString;
gfx_wrap_string(buffer.data(), width, FontStyle::Medium, &numLines);
GfxWrapString(buffer.data(), width, FontStyle::Medium, &numLines);
height += ++numLines * lineHeight + (LIST_ROW_HEIGHT / 2);
}
@ -617,8 +617,8 @@ static void WindowMultiplayerPlayersScrollpaint(rct_window* w, rct_drawpixelinfo
_buffer += network_get_player_name(player);
}
screenCoords.x = 0;
gfx_clip_string(_buffer.data(), 230, FontStyle::Medium);
gfx_draw_string(dpi, screenCoords, _buffer.c_str(), { colour });
GfxClipString(_buffer.data(), 230, FontStyle::Medium);
GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour });
// Draw group name
_buffer.resize(0);
@ -628,8 +628,8 @@ static void WindowMultiplayerPlayersScrollpaint(rct_window* w, rct_drawpixelinfo
_buffer += "{BLACK}";
screenCoords.x = 173;
_buffer += network_get_group_name(group);
gfx_clip_string(_buffer.data(), 80, FontStyle::Medium);
gfx_draw_string(dpi, screenCoords, _buffer.c_str(), { colour });
GfxClipString(_buffer.data(), 80, FontStyle::Medium);
GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour });
}
// Draw last action
@ -666,7 +666,7 @@ static void WindowMultiplayerPlayersScrollpaint(rct_window* w, rct_drawpixelinfo
_buffer += pingBuffer;
screenCoords.x = 356;
gfx_draw_string(dpi, screenCoords, _buffer.c_str(), { colour });
GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour });
}
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
listPosition++;
@ -918,7 +918,7 @@ static void WindowMultiplayerGroupsScrollpaint(rct_window* w, rct_drawpixelinfo*
if (network_can_perform_action(groupindex, static_cast<NetworkPermission>(i)))
{
screenCoords.x = 0;
gfx_draw_string(dpi, screenCoords, u8"{WINDOW_COLOUR_2}✓", {});
GfxDrawString(dpi, screenCoords, u8"{WINDOW_COLOUR_2}✓", {});
}
}
@ -1017,7 +1017,7 @@ static void WindowMultiplayerDrawTabImage(rct_window* w, rct_drawpixelinfo* dpi,
}
}
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(spriteIndex),
w->windowPos + ScreenCoordsXY{ w->widgets[widgetIndex].left, w->widgets[widgetIndex].top });
}

View File

@ -103,10 +103,10 @@ public:
thread_local std::string _buffer;
_buffer.assign("{BLACK}");
_buffer += _windowNetworkStatusText;
gfx_clip_string(_buffer.data(), widgets[WIDX_BACKGROUND].right - 50, FontStyle::Medium);
GfxClipString(_buffer.data(), widgets[WIDX_BACKGROUND].right - 50, FontStyle::Medium);
ScreenCoordsXY screenCoords(windowPos.x + (width / 2), windowPos.y + (height / 2));
screenCoords.x -= gfx_get_string_width(_buffer, FontStyle::Medium) / 2;
gfx_draw_string(&dpi, screenCoords, _buffer.c_str());
screenCoords.x -= GfxGetStringWidth(_buffer, FontStyle::Medium) / 2;
GfxDrawString(&dpi, screenCoords, _buffer.c_str());
}
void SetCloseCallBack(close_callback onClose)

View File

@ -386,7 +386,7 @@ public:
const auto& ls = OpenRCT2::GetContext()->GetLocalisationService();
auto string = ls.GetString(STR_GROUP_BY_TRACK_TYPE);
auto strWidth = gfx_get_string_width(string, FontStyle::Medium);
auto strWidth = GfxGetStringWidth(string, FontStyle::Medium);
auto localizedGroupByTrackTypeWidth = strWidth + 14;
widgets[WIDX_GROUP_BY_TRACK_TYPE].left = width - 8 - localizedGroupByTrackTypeWidth;
}
@ -473,7 +473,7 @@ public:
// Draw ride image with feathered border
auto mask = ImageId(SPR_NEW_RIDE_MASK);
auto rideImage = ImageId(GetRideImage(*listItem));
gfx_draw_sprite_raw_masked(&dpi, coords + ScreenCoordsXY{ 2, 2 }, mask, rideImage);
GfxDrawSpriteRawMasked(&dpi, coords + ScreenCoordsXY{ 2, 2 }, mask, rideImage);
// Next position
coords.x += 116;
@ -890,7 +890,7 @@ private:
spriteIndex += tab == THRILL_TAB ? ThrillRidesTabAnimationSequence[frame] : frame;
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(spriteIndex, colours[1]),
windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top });
}

View File

@ -226,7 +226,7 @@ public:
switch (newsItem.Type)
{
case News::ItemType::Ride:
gfx_draw_sprite(&dpi, ImageId(SPR_RIDE), screenCoords);
GfxDrawSprite(&dpi, ImageId(SPR_RIDE), screenCoords);
break;
case News::ItemType::Peep:
case News::ItemType::PeepOnRide:
@ -260,24 +260,24 @@ public:
ImageIndex imageId = GetPeepAnimation(spriteType).base_image + 1;
auto image = ImageId(imageId, peep->TshirtColour, peep->TrousersColour);
gfx_draw_sprite(&cliped_dpi, image, clipCoords);
GfxDrawSprite(&cliped_dpi, image, clipCoords);
break;
}
case News::ItemType::Money:
case News::ItemType::Campaign:
gfx_draw_sprite(&dpi, ImageId(SPR_FINANCE), screenCoords);
GfxDrawSprite(&dpi, ImageId(SPR_FINANCE), screenCoords);
break;
case News::ItemType::Research:
gfx_draw_sprite(&dpi, ImageId(newsItem.Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords);
GfxDrawSprite(&dpi, ImageId(newsItem.Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords);
break;
case News::ItemType::Peeps:
gfx_draw_sprite(&dpi, ImageId(SPR_GUESTS), screenCoords);
GfxDrawSprite(&dpi, ImageId(SPR_GUESTS), screenCoords);
break;
case News::ItemType::Award:
gfx_draw_sprite(&dpi, ImageId(SPR_AWARD), screenCoords);
GfxDrawSprite(&dpi, ImageId(SPR_AWARD), screenCoords);
break;
case News::ItemType::Graph:
gfx_draw_sprite(&dpi, ImageId(SPR_GRAPH), screenCoords);
GfxDrawSprite(&dpi, ImageId(SPR_GRAPH), screenCoords);
break;
case News::ItemType::Null:
case News::ItemType::Blank:
@ -299,7 +299,7 @@ public:
press = 0x20;
}
GfxFillRectInset(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press);
gfx_draw_sprite(&dpi, ImageId(SPR_LOCATE), screenCoords);
GfxDrawSprite(&dpi, ImageId(SPR_LOCATE), screenCoords);
}
y += itemHeight;

View File

@ -242,7 +242,7 @@ private:
}
const auto& widget = widgets[widgetIndex];
gfx_draw_sprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget.left, widget.top });
GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget.left, widget.top });
}
}

View File

@ -534,7 +534,7 @@ public:
auto name = entry.GetName();
char buffer[256];
String::Set(buffer, sizeof(buffer), name.data(), name.size());
gfx_draw_string(&dpi, screenCoords, buffer, { COLOUR_DARK_GREEN });
GfxDrawString(&dpi, screenCoords, buffer, { COLOUR_DARK_GREEN });
if (entry.Generation == ObjectGeneration::DAT)
{

View File

@ -963,7 +963,7 @@ private:
gConfigGeneral.UpperCaseBanners ^= 1;
ConfigSaveDefault();
Invalidate();
scrolling_text_invalidate();
ScrollingTextInvalidate();
break;
case WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX:
gConfigGeneral.DisableLightningEffect ^= 1;
@ -2095,7 +2095,7 @@ private:
}
// Draw normal, enabled sprite.
gfx_draw_sprite(dpi, ImageId(spriteIndex), screenCoords);
GfxDrawSprite(dpi, ImageId(spriteIndex), screenCoords);
}
else
{
@ -2103,11 +2103,11 @@ private:
uint8_t window_colour = NOT_TRANSLUCENT(colours[widget->colour]);
// Draw greyed out (light border bottom right shadow)
gfx_draw_sprite_solid(
GfxDrawSpriteSolid(
dpi, ImageId(spriteIndex), screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[window_colour].lighter);
// Draw greyed out (dark)
gfx_draw_sprite_solid(dpi, ImageId(spriteIndex), screenCoords, ColourMapA[window_colour].mid_light);
GfxDrawSpriteSolid(dpi, ImageId(spriteIndex), screenCoords, ColourMapA[window_colour].mid_light);
}
}

View File

@ -595,7 +595,7 @@ private:
{
window_draw_viewport(&dpi, *this);
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
gfx_draw_sprite(&dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
GfxDrawSprite(&dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
}
// Draw park closed / open label
@ -1161,7 +1161,7 @@ private:
for (const auto& award : GetAwards())
{
gfx_draw_sprite(&dpi, ImageId(_parkAwards[EnumValue(award.Type)].sprite), screenCoords);
GfxDrawSprite(&dpi, ImageId(_parkAwards[EnumValue(award.Type)].sprite), screenCoords);
DrawTextWrapped(&dpi, screenCoords + ScreenCoordsXY{ 34, 6 }, 180, _parkAwards[EnumValue(award.Type)].text);
screenCoords.y += 32;
@ -1218,7 +1218,7 @@ private:
// Entrance tab
if (!WidgetIsDisabled(*this, WIDX_TAB_1))
{
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(SPR_TAB_PARK_ENTRANCE),
windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top });
}
@ -1229,11 +1229,11 @@ private:
ImageId spriteIdx(SPR_TAB_GRAPH_0);
if (page == WINDOW_PARK_PAGE_RATING)
spriteIdx = spriteIdx.WithIndexOffset((frame_no / 8) % 8);
gfx_draw_sprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top });
gfx_draw_sprite(
GfxDrawSprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top });
GfxDrawSprite(
&dpi, ImageId(SPR_RATING_HIGH),
windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left + 7, widgets[WIDX_TAB_2].top + 1 });
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(SPR_RATING_LOW),
windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left + 16, widgets[WIDX_TAB_2].top + 12 });
}
@ -1244,13 +1244,13 @@ private:
ImageId spriteIdx(SPR_TAB_GRAPH_0);
if (page == WINDOW_PARK_PAGE_GUESTS)
spriteIdx = spriteIdx.WithIndexOffset((frame_no / 8) % 8);
gfx_draw_sprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top });
GfxDrawSprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top });
ImageId peepImage(GetPeepAnimation(PeepSpriteType::Normal).base_image + 1, COLOUR_BRIGHT_RED, COLOUR_TEAL);
if (page == WINDOW_PARK_PAGE_GUESTS)
peepImage = peepImage.WithIndexOffset(_peepAnimationFrame & 0xFFFFFFFC);
gfx_draw_sprite(
GfxDrawSprite(
&dpi, peepImage, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].midX(), widgets[WIDX_TAB_3].bottom - 9 });
}
@ -1260,7 +1260,7 @@ private:
ImageId spriteIdx(SPR_TAB_ADMISSION_0);
if (page == WINDOW_PARK_PAGE_PRICE)
spriteIdx = spriteIdx.WithIndexOffset((frame_no / 2) % 8);
gfx_draw_sprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top });
GfxDrawSprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top });
}
// Statistics tab
@ -1269,7 +1269,7 @@ private:
ImageId spriteIdx(SPR_TAB_STATS_0);
if (page == WINDOW_PARK_PAGE_STATS)
spriteIdx = spriteIdx.WithIndexOffset((frame_no / 4) % 7);
gfx_draw_sprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_5].left, widgets[WIDX_TAB_5].top });
GfxDrawSprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_5].left, widgets[WIDX_TAB_5].top });
}
// Objective tab
@ -1278,13 +1278,13 @@ private:
ImageId spriteIdx(SPR_TAB_OBJECTIVE_0);
if (page == WINDOW_PARK_PAGE_OBJECTIVE)
spriteIdx = spriteIdx.WithIndexOffset((frame_no / 4) % 16);
gfx_draw_sprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_6].left, widgets[WIDX_TAB_6].top });
GfxDrawSprite(&dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_6].left, widgets[WIDX_TAB_6].top });
}
// Awards tab
if (!WidgetIsDisabled(*this, WIDX_TAB_7))
{
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(SPR_TAB_AWARDS), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_7].left, widgets[WIDX_TAB_7].top });
}
}

View File

@ -336,7 +336,7 @@ void WindowPlayerOverviewPaint(rct_window* w, rct_drawpixelinfo* dpi)
DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft);
char ping[64];
snprintf(ping, 64, "%d ms", network_get_player_ping(player));
gfx_draw_string(dpi, screenCoords + ScreenCoordsXY(30, 0), ping, { w->colours[2] });
GfxDrawString(dpi, screenCoords + ScreenCoordsXY(30, 0), ping, { w->colours[2] });
// Draw last action
screenCoords = w->windowPos + ScreenCoordsXY{ w->width / 2, w->height - 13 };
@ -547,7 +547,7 @@ static void WindowPlayerDrawTabImages(rct_drawpixelinfo* dpi, rct_window* w)
{
widget = &w->widgets[WIDX_TAB_1];
auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top };
gfx_draw_sprite(dpi, ImageId(SPR_PEEP_LARGE_FACE_NORMAL), screenCoords);
GfxDrawSprite(dpi, ImageId(SPR_PEEP_LARGE_FACE_NORMAL), screenCoords);
}
// Tab 2
@ -562,7 +562,7 @@ static void WindowPlayerDrawTabImages(rct_drawpixelinfo* dpi, rct_window* w)
imageId += (w->frame_no / 2) & 7;
}
gfx_draw_sprite(dpi, ImageId(imageId), screenCoords);
GfxDrawSprite(dpi, ImageId(imageId), screenCoords);
}
}

View File

@ -607,7 +607,7 @@ static void WindowResearchDrawTabImage(rct_drawpixelinfo* dpi, rct_window* w, in
spriteIndex += frame;
}
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(spriteIndex),
w->windowPos + ScreenCoordsXY{ w->widgets[widgetIndex].left, w->widgets[widgetIndex].top });
}

View File

@ -875,7 +875,7 @@ static void WindowRideDrawTabImage(rct_drawpixelinfo* dpi, rct_window* w, int32_
}
const auto& widget = w->widgets[widgetIndex];
gfx_draw_sprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top });
GfxDrawSprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top });
}
}
@ -912,7 +912,7 @@ static void WindowRideDrawTabMain(rct_drawpixelinfo* dpi, rct_window* w)
}
const auto& widget = w->widgets[widgetIndex];
gfx_draw_sprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top });
GfxDrawSprite(dpi, ImageId(spriteIndex), w->windowPos + ScreenCoordsXY{ widget.left, widget.top });
}
}
}
@ -984,7 +984,7 @@ static void WindowRideDrawTabVehicle(rct_drawpixelinfo* dpi, rct_window* w)
imageIndex *= carEntry->base_num_frames;
imageIndex += carEntry->base_image_id;
auto imageId = ImageId(imageIndex, vehicleColour.Body, vehicleColour.Trim, vehicleColour.Tertiary);
gfx_draw_sprite(&clipDPI, imageId, screenCoords);
GfxDrawSprite(&clipDPI, imageId, screenCoords);
}
}
@ -1005,7 +1005,7 @@ static void WindowRideDrawTabCustomer(rct_drawpixelinfo* dpi, rct_window* w)
spriteIndex += GetPeepAnimation(PeepSpriteType::Normal).base_image + 1;
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(spriteIndex, COLOUR_BRIGHT_RED, COLOUR_TEAL),
w->windowPos + ScreenCoordsXY{ widget.midX(), widget.bottom - 6 });
}
@ -2571,7 +2571,7 @@ static void WindowRideMainPaint(rct_window* w, rct_drawpixelinfo* dpi)
{
window_draw_viewport(dpi, *w);
if (w->viewport->flags & VIEWPORT_FLAG_SOUND_ON)
gfx_draw_sprite(dpi, ImageId(SPR_HEARING_VIEWPORT), w->windowPos + ScreenCoordsXY{ 2, 2 });
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), w->windowPos + ScreenCoordsXY{ 2, 2 });
}
// View dropdown
@ -3018,7 +3018,7 @@ static void WindowRideVehicleScrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
VehicleDrawInfo* current = nextSpriteToDraw;
while (--current >= trainCarImages)
gfx_draw_sprite(dpi, current->imageId, { current->x, current->y });
GfxDrawSprite(dpi, current->imageId, { current->x, current->y });
startX += 36;
}
@ -4112,7 +4112,7 @@ static void WindowRideMaintenancePaint(rct_window* w, rct_drawpixelinfo* dpi)
Widget* widget = &window_ride_maintenance_widgets[WIDX_LOCATE_MECHANIC];
auto screenCoords = w->windowPos + ScreenCoordsXY{ widget->left, widget->top };
auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, gStaffMechanicColour);
gfx_draw_sprite(dpi, image, screenCoords);
GfxDrawSprite(dpi, image, screenCoords);
// Inspection label
widget = &window_ride_maintenance_widgets[WIDX_INSPECTION_INTERVAL];
@ -4891,7 +4891,7 @@ static void WindowRideColourPaint(rct_window* w, rct_drawpixelinfo* dpi)
const auto& rtd = ride->GetRideTypeDescriptor();
if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
{
gfx_draw_sprite(dpi, ImageId(MazeOptions[trackColour.supports].sprite), screenCoords);
GfxDrawSprite(dpi, ImageId(MazeOptions[trackColour.supports].sprite), screenCoords);
}
else
{
@ -4899,14 +4899,14 @@ static void WindowRideColourPaint(rct_window* w, rct_drawpixelinfo* dpi)
int32_t spriteIndex = typeDescriptor.ColourPreview.Track;
if (spriteIndex != 0)
{
gfx_draw_sprite(dpi, ImageId(spriteIndex, trackColour.main, trackColour.additional), screenCoords);
GfxDrawSprite(dpi, ImageId(spriteIndex, trackColour.main, trackColour.additional), screenCoords);
}
// Supports
spriteIndex = typeDescriptor.ColourPreview.Supports;
if (spriteIndex != 0)
{
gfx_draw_sprite(dpi, ImageId(spriteIndex, trackColour.supports), screenCoords);
GfxDrawSprite(dpi, ImageId(spriteIndex, trackColour.supports), screenCoords);
}
}
}
@ -4930,11 +4930,11 @@ static void WindowRideColourPaint(rct_window* w, rct_drawpixelinfo* dpi)
}
}
gfx_draw_sprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, spriteColour), screenCoords);
GfxDrawSprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, spriteColour), screenCoords);
}
else
{
gfx_draw_sprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, ride->track_colour[0].main), screenCoords);
GfxDrawSprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, ride->track_colour[0].main), screenCoords);
}
}
@ -4956,16 +4956,16 @@ static void WindowRideColourPaint(rct_window* w, rct_drawpixelinfo* dpi)
auto imageId = ImageId(stationObj->BaseImageId, trackColour.main, trackColour.additional);
// Back
gfx_draw_sprite(&clippedDpi, imageId, { 34, 20 });
GfxDrawSprite(&clippedDpi, imageId, { 34, 20 });
// Front
gfx_draw_sprite(&clippedDpi, imageId.WithIndexOffset(4), { 34, 20 });
GfxDrawSprite(&clippedDpi, imageId.WithIndexOffset(4), { 34, 20 });
// Glass
if (stationObj->Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT)
{
auto glassImageId = ImageId(stationObj->BaseImageId + 20).WithTransparency(trackColour.main);
gfx_draw_sprite(&clippedDpi, glassImageId, { 34, 20 });
GfxDrawSprite(&clippedDpi, glassImageId, { 34, 20 });
}
}
}
@ -5013,7 +5013,7 @@ static void WindowRideColourScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
imageIndex *= carEntry->base_num_frames;
imageIndex += carEntry->base_image_id;
auto imageId = ImageId(imageIndex, vehicleColour.Body, vehicleColour.Trim, vehicleColour.Tertiary);
gfx_draw_sprite(dpi, imageId, screenCoords);
GfxDrawSprite(dpi, imageId, screenCoords);
}
#pragma endregion

View File

@ -747,21 +747,21 @@ private:
sprite_idx = SPR_TAB_RIDE_0;
if (page == PAGE_RIDES)
sprite_idx += frame_no / 4;
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top });
// Shops and stalls tab
sprite_idx = SPR_TAB_SHOPS_AND_STALLS_0;
if (page == PAGE_SHOPS_AND_STALLS)
sprite_idx += frame_no / 4;
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top });
// Information kiosks and facilities tab
sprite_idx = SPR_TAB_KIOSKS_AND_FACILITIES_0;
if (page == PAGE_KIOSKS_AND_FACILITIES)
sprite_idx += (frame_no / 4) % 8;
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top });
}

View File

@ -485,7 +485,7 @@ static void WindowScenarioselectPaint(rct_window* w, rct_drawpixelinfo* dpi)
{
utf8 path[MAX_PATH];
shorten_path(path, sizeof(path), scenario->path, w->width - 6 - TabWidth, FontStyle::Medium);
ShortenPath(path, sizeof(path), scenario->path, w->width - 6 - TabWidth, FontStyle::Medium);
const utf8* pathPtr = path;
auto ft = Formatter();
@ -618,7 +618,7 @@ static void WindowScenarioselectScrollpaint(rct_window* w, rct_drawpixelinfo* dp
if (isCompleted)
{
// Draw completion tick
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(SPR_MENU_CHECKMARK),
{ window_scenarioselect_widgets[WIDX_SCENARIOLIST].width() - 45, y + 1 });
@ -660,7 +660,7 @@ static void DrawCategoryHeading(
utf8 buffer[CommonTextBufferSize];
auto bufferPtr = buffer;
format_string(bufferPtr, sizeof(buffer), stringId, nullptr);
int32_t categoryStringHalfWidth = (gfx_get_string_width(bufferPtr, FontStyle::Medium) / 2) + 4;
int32_t categoryStringHalfWidth = (GfxGetStringWidth(bufferPtr, FontStyle::Medium) / 2) + 4;
int32_t strLeft = centreX - categoryStringHalfWidth;
int32_t strRight = centreX + categoryStringHalfWidth;

View File

@ -1179,7 +1179,7 @@ private:
{
auto imageOffset = tabIndex == _activeTabIndex ? 1 : 0;
auto imageId = ImageId(scgEntry->image + imageOffset, colours[1]);
gfx_draw_sprite(&dpi, imageId, offset + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top });
GfxDrawSprite(&dpi, imageId, offset + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top });
}
}
}
@ -1190,8 +1190,8 @@ private:
{
auto bannerEntry = GetBannerEntry(scenerySelection.EntryIndex);
auto imageId = ImageId(bannerEntry->image + gWindowSceneryRotation * 2, gWindowSceneryPrimaryColour);
gfx_draw_sprite(&dpi, imageId, { 33, 40 });
gfx_draw_sprite(&dpi, imageId.WithIndexOffset(1), { 33, 40 });
GfxDrawSprite(&dpi, imageId, { 33, 40 });
GfxDrawSprite(&dpi, imageId.WithIndexOffset(1), { 33, 40 });
}
else if (scenerySelection.SceneryType == SCENERY_TYPE_LARGE)
{
@ -1203,7 +1203,7 @@ private:
imageId = imageId.WithSecondary(gWindowScenerySecondaryColour);
if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_TERTIARY_COLOUR)
imageId = imageId.WithTertiary(gWindowSceneryTertiaryColour);
gfx_draw_sprite(&dpi, imageId, { 33, 0 });
GfxDrawSprite(&dpi, imageId, { 33, 0 });
}
else if (scenerySelection.SceneryType == SCENERY_TYPE_WALL)
{
@ -1217,10 +1217,10 @@ private:
{
imageId = imageId.WithSecondary(gWindowScenerySecondaryColour);
}
gfx_draw_sprite(&dpi, imageId, { 47, spriteTop });
GfxDrawSprite(&dpi, imageId, { 47, spriteTop });
auto glassImageId = ImageId(wallEntry->image + 6).WithTransparency(gWindowSceneryPrimaryColour);
gfx_draw_sprite(&dpi, glassImageId, { 47, spriteTop });
GfxDrawSprite(&dpi, glassImageId, { 47, spriteTop });
}
else
{
@ -1233,11 +1233,11 @@ private:
imageId = imageId.WithTertiary(gWindowSceneryTertiaryColour);
}
}
gfx_draw_sprite(&dpi, imageId, { 47, spriteTop });
GfxDrawSprite(&dpi, imageId, { 47, spriteTop });
if (wallEntry->flags & WALL_SCENERY_IS_DOOR)
{
gfx_draw_sprite(&dpi, imageId.WithIndexOffset(1), { 47, spriteTop });
GfxDrawSprite(&dpi, imageId.WithIndexOffset(1), { 47, spriteTop });
}
}
}
@ -1245,7 +1245,7 @@ private:
{
auto* pathBitEntry = GetFootpathItemEntry(scenerySelection.EntryIndex);
auto imageId = ImageId(pathBitEntry->image);
gfx_draw_sprite(&dpi, imageId, { 11, 16 });
GfxDrawSprite(&dpi, imageId, { 11, 16 });
}
else
{
@ -1270,19 +1270,19 @@ private:
spriteTop -= 12;
}
gfx_draw_sprite(&dpi, imageId, { 32, spriteTop });
GfxDrawSprite(&dpi, imageId, { 32, spriteTop });
if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS))
{
imageId = ImageId(sceneryEntry->image + 4 + gWindowSceneryRotation)
.WithTransparency(gWindowSceneryPrimaryColour);
gfx_draw_sprite(&dpi, imageId, { 32, spriteTop });
GfxDrawSprite(&dpi, imageId, { 32, spriteTop });
}
if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED_FG))
{
imageId = ImageId(sceneryEntry->image + 4 + gWindowSceneryRotation);
gfx_draw_sprite(&dpi, imageId, { 32, spriteTop });
GfxDrawSprite(&dpi, imageId, { 32, spriteTop });
}
}
}

View File

@ -437,7 +437,7 @@ static void WindowServerListScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
{
snprintf(players, sizeof(players), "%d/%d", serverDetails.Players, serverDetails.MaxPlayers);
}
const int16_t numPlayersStringWidth = gfx_get_string_width(players, FontStyle::Medium);
const int16_t numPlayersStringWidth = GfxGetStringWidth(players, FontStyle::Medium);
// How much space we have for the server info depends on the size of everything rendered after.
const int16_t spaceAvailableForInfo = width - numPlayersStringWidth - SCROLLBAR_WIDTH - 35;
@ -470,20 +470,20 @@ static void WindowServerListScrollpaint(rct_window* w, rct_drawpixelinfo* dpi, i
bool correctVersion = serverDetails.Version == network_get_version();
compatibilitySpriteId = correctVersion ? SPR_G2_RCT1_OPEN_BUTTON_2 : SPR_G2_RCT1_CLOSE_BUTTON_2;
}
gfx_draw_sprite(dpi, ImageId(compatibilitySpriteId), { right, screenCoords.y + 1 });
GfxDrawSprite(dpi, ImageId(compatibilitySpriteId), { right, screenCoords.y + 1 });
right -= 4;
// Draw lock icon
right -= 8;
if (serverDetails.RequiresPassword)
{
gfx_draw_sprite(dpi, ImageId(SPR_G2_LOCKED), { right, screenCoords.y + 4 });
GfxDrawSprite(dpi, ImageId(SPR_G2_LOCKED), { right, screenCoords.y + 4 });
}
right -= 6;
// Draw number of players
screenCoords.x = right - numPlayersStringWidth;
gfx_draw_string(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, players, { w->colours[1] });
GfxDrawString(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, players, { w->colours[1] });
screenCoords.y += ITEM_HEIGHT;
}

View File

@ -492,7 +492,7 @@ private:
}
const auto& widget = widgets[widgetIndex];
gfx_draw_sprite(&dpi, ImageId(imageId), windowPos + ScreenCoordsXY{ widget.left, widget.top });
GfxDrawSprite(&dpi, ImageId(imageId), windowPos + ScreenCoordsXY{ widget.left, widget.top });
}
}
}

View File

@ -523,7 +523,7 @@ private:
if (viewport->flags & VIEWPORT_FLAG_SOUND_ON)
{
gfx_draw_sprite(dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), windowPos + ScreenCoordsXY{ 2, 2 });
}
}
@ -581,7 +581,7 @@ private:
}
imageIndex += offset;
gfx_draw_sprite(&clip_dpi, ImageId(imageIndex, staff->TshirtColour, staff->TrousersColour), screenCoords);
GfxDrawSprite(&clip_dpi, ImageId(imageIndex, staff->TshirtColour, staff->TrousersColour), screenCoords);
}
void OverviewResize()
@ -1217,7 +1217,7 @@ private:
}
// Draw normal, enabled sprite.
gfx_draw_sprite(dpi, ImageId(baseImageId), screenCoords);
GfxDrawSprite(dpi, ImageId(baseImageId), screenCoords);
}
}

View File

@ -414,7 +414,7 @@ public:
// True if a patrol path is set for the worker
if (peep->HasPatrolArea())
{
gfx_draw_sprite(&dpi, ImageId(SPR_STAFF_PATROL_PATH), { nameColumnSize + 5, y });
GfxDrawSprite(&dpi, ImageId(SPR_STAFF_PATROL_PATH), { nameColumnSize + 5, y });
}
auto staffOrderIcon_x = nameColumnSize + 20;
@ -427,7 +427,7 @@ public:
{
if (staffOrders & 1)
{
gfx_draw_sprite(&dpi, ImageId(staffOrderSprite), { staffOrderIcon_x, y });
GfxDrawSprite(&dpi, ImageId(staffOrderSprite), { staffOrderIcon_x, y });
}
staffOrders = staffOrders >> 1;
staffOrderIcon_x += 9;
@ -437,7 +437,7 @@ public:
}
else
{
gfx_draw_sprite(&dpi, ImageId(GetEntertainerCostumeSprite(peep->SpriteType)), { staffOrderIcon_x, y });
GfxDrawSprite(&dpi, ImageId(GetEntertainerCostumeSprite(peep->SpriteType)), { staffOrderIcon_x, y });
}
}
@ -556,7 +556,7 @@ private:
const auto& widget = widgets[widgetIndex];
auto imageId = (_selectedTab == tabIndex ? (_tabAnimationIndex & ~3) : 0);
imageId += GetPeepAnimation(type).base_image + 1;
gfx_draw_sprite(
GfxDrawSprite(
&dpi, ImageId(imageId, colour), windowPos + ScreenCoordsXY{ (widget.left + widget.right) / 2, widget.bottom - 6 });
}
@ -571,7 +571,7 @@ private:
{
auto imageId = (_selectedTab == 3 ? (_tabAnimationIndex & ~3) : 0);
imageId += GetPeepAnimation(type).base_image + 1;
gfx_draw_sprite(&clippedDpi, ImageId(imageId), { 15, 23 });
GfxDrawSprite(&clippedDpi, ImageId(imageId), { 15, 23 });
}
}

View File

@ -223,7 +223,7 @@ public:
// String length needs to add 12 either side of box
// +13 for cursor when max length.
gfx_wrap_string(wrapped_string, WW - (24 + 13), FontStyle::Medium, &no_lines);
GfxWrapString(wrapped_string, WW - (24 + 13), FontStyle::Medium, &no_lines);
GfxFillRectInset(
&dpi, { { windowPos.x + 10, screenCoords.y }, { windowPos.x + WW - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } },
@ -240,7 +240,7 @@ public:
for (int32_t line = 0; line <= no_lines; line++)
{
screenCoords.x = windowPos.x + 12;
gfx_draw_string_no_formatting(&dpi, screenCoords, wrap_pointer, { colours[1], FontStyle::Medium });
GfxDrawStringNoFormatting(&dpi, screenCoords, wrap_pointer, { colours[1], FontStyle::Medium });
size_t string_length = get_string_size(wrap_pointer) - 1;
@ -249,7 +249,7 @@ public:
// Make a copy of the string for measuring the width.
char temp_string[TEXT_INPUT_SIZE] = { 0 };
std::memcpy(temp_string, wrap_pointer, gTextInput->SelectionStart - char_count);
cursorX = windowPos.x + 13 + gfx_get_string_width_no_formatting(temp_string, FontStyle::Medium);
cursorX = windowPos.x + 13 + GfxGetStringWidthNoFormatting(temp_string, FontStyle::Medium);
cursorY = screenCoords.y;
int32_t textWidth = 6;
@ -260,7 +260,7 @@ public:
utf8 tmp[5] = { 0 }; // This is easier than setting temp_string[0..5]
uint32_t codepoint = utf8_get_next(_buffer.data() + gTextInput->SelectionStart, nullptr);
utf8_write_codepoint(tmp, codepoint);
textWidth = std::max(gfx_get_string_width_no_formatting(tmp, FontStyle::Medium) - 2, 4);
textWidth = std::max(GfxGetStringWidthNoFormatting(tmp, FontStyle::Medium) - 2, 4);
}
if (_cursorBlink > 15)
@ -310,14 +310,14 @@ public:
// String length needs to add 12 either side of box +13 for cursor when max length.
int32_t numLines{};
gfx_wrap_string(wrappedString.data(), WW - (24 + 13), FontStyle::Medium, &numLines);
GfxWrapString(wrappedString.data(), WW - (24 + 13), FontStyle::Medium, &numLines);
return numLines * 10 + WH;
}
private:
static void DrawIMEComposition(rct_drawpixelinfo& dpi, int32_t cursorX, int32_t cursorY)
{
int compositionWidth = gfx_get_string_width(gTextInput->ImeBuffer, FontStyle::Medium);
int compositionWidth = GfxGetStringWidth(gTextInput->ImeBuffer, FontStyle::Medium);
ScreenCoordsXY screenCoords(cursorX - (compositionWidth / 2), cursorY + 13);
int width = compositionWidth;
int height = 10;
@ -326,7 +326,7 @@ private:
&dpi, { screenCoords - ScreenCoordsXY{ 1, 1 }, screenCoords + ScreenCoordsXY{ width + 1, height + 1 } },
PALETTE_INDEX_12);
GfxFillRect(&dpi, { screenCoords, screenCoords + ScreenCoordsXY{ width, height } }, PALETTE_INDEX_0);
gfx_draw_string(&dpi, screenCoords, static_cast<const char*>(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN });
GfxDrawString(&dpi, screenCoords, static_cast<const char*>(gTextInput->ImeBuffer), { COLOUR_DARK_GREEN });
}
void ExecuteCallback(bool hasValue)

View File

@ -814,14 +814,14 @@ public:
const bool isPressed = (i == _colour_index_1 && j == _colour_index_2);
auto image = ImageId(
isPressed ? SPR_PALETTE_BTN_PRESSED : SPR_PALETTE_BTN, colour & ~COLOUR_FLAG_TRANSLUCENT);
gfx_draw_sprite(&dpi, image, { _button_offset_x + 12 * j, screenCoords.y + _button_offset_y });
GfxDrawSprite(&dpi, image, { _button_offset_x + 12 * j, screenCoords.y + _button_offset_y });
ScreenCoordsXY topLeft{ _button_offset_x + 12 * j, screenCoords.y + _check_offset_y };
ScreenCoordsXY bottomRight{ _button_offset_x + 12 * j + 9, screenCoords.y + _check_offset_y + 10 };
GfxFillRectInset(&dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_E0);
if (colour & COLOUR_FLAG_TRANSLUCENT)
{
gfx_draw_string(
GfxDrawString(
&dpi, topLeft, static_cast<const char*>(CheckBoxMarkString),
{ static_cast<colour_t>(colours[1] & 0x7F), FontStyle::Medium, TextDarkness::Dark });
}
@ -874,7 +874,7 @@ public:
int32_t sprite_idx = window_themes_tab_sprites[i];
if (_selected_tab == i)
sprite_idx += frame_no / window_themes_tab_animation_divisor[_selected_tab];
gfx_draw_sprite(
GfxDrawSprite(
dpi, ImageId(sprite_idx),
windowPos
+ ScreenCoordsXY{ widgets[WIDX_THEMES_SETTINGS_TAB + i].left, widgets[WIDX_THEMES_SETTINGS_TAB + i].top });

View File

@ -1006,8 +1006,8 @@ public:
ScreenCoordsXY screenCoords(windowPos.x, windowPos.y);
// Draw coordinates
gfx_draw_string(&dpi, screenCoords + ScreenCoordsXY(5, 24), "X:", { colours[1] });
gfx_draw_string(&dpi, screenCoords + ScreenCoordsXY(74, 24), "Y:", { colours[1] });
GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(5, 24), "X:", { colours[1] });
GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(74, 24), "Y:", { colours[1] });
if (_tileSelected)
{
auto tileCoords = TileCoordsXY{ _toolMap };
@ -1022,8 +1022,8 @@ public:
}
else
{
gfx_draw_string(&dpi, screenCoords + ScreenCoordsXY(43 - 7, 24), "-", { colours[1] });
gfx_draw_string(&dpi, screenCoords + ScreenCoordsXY(113 - 7, 24), "-", { colours[1] });
GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(43 - 7, 24), "-", { colours[1] });
GfxDrawString(&dpi, screenCoords + ScreenCoordsXY(113 - 7, 24), "-", { colours[1] });
}
if (windowTileInspectorSelectedIndex != -1)

View File

@ -60,8 +60,8 @@ public:
void OnDraw(rct_drawpixelinfo& dpi) override
{
auto screenCoords = windowPos + ScreenCoordsXY{ 2, 2 };
gfx_draw_sprite(&dpi, ImageId(SPR_G2_LOGO), screenCoords);
gfx_draw_sprite(&dpi, ImageId(SPR_G2_TITLE), screenCoords + ScreenCoordsXY{ 104, 18 });
GfxDrawSprite(&dpi, ImageId(SPR_G2_LOGO), screenCoords);
GfxDrawSprite(&dpi, ImageId(SPR_G2_TITLE), screenCoords + ScreenCoordsXY{ 104, 18 });
}
};

View File

@ -99,7 +99,7 @@ public:
// Text
left = windowPos.x + ((width + 1) / 2) - 1;
top = windowPos.y + 1;
draw_string_centred_raw(&dpi, { left, top }, _tooltipNumLines, _tooltipText, FontStyle::Small);
DrawStringCentredRaw(&dpi, { left, top }, _tooltipNumLines, _tooltipText, FontStyle::Small);
}
private:
@ -113,11 +113,11 @@ private:
formattedMessage.args.Add<const char*>(tempBuffer);
format_string(_tooltipText, sizeof(_tooltipText), formattedMessage.str, formattedMessage.args.Data());
auto textWidth = gfx_get_string_width_new_lined(_tooltipText, FontStyle::Small);
auto textWidth = GfxGetStringWidthNewLined(_tooltipText, FontStyle::Small);
textWidth = std::min(textWidth, 196);
int32_t numLines;
textWidth = gfx_wrap_string(_tooltipText, textWidth + 1, FontStyle::Small, &numLines);
textWidth = GfxWrapString(_tooltipText, textWidth + 1, FontStyle::Small, &numLines);
_tooltipNumLines = numLines;
return textWidth;
}

View File

@ -885,7 +885,7 @@ static void WindowTopToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
imgId = SPR_TOOLBAR_STAFF;
if (WidgetIsPressed(*w, WIDX_STAFF))
imgId++;
gfx_draw_sprite(dpi, ImageId(imgId, gStaffHandymanColour, gStaffMechanicColour), screenPos);
GfxDrawSprite(dpi, ImageId(imgId, gStaffHandymanColour, gStaffMechanicColour), screenPos);
}
// Draw fast forward button
@ -895,15 +895,15 @@ static void WindowTopToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
w->windowPos.y + window_top_toolbar_widgets[WIDX_FASTFORWARD].top + 0 };
if (WidgetIsPressed(*w, WIDX_FASTFORWARD))
screenPos.y++;
gfx_draw_sprite(dpi, ImageId(SPR_G2_FASTFORWARD), screenPos + ScreenCoordsXY{ 6, 3 });
GfxDrawSprite(dpi, ImageId(SPR_G2_FASTFORWARD), screenPos + ScreenCoordsXY{ 6, 3 });
for (int32_t i = 0; i < gGameSpeed && gGameSpeed <= 4; i++)
{
gfx_draw_sprite(dpi, ImageId(SPR_G2_SPEED_ARROW), screenPos + ScreenCoordsXY{ 5 + i * 5, 15 });
GfxDrawSprite(dpi, ImageId(SPR_G2_SPEED_ARROW), screenPos + ScreenCoordsXY{ 5 + i * 5, 15 });
}
for (int32_t i = 0; i < 3 && i < gGameSpeed - 4 && gGameSpeed >= 5; i++)
{
gfx_draw_sprite(dpi, ImageId(SPR_G2_HYPER_ARROW), screenPos + ScreenCoordsXY{ 5 + i * 6, 15 });
GfxDrawSprite(dpi, ImageId(SPR_G2_HYPER_ARROW), screenPos + ScreenCoordsXY{ 5 + i * 6, 15 });
}
}
@ -915,7 +915,7 @@ static void WindowTopToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
window_top_toolbar_widgets[WIDX_CHEATS].top - 1 };
if (WidgetIsPressed(*w, WIDX_CHEATS))
screenPos.y++;
gfx_draw_sprite(dpi, ImageId(SPR_G2_SANDBOX), screenPos);
GfxDrawSprite(dpi, ImageId(SPR_G2_SANDBOX), screenPos);
// Draw an overlay if clearance checks are disabled
if (gCheatsDisableClearanceChecks)
@ -933,7 +933,7 @@ static void WindowTopToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
+ ScreenCoordsXY{ window_top_toolbar_widgets[WIDX_CHAT].left, window_top_toolbar_widgets[WIDX_CHAT].top - 2 };
if (WidgetIsPressed(*w, WIDX_CHAT))
screenPos.y++;
gfx_draw_sprite(dpi, ImageId(SPR_G2_CHAT), screenPos);
GfxDrawSprite(dpi, ImageId(SPR_G2_CHAT), screenPos);
}
// Draw debug button
@ -943,7 +943,7 @@ static void WindowTopToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
+ ScreenCoordsXY{ window_top_toolbar_widgets[WIDX_DEBUG].left, window_top_toolbar_widgets[WIDX_DEBUG].top - 1 };
if (WidgetIsPressed(*w, WIDX_DEBUG))
screenPos.y++;
gfx_draw_sprite(dpi, ImageId(SPR_TAB_GEARS_0), screenPos);
GfxDrawSprite(dpi, ImageId(SPR_TAB_GEARS_0), screenPos);
}
// Draw research button
@ -954,7 +954,7 @@ static void WindowTopToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
window_top_toolbar_widgets[WIDX_RESEARCH].top };
if (WidgetIsPressed(*w, WIDX_RESEARCH))
screenPos.y++;
gfx_draw_sprite(dpi, ImageId(SPR_TAB_FINANCES_RESEARCH_0), screenPos);
GfxDrawSprite(dpi, ImageId(SPR_TAB_FINANCES_RESEARCH_0), screenPos);
}
// Draw finances button
@ -965,7 +965,7 @@ static void WindowTopToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
window_top_toolbar_widgets[WIDX_FINANCES].top + 1 };
if (WidgetIsPressed(*w, WIDX_FINANCES))
screenPos.y++;
gfx_draw_sprite(dpi, ImageId(SPR_FINANCE), screenPos);
GfxDrawSprite(dpi, ImageId(SPR_FINANCE), screenPos);
}
// Draw news button
@ -975,7 +975,7 @@ static void WindowTopToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
+ ScreenCoordsXY{ window_top_toolbar_widgets[WIDX_NEWS].left + 3, window_top_toolbar_widgets[WIDX_NEWS].top + 0 };
if (WidgetIsPressed(*w, WIDX_NEWS))
screenPos.y++;
gfx_draw_sprite(dpi, ImageId(SPR_G2_TAB_NEWS), screenPos);
GfxDrawSprite(dpi, ImageId(SPR_G2_TAB_NEWS), screenPos);
}
// Draw network button
@ -989,7 +989,7 @@ static void WindowTopToolbarPaint(rct_window* w, rct_drawpixelinfo* dpi)
// Draw (de)sync icon.
imgId = (network_is_desynchronised() ? SPR_G2_MULTIPLAYER_DESYNC : SPR_G2_MULTIPLAYER_SYNC);
gfx_draw_sprite(dpi, ImageId(imgId), screenPos + ScreenCoordsXY{ 3, 11 });
GfxDrawSprite(dpi, ImageId(imgId), screenPos + ScreenCoordsXY{ 3, 11 });
// Draw number of players.
auto ft = Formatter();
@ -3691,7 +3691,7 @@ static void TopToolbarInitViewMenu(rct_window* w, Widget* widget)
gDropdownDefaultIndex = DDIDX_UNDERGROUND_INSIDE;
// Opaque water relies on RCT1 sprites.
if (!is_csg_loaded())
if (!IsCsgLoaded())
{
Dropdown::SetDisabled(DDIDX_TRANSPARENT_WATER, true);
}

View File

@ -298,9 +298,9 @@ public:
g1temp.offset = _miniPreview.data();
g1temp.width = TRACK_MINI_PREVIEW_WIDTH;
g1temp.height = TRACK_MINI_PREVIEW_HEIGHT;
gfx_set_g1_element(SPR_TEMP, &g1temp);
GfxSetG1Element(SPR_TEMP, &g1temp);
drawing_engine_invalidate_image(SPR_TEMP);
gfx_draw_sprite(&clippedDpi, ImageId(SPR_TEMP, NOT_TRANSLUCENT(this->colours[0])), { 0, 0 });
GfxDrawSprite(&clippedDpi, ImageId(SPR_TEMP, NOT_TRANSLUCENT(this->colours[0])), { 0, 0 });
}
// Price

View File

@ -465,7 +465,7 @@ public:
{
utf8 pathBuffer[MAX_PATH];
const utf8* pathPtr = pathBuffer;
shorten_path(pathBuffer, sizeof(pathBuffer), path.c_str(), width, FontStyle::Medium);
ShortenPath(pathBuffer, sizeof(pathBuffer), path.c_str(), width, FontStyle::Medium);
auto ft = Formatter();
ft.Add<utf8*>(pathPtr);
DrawTextBasic(
@ -501,9 +501,9 @@ public:
g1temp.width = 370;
g1temp.height = 217;
g1temp.flags = G1_FLAG_HAS_TRANSPARENCY;
gfx_set_g1_element(SPR_TEMP, &g1temp);
GfxSetG1Element(SPR_TEMP, &g1temp);
drawing_engine_invalidate_image(SPR_TEMP);
gfx_draw_sprite(&dpi, ImageId(SPR_TEMP), trackPreview);
GfxDrawSprite(&dpi, ImageId(SPR_TEMP), trackPreview);
screenPos.y = windowPos.y + tdWidget.bottom - 12;

View File

@ -152,7 +152,7 @@ public:
const auto& widget = widgets[WIDX_HIDE_STAFF];
auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top };
auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, gStaffMechanicColour);
gfx_draw_sprite(&dpi, image, screenCoords);
GfxDrawSprite(&dpi, image, screenCoords);
}
private:

View File

@ -200,7 +200,7 @@ static bool SpriteImageExport(const rct_g1_element& spriteElement, u8string_view
DrawSpriteArgs args(
ImageId(), PaletteMap::GetDefault(), spriteElement, 0, 0, spriteElement.width, spriteElement.height, pixels);
gfx_sprite_to_buffer(dpi, args);
GfxSpriteToBuffer(dpi, args);
auto const pixels8 = dpi.bits;
auto const pixelsLen = (dpi.width + dpi.pitch) * dpi.height;

View File

@ -195,9 +195,9 @@ namespace OpenRCT2
}
gfx_object_check_all_images_freed();
gfx_unload_csg();
gfx_unload_g2();
gfx_unload_g1();
GfxUnloadCsg();
GfxUnloadG2();
GfxUnloadG1();
Audio::Close();
Instance = nullptr;
@ -847,12 +847,12 @@ namespace OpenRCT2
bool LoadBaseGraphics()
{
if (!gfx_load_g1(*_env))
if (!GfxLoadG1(*_env))
{
return false;
}
gfx_load_g2();
gfx_load_csg();
GfxLoadG2();
GfxLoadCsg();
font_sprite_initialise_characters();
return true;
}

View File

@ -159,7 +159,7 @@ void update_palette_effects()
{
palette = water_type->image_id;
}
const rct_g1_element* g1 = gfx_get_g1_element(palette);
const rct_g1_element* g1 = GfxGetG1Element(palette);
if (g1 != nullptr)
{
int32_t xoffset = g1->x_offset;
@ -187,7 +187,7 @@ void update_palette_effects()
palette = water_type->image_id;
}
const rct_g1_element* g1 = gfx_get_g1_element(palette);
const rct_g1_element* g1 = GfxGetG1Element(palette);
if (g1 != nullptr)
{
int32_t xoffset = g1->x_offset;
@ -223,7 +223,7 @@ void update_palette_effects()
{
waterId = water_type->palette_index_1;
}
const rct_g1_element* g1 = gfx_get_g1_element(shade + waterId);
const rct_g1_element* g1 = GfxGetG1Element(shade + waterId);
if (g1 != nullptr)
{
uint8_t* vs = &g1->offset[j * 3];
@ -248,7 +248,7 @@ void update_palette_effects()
{
waterId = water_type->palette_index_2;
}
g1 = gfx_get_g1_element(shade + waterId);
g1 = GfxGetG1Element(shade + waterId);
if (g1 != nullptr)
{
uint8_t* vs = &g1->offset[j * 3];
@ -270,7 +270,7 @@ void update_palette_effects()
j = (static_cast<uint16_t>(gPaletteEffectFrame * -960) * 3) >> 16;
waterId = SPR_GAME_PALETTE_4;
g1 = gfx_get_g1_element(shade + waterId);
g1 = GfxGetG1Element(shade + waterId);
if (g1 != nullptr)
{
uint8_t* vs = &g1->offset[j * 3];

View File

@ -191,10 +191,10 @@ void intro_draw(rct_drawpixelinfo* dpi)
BORDER_COLOUR_PUBLISHER);
// Draw Infogrames logo
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_00), { (screenWidth / 2) - 320 + 69, _introStateCounter + 69 });
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_10), { (screenWidth / 2) - 320 + 319, _introStateCounter + 69 });
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_01), { (screenWidth / 2) - 320 + 69, _introStateCounter + 319 });
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_11), { (screenWidth / 2) - 320 + 319, _introStateCounter + 319 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_00), { (screenWidth / 2) - 320 + 69, _introStateCounter + 69 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_10), { (screenWidth / 2) - 320 + 319, _introStateCounter + 69 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_01), { (screenWidth / 2) - 320 + 69, _introStateCounter + 319 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_11), { (screenWidth / 2) - 320 + 319, _introStateCounter + 319 });
break;
case IntroState::DeveloperBegin:
GfxClear(dpi, BACKROUND_COLOUR_DARK);
@ -204,8 +204,8 @@ void intro_draw(rct_drawpixelinfo* dpi)
GfxClear(dpi, BACKROUND_COLOUR_DARK);
// Draw Chris Sawyer logo
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_CHRIS_SAWYER_00), { (screenWidth / 2) - 320 + 70, _introStateCounter });
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_CHRIS_SAWYER_10), { (screenWidth / 2) - 320 + 320, _introStateCounter });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_CHRIS_SAWYER_00), { (screenWidth / 2) - 320 + 70, _introStateCounter });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_CHRIS_SAWYER_10), { (screenWidth / 2) - 320 + 320, _introStateCounter });
break;
case IntroState::LogoFadeIn:
if (_introStateCounter <= 0xFF00)
@ -294,10 +294,10 @@ static void screen_intro_draw_logo(rct_drawpixelinfo* dpi)
drawing_engine_invalidate_image(SPR_INTRO_LOGO_21);
GfxClear(dpi, BACKROUND_COLOUR_LOGO);
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_00), { imageX + 0, 0 });
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_10), { imageX + 220, 0 });
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_20), { imageX + 440, 0 });
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_01), { imageX + 0, 240 });
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_11), { imageX + 220, 240 });
gfx_draw_sprite(dpi, ImageId(SPR_INTRO_LOGO_21), { imageX + 440, 240 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_00), { imageX + 0, 0 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_10), { imageX + 220, 0 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_20), { imageX + 440, 0 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_01), { imageX + 0, 240 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_11), { imageX + 220, 240 });
GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_21), { imageX + 440, 240 });
}

View File

@ -68,7 +68,7 @@ GameActions::Result BannerSetNameAction::Execute() const
intent.putExtra(INTENT_EXTRA_BANNER_INDEX, _bannerIndex);
ContextBroadcastIntent(&intent);
scrolling_text_invalidate();
ScrollingTextInvalidate();
GfxInvalidateScreen();
return GameActions::Result();

View File

@ -59,7 +59,7 @@ GameActions::Result ParkSetNameAction::Execute() const
if (_name != park.Name)
{
park.Name = _name;
scrolling_text_invalidate();
ScrollingTextInvalidate();
GfxInvalidateScreen();
}
return GameActions::Result();

View File

@ -168,7 +168,7 @@ GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const
windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_RIDE_LIST));
windowManager->BroadcastIntent(Intent(INTENT_ACTION_REFRESH_GUEST_LIST));
scrolling_text_invalidate();
ScrollingTextInvalidate();
GfxInvalidateScreen();
return res;

View File

@ -81,7 +81,7 @@ GameActions::Result RideSetNameAction::Execute() const
ride->custom_name = _name;
}
scrolling_text_invalidate();
ScrollingTextInvalidate();
GfxInvalidateScreen();
// Refresh windows that display ride name

View File

@ -87,7 +87,7 @@ GameActions::Result SignSetNameAction::Execute() const
}
}
scrolling_text_invalidate();
ScrollingTextInvalidate();
GfxInvalidateScreen();
return GameActions::Result();
}

View File

@ -213,7 +213,7 @@ template<DrawBlendOp TBlendOp> static void FASTCALL DrawRLESprite(rct_drawpixeli
* rct2: 0x0067AA18
* @param imageId Only flags are used.
*/
void FASTCALL gfx_rle_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args)
void FASTCALL GfxRleSpriteToBuffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args)
{
if (args.Image.HasPrimary())
{

View File

@ -194,9 +194,9 @@ bool gTinyFontAntiAliased = false;
*
* rct2: 0x00678998
*/
bool gfx_load_g1(const IPlatformEnvironment& env)
bool GfxLoadG1(const IPlatformEnvironment& env)
{
log_verbose("gfx_load_g1(...)");
log_verbose("GfxLoadG1(...)");
try
{
auto path = env.FindFile(DIRBASE::RCT2, DIRID::DATA, u8"g1.dat");
@ -241,30 +241,30 @@ bool gfx_load_g1(const IPlatformEnvironment& env)
}
}
void gfx_unload_g1()
void GfxUnloadG1()
{
_g1.data.reset();
_g1.elements.clear();
_g1.elements.shrink_to_fit();
}
void gfx_unload_g2()
void GfxUnloadG2()
{
_g2.data.reset();
_g2.elements.clear();
_g2.elements.shrink_to_fit();
}
void gfx_unload_csg()
void GfxUnloadCsg()
{
_csg.data.reset();
_csg.elements.clear();
_csg.elements.shrink_to_fit();
}
bool gfx_load_g2()
bool GfxLoadG2()
{
log_verbose("gfx_load_g2()");
log_verbose("GfxLoadG2()");
auto env = GetContext()->GetPlatformEnvironment();
@ -320,9 +320,9 @@ bool gfx_load_g2()
return false;
}
bool gfx_load_csg()
bool GfxLoadCsg()
{
log_verbose("gfx_load_csg()");
log_verbose("GfxLoadCsg()");
if (gConfigGeneral.RCT1Path.empty())
{
@ -444,7 +444,7 @@ static std::optional<PaletteMap> FASTCALL gfx_draw_sprite_get_palette(ImageId im
return paletteMap;
}
void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& spriteCoords)
void FASTCALL GfxDrawSpriteSoftware(rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& spriteCoords)
{
if (imageId.HasValue())
{
@ -453,7 +453,7 @@ void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, const ImageId ima
{
palette = PaletteMap::GetDefault();
}
gfx_draw_sprite_palette_set_software(dpi, imageId, spriteCoords, *palette);
GfxDrawSpritePaletteSetSoftware(dpi, imageId, spriteCoords, *palette);
}
}
@ -466,13 +466,13 @@ void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, const ImageId ima
* x (cx)
* y (dx)
*/
void FASTCALL gfx_draw_sprite_palette_set_software(
void FASTCALL GfxDrawSpritePaletteSetSoftware(
rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& coords, const PaletteMap& paletteMap)
{
int32_t x = coords.x;
int32_t y = coords.y;
const auto* g1 = gfx_get_g1_element(imageId);
const auto* g1 = GfxGetG1Element(imageId);
if (g1 == nullptr)
{
return;
@ -490,7 +490,7 @@ void FASTCALL gfx_draw_sprite_palette_set_software(
zoomed_dpi.zoom_level = dpi->zoom_level - 1;
const auto spriteCoords = ScreenCoordsXY{ x >> 1, y >> 1 };
gfx_draw_sprite_palette_set_software(
GfxDrawSpritePaletteSetSoftware(
&zoomed_dpi, imageId.WithIndex(imageId.GetIndex() - g1->zoomed_offset), spriteCoords, paletteMap);
return;
}
@ -617,14 +617,14 @@ void FASTCALL gfx_draw_sprite_palette_set_software(
dest_pointer += (zoom_level.ApplyInversedTo(dpi->width) + dpi->pitch) * dest_start_y + dest_start_x;
DrawSpriteArgs args(imageId, paletteMap, *g1, source_start_x, source_start_y, width, height, dest_pointer);
gfx_sprite_to_buffer(*dpi, args);
GfxSpriteToBuffer(*dpi, args);
}
void FASTCALL gfx_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args)
void FASTCALL GfxSpriteToBuffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args)
{
if (args.SourceImage.flags & G1_FLAG_RLE_COMPRESSION)
{
gfx_rle_sprite_to_buffer(dpi, args);
GfxRleSpriteToBuffer(dpi, args);
}
else if (!(args.SourceImage.flags & G1_FLAG_1))
{
@ -638,12 +638,12 @@ void FASTCALL gfx_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs&
*
* rct2: 0x00681DE2
*/
void FASTCALL gfx_draw_sprite_raw_masked_software(
void FASTCALL GfxDrawSpriteRawMaskedSoftware(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& scrCoords, const ImageId maskImage, const ImageId colourImage)
{
int32_t left, top, right, bottom, width, height;
auto imgMask = gfx_get_g1_element(maskImage);
auto imgColour = gfx_get_g1_element(colourImage);
auto imgMask = GfxGetG1Element(maskImage);
auto imgColour = GfxGetG1Element(colourImage);
if (imgMask == nullptr || imgColour == nullptr)
{
return;
@ -652,7 +652,7 @@ void FASTCALL gfx_draw_sprite_raw_masked_software(
// Must have transparency in order to pass check
if (!(imgMask->flags & G1_FLAG_HAS_TRANSPARENCY) || !(imgColour->flags & G1_FLAG_HAS_TRANSPARENCY))
{
gfx_draw_sprite_software(dpi, colourImage, scrCoords);
GfxDrawSpriteSoftware(dpi, colourImage, scrCoords);
return;
}
@ -692,14 +692,14 @@ void FASTCALL gfx_draw_sprite_raw_masked_software(
MaskFn(width, height, maskSrc, colourSrc, dst, maskWrap, colourWrap, dstWrap);
}
const rct_g1_element* gfx_get_g1_element(const ImageId imageId)
const rct_g1_element* GfxGetG1Element(const ImageId imageId)
{
return gfx_get_g1_element(imageId.GetIndex());
return GfxGetG1Element(imageId.GetIndex());
}
const rct_g1_element* gfx_get_g1_element(ImageIndex image_id)
const rct_g1_element* GfxGetG1Element(ImageIndex image_id)
{
openrct2_assert(!gOpenRCT2NoGraphics, "gfx_get_g1_element called on headless instance");
openrct2_assert(!gOpenRCT2NoGraphics, "GfxGetG1Element called on headless instance");
auto offset = static_cast<size_t>(image_id);
if (offset == 0x7FFFF || offset == ImageIndexUndefined)
@ -731,7 +731,7 @@ const rct_g1_element* gfx_get_g1_element(ImageIndex image_id)
}
else if (offset < SPR_CSG_END)
{
if (is_csg_loaded())
if (IsCsgLoaded())
{
size_t idx = offset - SPR_CSG_BEGIN;
if (idx < _csg.header.num_entries)
@ -761,15 +761,15 @@ const rct_g1_element* gfx_get_g1_element(ImageIndex image_id)
return nullptr;
}
void gfx_set_g1_element(ImageIndex imageId, const rct_g1_element* g1)
void GfxSetG1Element(ImageIndex imageId, const rct_g1_element* g1)
{
bool isTemp = imageId == SPR_TEMP;
bool isValid = (imageId >= SPR_IMAGE_LIST_BEGIN && imageId < SPR_IMAGE_LIST_END)
|| (imageId >= SPR_SCROLLING_TEXT_START && imageId < SPR_SCROLLING_TEXT_END);
#ifdef DEBUG
openrct2_assert(!gOpenRCT2NoGraphics, "gfx_set_g1_element called on headless instance");
openrct2_assert(isValid || isTemp, "gfx_set_g1_element called with unexpected image id");
openrct2_assert(!gOpenRCT2NoGraphics, "GfxSetG1Element called on headless instance");
openrct2_assert(isValid || isTemp, "GfxSetG1Element called with unexpected image id");
openrct2_assert(g1 != nullptr, "g1 was nullptr");
#endif
@ -810,12 +810,12 @@ void gfx_set_g1_element(ImageIndex imageId, const rct_g1_element* g1)
}
}
bool is_csg_loaded()
bool IsCsgLoaded()
{
return _csgLoaded;
}
size_t g1_calculate_data_size(const rct_g1_element* g1)
size_t G1CalculateDataSize(const rct_g1_element* g1)
{
if (g1->flags & G1_FLAG_PALETTE)
{

View File

@ -46,7 +46,7 @@ static int32_t ttf_get_string_width(std::string_view text, FontStyle fontStyle,
*
* rct2: 0x006C23B1
*/
int32_t gfx_get_string_width_new_lined(std::string_view text, FontStyle fontStyle)
int32_t GfxGetStringWidthNewLined(std::string_view text, FontStyle fontStyle)
{
thread_local std::string buffer;
buffer.clear();
@ -57,7 +57,7 @@ int32_t gfx_get_string_width_new_lined(std::string_view text, FontStyle fontStyl
{
if (token.kind == FormatToken::Newline || token.kind == FormatToken::NewlineSmall)
{
auto width = gfx_get_string_width(buffer, fontStyle);
auto width = GfxGetStringWidth(buffer, fontStyle);
if (!maxWidth.has_value() || maxWidth.value() > width)
{
maxWidth = width;
@ -71,7 +71,7 @@ int32_t gfx_get_string_width_new_lined(std::string_view text, FontStyle fontStyl
}
if (!maxWidth.has_value())
{
maxWidth = gfx_get_string_width(buffer, fontStyle);
maxWidth = GfxGetStringWidth(buffer, fontStyle);
}
return maxWidth.value();
}
@ -82,12 +82,12 @@ int32_t gfx_get_string_width_new_lined(std::string_view text, FontStyle fontStyl
* rct2: 0x006C2321
* buffer (esi)
*/
int32_t gfx_get_string_width(std::string_view text, FontStyle fontStyle)
int32_t GfxGetStringWidth(std::string_view text, FontStyle fontStyle)
{
return ttf_get_string_width(text, fontStyle, false);
}
int32_t gfx_get_string_width_no_formatting(std::string_view text, FontStyle fontStyle)
int32_t GfxGetStringWidthNoFormatting(std::string_view text, FontStyle fontStyle)
{
return ttf_get_string_width(text, fontStyle, true);
}
@ -99,7 +99,7 @@ int32_t gfx_get_string_width_no_formatting(std::string_view text, FontStyle font
* buffer (esi)
* width (edi)
*/
int32_t gfx_clip_string(utf8* text, int32_t width, FontStyle fontStyle)
int32_t GfxClipString(utf8* text, int32_t width, FontStyle fontStyle)
{
if (width < 6)
{
@ -108,7 +108,7 @@ int32_t gfx_clip_string(utf8* text, int32_t width, FontStyle fontStyle)
}
// If width of the full string is less than allowed width then we don't need to clip
auto clippedWidth = gfx_get_string_width(text, fontStyle);
auto clippedWidth = GfxGetStringWidth(text, fontStyle);
if (clippedWidth <= width)
{
return clippedWidth;
@ -130,7 +130,7 @@ int32_t gfx_clip_string(utf8* text, int32_t width, FontStyle fontStyle)
// Add the ellipsis before checking the width
buffer.append("...");
auto currentWidth = gfx_get_string_width(buffer, fontStyle);
auto currentWidth = GfxGetStringWidth(buffer, fontStyle);
if (currentWidth < width)
{
bestLength = buffer.size();
@ -158,7 +158,7 @@ int32_t gfx_clip_string(utf8* text, int32_t width, FontStyle fontStyle)
buffer.append(cb);
}
}
return gfx_get_string_width(text, fontStyle);
return GfxGetStringWidth(text, fontStyle);
}
/**
@ -174,7 +174,7 @@ int32_t gfx_clip_string(utf8* text, int32_t width, FontStyle fontStyle)
* num_lines (edi) - out
* font_height (ebx) - out
*/
int32_t gfx_wrap_string(utf8* text, int32_t width, FontStyle fontStyle, int32_t* outNumLines)
int32_t GfxWrapString(utf8* text, int32_t width, FontStyle fontStyle, int32_t* outNumLines)
{
constexpr size_t NULL_INDEX = std::numeric_limits<size_t>::max();
thread_local std::string buffer;
@ -198,7 +198,7 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontStyle fontStyle, int32_t*
utf8_write_codepoint(cb, codepoint);
buffer.append(cb);
auto lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontStyle);
auto lineWidth = GfxGetStringWidth(&buffer[currentLineIndex], fontStyle);
if (lineWidth <= width || (splitIndex == NULL_INDEX && bestSplitIndex == NULL_INDEX))
{
if (codepoint == ' ')
@ -222,7 +222,7 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontStyle fontStyle, int32_t*
buffer.insert(buffer.begin() + splitIndex, '\0');
// Recalculate the line length after splitting
lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontStyle);
lineWidth = GfxGetStringWidth(&buffer[currentLineIndex], fontStyle);
maxWidth = std::max(maxWidth, lineWidth);
numLines++;
@ -242,7 +242,7 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontStyle fontStyle, int32_t*
{
buffer.push_back('\0');
auto lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontStyle);
auto lineWidth = GfxGetStringWidth(&buffer[currentLineIndex], fontStyle);
maxWidth = std::max(maxWidth, lineWidth);
numLines++;
@ -257,7 +257,7 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontStyle fontStyle, int32_t*
}
{
// Final line width calculation
auto lineWidth = gfx_get_string_width(&buffer[currentLineIndex], fontStyle);
auto lineWidth = GfxGetStringWidth(&buffer[currentLineIndex], fontStyle);
maxWidth = std::max(maxWidth, lineWidth);
}
@ -269,14 +269,14 @@ int32_t gfx_wrap_string(utf8* text, int32_t width, FontStyle fontStyle, int32_t*
/**
* Draws text that is left aligned and vertically centred.
*/
void gfx_draw_string_left_centred(
void GfxDrawStringLeftCentred(
rct_drawpixelinfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords)
{
char buffer[CommonTextBufferSize];
auto bufferPtr = buffer;
format_string(bufferPtr, sizeof(buffer), format, args);
int32_t height = string_get_height_raw(bufferPtr, FontStyle::Medium);
gfx_draw_string(dpi, coords - ScreenCoordsXY{ 0, (height / 2) }, bufferPtr, { colour });
int32_t height = StringGetHeightRaw(bufferPtr, FontStyle::Medium);
GfxDrawString(dpi, coords - ScreenCoordsXY{ 0, (height / 2) }, bufferPtr, { colour });
}
/**
@ -285,7 +285,7 @@ void gfx_draw_string_left_centred(
static void colour_char(uint8_t colour, const uint16_t* current_font_flags, uint8_t* palette_pointer)
{
int32_t colour32 = 0;
const rct_g1_element* g1 = gfx_get_g1_element(SPR_TEXT_PALETTE);
const rct_g1_element* g1 = GfxGetG1Element(SPR_TEXT_PALETTE);
if (g1 != nullptr)
{
uint32_t idx = (colour & 0xFF) * 4;
@ -334,17 +334,17 @@ static void colour_char_window(uint8_t colour, const uint16_t* current_font_flag
* text : esi
* dpi : edi
*/
void draw_string_centred_raw(
void DrawStringCentredRaw(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, char* text, FontStyle fontStyle)
{
ScreenCoordsXY screenCoords(dpi->x, dpi->y);
gfx_draw_string(dpi, screenCoords, "", { COLOUR_BLACK, fontStyle });
GfxDrawString(dpi, screenCoords, "", { COLOUR_BLACK, fontStyle });
screenCoords = coords;
for (int32_t i = 0; i <= numLines; i++)
{
int32_t width = gfx_get_string_width(text, fontStyle);
gfx_draw_string(dpi, screenCoords - ScreenCoordsXY{ width / 2, 0 }, text, { TEXT_COLOUR_254, fontStyle });
int32_t width = GfxGetStringWidth(text, fontStyle);
GfxDrawString(dpi, screenCoords - ScreenCoordsXY{ width / 2, 0 }, text, { TEXT_COLOUR_254, fontStyle });
const utf8* ch = text;
const utf8* nextCh = nullptr;
@ -359,7 +359,7 @@ void draw_string_centred_raw(
}
}
int32_t string_get_height_raw(std::string_view text, FontStyle fontStyle)
int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle)
{
int32_t height = 0;
if (fontStyle <= FontStyle::Medium)
@ -437,10 +437,10 @@ void DrawNewsTicker(
utf8* buffer = gCommonStringFormatBuffer;
ScreenCoordsXY screenCoords(dpi->x, dpi->y);
gfx_draw_string(dpi, screenCoords, "", { colour });
GfxDrawString(dpi, screenCoords, "", { colour });
format_string(buffer, 256, format, args);
gfx_wrap_string(buffer, width, FontStyle::Small, &numLines);
GfxWrapString(buffer, width, FontStyle::Small, &numLines);
lineHeight = font_get_line_height(FontStyle::Small);
int32_t numCharactersDrawn = 0;
@ -449,7 +449,7 @@ void DrawNewsTicker(
lineY = coords.y - ((numLines * lineHeight) / 2);
for (int32_t line = 0; line <= numLines; line++)
{
int32_t halfWidth = gfx_get_string_width(buffer, FontStyle::Small) / 2;
int32_t halfWidth = GfxGetStringWidth(buffer, FontStyle::Small) / 2;
FmtString fmt(buffer);
for (const auto& token : fmt)
@ -475,7 +475,7 @@ void DrawNewsTicker(
}
screenCoords = { coords.x - halfWidth, lineY };
gfx_draw_string(dpi, screenCoords, buffer, { TEXT_COLOUR_254, FontStyle::Small });
GfxDrawString(dpi, screenCoords, buffer, { TEXT_COLOUR_254, FontStyle::Small });
if (numCharactersDrawn > numCharactersToDraw)
{
@ -515,7 +515,7 @@ static void ttf_draw_character_sprite(rct_drawpixelinfo* dpi, int32_t codepoint,
}
PaletteMap paletteMap(info->palette);
gfx_draw_glyph(dpi, sprite, screenCoords, paletteMap);
GfxDrawGlyph(dpi, sprite, screenCoords, paletteMap);
}
info->x += characterWidth;
@ -760,12 +760,12 @@ static void ttf_process_format_code(rct_drawpixelinfo* dpi, const FmtString::tok
case FormatToken::InlineSprite:
{
auto imageId = ImageId::FromUInt32(token.parameter);
auto g1 = gfx_get_g1_element(imageId.GetIndex());
auto g1 = GfxGetG1Element(imageId.GetIndex());
if (g1 != nullptr && g1->width <= 32 && g1->height <= 32)
{
if (!(info->flags & TEXT_DRAW_FLAG_NO_DRAW))
{
gfx_draw_sprite(dpi, imageId, { info->x, info->y });
GfxDrawSprite(dpi, imageId, { info->x, info->y });
}
info->x += g1->width;
}
@ -969,7 +969,7 @@ static void ttf_process_initial_colour(int32_t colour, text_draw_info* info)
}
}
void ttf_draw_string(
void TtfDrawString(
rct_drawpixelinfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting,
FontStyle fontStyle, TextDarkness darkness)
{
@ -1043,7 +1043,7 @@ static int32_t ttf_get_string_width(std::string_view text, FontStyle fontStyle,
*
* rct2: 0x00682F28
*/
void gfx_draw_string_with_y_offsets(
void GfxDrawStringWithYOffsets(
rct_drawpixelinfo* dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets,
bool forceSpriteFont, FontStyle fontStyle)
{
@ -1071,12 +1071,12 @@ void gfx_draw_string_with_y_offsets(
dpi->lastStringPos = { info.x, info.y };
}
void shorten_path(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle)
void ShortenPath(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle)
{
size_t length = strlen(path);
// Return full string if it fits
if (gfx_get_string_width(const_cast<char*>(path), fontStyle) <= availableWidth)
if (GfxGetStringWidth(const_cast<char*>(path), fontStyle) <= availableWidth)
{
safe_strcpy(buffer, path, bufferSize);
return;
@ -1105,7 +1105,7 @@ void shorten_path(utf8* buffer, size_t bufferSize, const utf8* path, int32_t ava
} while (path[begin] != *PATH_SEPARATOR && path[begin] != '/');
safe_strcpy(buffer + 3, path + begin, bufferSize - 3);
if (gfx_get_string_width(buffer, fontStyle) <= availableWidth)
if (GfxGetStringWidth(buffer, fontStyle) <= availableWidth)
{
return;
}

View File

@ -591,7 +591,7 @@ void GfxFilterPixel(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, Filter
*/
void GfxTransposePalette(int32_t pal, uint8_t product)
{
const rct_g1_element* g1 = gfx_get_g1_element(pal);
const rct_g1_element* g1 = GfxGetG1Element(pal);
if (g1 != nullptr)
{
int32_t width = g1->width;
@ -632,7 +632,7 @@ void LoadPalette()
palette = water_type->image_id;
}
const rct_g1_element* g1 = gfx_get_g1_element(palette);
const rct_g1_element* g1 = GfxGetG1Element(palette);
if (g1 != nullptr)
{
int32_t width = g1->width;
@ -725,7 +725,7 @@ void GfxInvalidatePickedUpPeep()
auto imageId = gPickupPeepImage;
if (imageId.HasValue())
{
auto* g1 = gfx_get_g1_element(imageId);
auto* g1 = GfxGetG1Element(imageId);
if (g1 != nullptr)
{
int32_t left = gPickupPeepX + g1->x_offset;
@ -741,7 +741,7 @@ void GfxDrawPickedUpPeep(rct_drawpixelinfo* dpi)
{
if (gPickupPeepImage.HasValue())
{
gfx_draw_sprite(dpi, gPickupPeepImage, { gPickupPeepX, gPickupPeepY });
GfxDrawSprite(dpi, gPickupPeepImage, { gPickupPeepX, gPickupPeepY });
}
}
@ -759,7 +759,7 @@ std::optional<PaletteMap> GetPaletteMapForColour(colour_t paletteId)
auto g1Index = GetPaletteG1Index(paletteId);
if (g1Index.has_value())
{
auto g1 = gfx_get_g1_element(g1Index.value());
auto g1 = GfxGetG1Element(g1Index.value());
if (g1 != nullptr)
{
return PaletteMap(g1->offset, g1->height, g1->width);

View File

@ -501,69 +501,69 @@ void GfxFillRectInset(rct_drawpixelinfo* dpi, const ScreenRect& rect, int32_t co
void GfxFilterRect(rct_drawpixelinfo* dpi, const ScreenRect& rect, FilterPaletteID palette);
// sprite
bool gfx_load_g1(const OpenRCT2::IPlatformEnvironment& env);
bool gfx_load_g2();
bool gfx_load_csg();
void gfx_unload_g1();
void gfx_unload_g2();
void gfx_unload_csg();
const rct_g1_element* gfx_get_g1_element(const ImageId imageId);
const rct_g1_element* gfx_get_g1_element(ImageIndex image_id);
void gfx_set_g1_element(ImageIndex imageId, const rct_g1_element* g1);
bool GfxLoadG1(const OpenRCT2::IPlatformEnvironment& env);
bool GfxLoadG2();
bool GfxLoadCsg();
void GfxUnloadG1();
void GfxUnloadG2();
void GfxUnloadCsg();
const rct_g1_element* GfxGetG1Element(const ImageId imageId);
const rct_g1_element* GfxGetG1Element(ImageIndex image_id);
void GfxSetG1Element(ImageIndex imageId, const rct_g1_element* g1);
std::optional<rct_gx> GfxLoadGx(const std::vector<uint8_t>& buffer);
bool is_csg_loaded();
void FASTCALL gfx_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
bool IsCsgLoaded();
void FASTCALL GfxSpriteToBuffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
void FASTCALL GfxBmpSpriteToBuffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
void FASTCALL gfx_rle_sprite_to_buffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, const ImageId image_id, const ScreenCoordsXY& coords);
void FASTCALL GfxRleSpriteToBuffer(rct_drawpixelinfo& dpi, const DrawSpriteArgs& args);
void FASTCALL GfxDrawSprite(rct_drawpixelinfo* dpi, const ImageId image_id, const ScreenCoordsXY& coords);
void FASTCALL
gfx_draw_glyph(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap);
void FASTCALL gfx_draw_sprite_solid(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour);
void FASTCALL gfx_draw_sprite_raw_masked(
GfxDrawGlyph(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap);
void FASTCALL GfxDrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour);
void FASTCALL GfxDrawSpriteRawMasked(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const ImageId maskImage, const ImageId colourImage);
void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& spriteCoords);
void FASTCALL gfx_draw_sprite_palette_set_software(
void FASTCALL GfxDrawSpriteSoftware(rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& spriteCoords);
void FASTCALL GfxDrawSpritePaletteSetSoftware(
rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& coords, const PaletteMap& paletteMap);
void FASTCALL gfx_draw_sprite_raw_masked_software(
void FASTCALL GfxDrawSpriteRawMaskedSoftware(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& scrCoords, const ImageId maskImage, const ImageId colourImage);
// string
void gfx_draw_string(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint = {});
void gfx_draw_string_no_formatting(
void GfxDrawString(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint = {});
void GfxDrawStringNoFormatting(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint);
void gfx_draw_string_left_centred(
void GfxDrawStringLeftCentred(
rct_drawpixelinfo* dpi, StringId format, void* args, colour_t colour, const ScreenCoordsXY& coords);
void draw_string_centred_raw(
void DrawStringCentredRaw(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t numLines, char* text, FontStyle fontStyle);
void DrawNewsTicker(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, int32_t width, colour_t colour, StringId format, void* args,
int32_t ticks);
void gfx_draw_string_with_y_offsets(
void GfxDrawStringWithYOffsets(
rct_drawpixelinfo* dpi, const utf8* text, int32_t colour, const ScreenCoordsXY& coords, const int8_t* yOffsets,
bool forceSpriteFont, FontStyle fontStyle);
int32_t gfx_wrap_string(char* buffer, int32_t width, FontStyle fontStyle, int32_t* num_lines);
int32_t gfx_get_string_width(std::string_view text, FontStyle fontStyle);
int32_t gfx_get_string_width_new_lined(std::string_view text, FontStyle fontStyle);
int32_t gfx_get_string_width_no_formatting(std::string_view text, FontStyle fontStyle);
int32_t string_get_height_raw(std::string_view text, FontStyle fontStyle);
int32_t gfx_clip_string(char* buffer, int32_t width, FontStyle fontStyle);
void shorten_path(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle);
void ttf_draw_string(
int32_t GfxWrapString(char* buffer, int32_t width, FontStyle fontStyle, int32_t* num_lines);
int32_t GfxGetStringWidth(std::string_view text, FontStyle fontStyle);
int32_t GfxGetStringWidthNewLined(std::string_view text, FontStyle fontStyle);
int32_t GfxGetStringWidthNoFormatting(std::string_view text, FontStyle fontStyle);
int32_t StringGetHeightRaw(std::string_view text, FontStyle fontStyle);
int32_t GfxClipString(char* buffer, int32_t width, FontStyle fontStyle);
void ShortenPath(utf8* buffer, size_t bufferSize, const utf8* path, int32_t availableWidth, FontStyle fontStyle);
void TtfDrawString(
rct_drawpixelinfo* dpi, const_utf8string text, int32_t colour, const ScreenCoordsXY& coords, bool noFormatting,
FontStyle fontStyle, TextDarkness darkness);
// scrolling text
void scrolling_text_initialise_bitmaps();
void scrolling_text_invalidate();
void ScrollingTextInitialiseBitmaps();
void ScrollingTextInvalidate();
class Formatter;
ImageId scrolling_text_setup(
ImageId ScrollingTextSetup(
struct PaintSession& session, StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour);
size_t g1_calculate_data_size(const rct_g1_element* g1);
size_t G1CalculateDataSize(const rct_g1_element* g1);
void MaskScalar(
int32_t width, int32_t height, const uint8_t* RESTRICT maskSrc, const uint8_t* RESTRICT colourSrc, uint8_t* RESTRICT dst,

View File

@ -250,7 +250,7 @@ void font_sprite_initialise_characters()
int32_t glyphOffset = EnumValue(fontStyle) * FONT_SPRITE_GLYPH_COUNT;
for (uint8_t glyphIndex = 0; glyphIndex < FONT_SPRITE_GLYPH_COUNT; glyphIndex++)
{
const rct_g1_element* g1 = gfx_get_g1_element(glyphIndex + SPR_CHAR_START + glyphOffset);
const rct_g1_element* g1 = GfxGetG1Element(glyphIndex + SPR_CHAR_START + glyphOffset);
int32_t width = 0;
if (g1 != nullptr)
{
@ -266,7 +266,7 @@ void font_sprite_initialise_characters()
int32_t glyphOffset = EnumValue(fontStyle) * SPR_G2_GLYPH_COUNT;
for (int32_t glyphIndex = 0; glyphIndex < SPR_G2_GLYPH_COUNT; glyphIndex++)
{
const rct_g1_element* g1 = gfx_get_g1_element(glyphIndex + SPR_G2_CHAR_BEGIN + glyphOffset);
const rct_g1_element* g1 = GfxGetG1Element(glyphIndex + SPR_G2_CHAR_BEGIN + glyphOffset);
int32_t width = 0;
if (g1 != nullptr)
{
@ -277,7 +277,7 @@ void font_sprite_initialise_characters()
}
}
scrolling_text_initialise_bitmaps();
ScrollingTextInitialiseBitmaps();
}
int32_t font_sprite_get_codepoint_offset(int32_t codepoint)

View File

@ -203,7 +203,7 @@ uint32_t gfx_object_allocate_images(const rct_g1_element* images, uint32_t count
uint32_t imageId = baseImageId;
for (uint32_t i = 0; i < count; i++)
{
gfx_set_g1_element(imageId, &images[i]);
GfxSetG1Element(imageId, &images[i]);
drawing_engine_invalidate_image(imageId);
imageId++;
}
@ -221,7 +221,7 @@ void gfx_object_free_images(uint32_t baseImageId, uint32_t count)
{
uint32_t imageId = baseImageId + i;
rct_g1_element g1 = {};
gfx_set_g1_element(imageId, &g1);
GfxSetG1Element(imageId, &g1);
drawing_engine_invalidate_image(imageId);
}

View File

@ -233,7 +233,7 @@ void GfxDrawDashedLine(
}
}
void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& coords)
void FASTCALL GfxDrawSprite(rct_drawpixelinfo* dpi, const ImageId imageId, const ScreenCoordsXY& coords)
{
auto drawingEngine = dpi->DrawingEngine;
if (drawingEngine != nullptr)
@ -244,7 +244,7 @@ void FASTCALL gfx_draw_sprite(rct_drawpixelinfo* dpi, const ImageId imageId, con
}
void FASTCALL
gfx_draw_glyph(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap)
GfxDrawGlyph(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap)
{
auto drawingEngine = dpi->DrawingEngine;
if (drawingEngine != nullptr)
@ -254,7 +254,7 @@ void FASTCALL
}
}
void FASTCALL gfx_draw_sprite_raw_masked(
void FASTCALL GfxDrawSpriteRawMasked(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const ImageId maskImage, const ImageId colourImage)
{
auto drawingEngine = dpi->DrawingEngine;
@ -265,7 +265,7 @@ void FASTCALL gfx_draw_sprite_raw_masked(
}
}
void FASTCALL gfx_draw_sprite_solid(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour)
void FASTCALL GfxDrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour)
{
auto drawingEngine = dpi->DrawingEngine;
if (drawingEngine != nullptr)

View File

@ -58,7 +58,7 @@ static void ScrollingTextInitialiseCharacterBitmaps(uint32_t glyphStart, uint16_
for (int32_t i = 0; i < count; i++)
{
std::fill_n(drawingSurface, sizeof(drawingSurface), 0x00);
gfx_draw_sprite_software(&dpi, ImageId(glyphStart + (EnumValue(FontStyle::Tiny) * count) + i), { -1, 0 });
GfxDrawSpriteSoftware(&dpi, ImageId(glyphStart + (EnumValue(FontStyle::Tiny) * count) + i), { -1, 0 });
for (int32_t x = 0; x < 8; x++)
{
@ -98,11 +98,11 @@ static void ScrollingTextInitialiseScrollingText()
g1.offset[16] = 0;
g1.offset[17] = 0;
gfx_set_g1_element(imageId, &g1);
GfxSetG1Element(imageId, &g1);
}
}
void scrolling_text_initialise_bitmaps()
void ScrollingTextInitialiseBitmaps()
{
ScrollingTextInitialiseCharacterBitmaps(SPR_CHAR_START, 0, FONT_SPRITE_GLYPH_COUNT, gTinyFontAntiAliased);
ScrollingTextInitialiseCharacterBitmaps(SPR_G2_CHAR_BEGIN, FONT_SPRITE_GLYPH_COUNT, SPR_G2_GLYPH_COUNT, false);
@ -1424,7 +1424,7 @@ static constexpr const int16_t* _scrollPositions[MAX_SCROLLING_TEXT_MODES] = {
};
// clang-format on
void scrolling_text_invalidate()
void ScrollingTextInvalidate()
{
for (auto& scrollText : _drawScrollTextList)
{
@ -1433,7 +1433,7 @@ void scrolling_text_invalidate()
}
}
ImageId scrolling_text_setup(
ImageId ScrollingTextSetup(
PaintSession& session, StringId stringId, Formatter& ft, uint16_t scroll, uint16_t scrollingMode, colour_t colour)
{
std::scoped_lock<std::mutex> lock(_scrollingTextMutex);
@ -1530,7 +1530,7 @@ static void scrolling_text_set_bitmap_for_sprite(
}
else if (FormatTokenIsColour(token.kind))
{
auto g1 = gfx_get_g1_element(SPR_TEXT_PALETTE);
auto g1 = GfxGetG1Element(SPR_TEXT_PALETTE);
if (g1 != nullptr)
{
auto colourIndex = FormatTokenGetTextColourIndex(token.kind);
@ -1564,7 +1564,7 @@ static void scrolling_text_set_bitmap_for_ttf(
}
else if (FormatTokenIsColour(token.kind))
{
auto g1 = gfx_get_g1_element(SPR_TEXT_PALETTE);
auto g1 = GfxGetG1Element(SPR_TEXT_PALETTE);
if (g1 != nullptr)
{
auto colourIndex = FormatTokenGetTextColourIndex(token.kind);

View File

@ -34,7 +34,7 @@ public:
Buffer = source;
Paint = paint;
MaxWidth = gfx_wrap_string(Buffer, width, paint.FontStyle, &LineCount);
MaxWidth = GfxWrapString(Buffer, width, paint.FontStyle, &LineCount);
LineCount += 1;
LineHeight = font_get_line_height(paint.FontStyle);
}
@ -84,8 +84,8 @@ public:
static void DrawText(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const TextPaint& paint, const_utf8string text, bool noFormatting)
{
int32_t width = noFormatting ? gfx_get_string_width_no_formatting(text, paint.FontStyle)
: gfx_get_string_width(text, paint.FontStyle);
int32_t width = noFormatting ? GfxGetStringWidthNoFormatting(text, paint.FontStyle)
: GfxGetStringWidth(text, paint.FontStyle);
auto alignedCoords = coords;
switch (paint.Alignment)
@ -100,7 +100,7 @@ static void DrawText(
break;
}
ttf_draw_string(dpi, text, paint.Colour, alignedCoords, noFormatting, paint.FontStyle, paint.Darkness);
TtfDrawString(dpi, text, paint.Colour, alignedCoords, noFormatting, paint.FontStyle, paint.Darkness);
if (paint.UnderlineText == TextUnderline::On)
{
@ -150,17 +150,17 @@ void DrawTextEllipsised(
{
utf8 buffer[512];
format_string(buffer, sizeof(buffer), format, ft.Data());
gfx_clip_string(buffer, width, textPaint.FontStyle);
GfxClipString(buffer, width, textPaint.FontStyle);
DrawText(dpi, coords, textPaint, buffer);
}
void gfx_draw_string(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint)
void GfxDrawString(rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint)
{
DrawText(dpi, coords, textPaint, buffer);
}
void gfx_draw_string_no_formatting(
void GfxDrawStringNoFormatting(
rct_drawpixelinfo* dpi, const ScreenCoordsXY& coords, const_utf8string buffer, TextPaint textPaint)
{
DrawText(dpi, coords, textPaint, buffer, true);

View File

@ -710,13 +710,13 @@ void X8DrawingContext::DrawLine(rct_drawpixelinfo* dpi, uint32_t colour, const S
void X8DrawingContext::DrawSprite(rct_drawpixelinfo* dpi, const ImageId imageId, int32_t x, int32_t y)
{
gfx_draw_sprite_software(dpi, imageId, { x, y });
GfxDrawSpriteSoftware(dpi, imageId, { x, y });
}
void X8DrawingContext::DrawSpriteRawMasked(
rct_drawpixelinfo* dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage)
{
gfx_draw_sprite_raw_masked_software(dpi, { x, y }, maskImage, colourImage);
GfxDrawSpriteRawMaskedSoftware(dpi, { x, y }, maskImage, colourImage);
}
void X8DrawingContext::DrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour)
@ -726,11 +726,11 @@ void X8DrawingContext::DrawSpriteSolid(rct_drawpixelinfo* dpi, const ImageId ima
palette[0] = 0;
const auto spriteCoords = ScreenCoordsXY{ x, y };
gfx_draw_sprite_palette_set_software(dpi, ImageId(image.GetIndex(), 0), spriteCoords, PaletteMap(palette));
GfxDrawSpritePaletteSetSoftware(dpi, ImageId(image.GetIndex(), 0), spriteCoords, PaletteMap(palette));
}
void X8DrawingContext::DrawGlyph(
rct_drawpixelinfo* dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& paletteMap)
{
gfx_draw_sprite_palette_set_software(dpi, image, { x, y }, paletteMap);
GfxDrawSpritePaletteSetSoftware(dpi, image, { x, y }, paletteMap);
}

View File

@ -60,7 +60,7 @@ void MoneyEffect::CreateAt(money64 value, const CoordsXYZ& effectPos, bool verti
auto [stringId, newValue] = moneyEffect->GetStringId();
char buffer[128];
format_string(buffer, 128, stringId, &newValue);
offsetX = -(gfx_get_string_width(buffer, FontStyle::Medium) / 2);
offsetX = -(GfxGetStringWidth(buffer, FontStyle::Medium) / 2);
}
moneyEffect->OffsetX = offsetX;
moneyEffect->Wiggle = 0;

View File

@ -198,10 +198,10 @@ void chat_draw(rct_drawpixelinfo* dpi, uint8_t chatBackgroundColor)
GfxSetDirtyBlocks({ screenCoords, { screenCoords + ScreenCoordsXY{ _chatWidth, inputLineHeight + 15 } } });
// TODO: Show caret if the input text has multiple lines
if (_chatCaretTicks < 15 && gfx_get_string_width(lineBuffer, FontStyle::Medium) < (_chatWidth - 10))
if (_chatCaretTicks < 15 && GfxGetStringWidth(lineBuffer, FontStyle::Medium) < (_chatWidth - 10))
{
lineBuffer.assign(_chatCurrentLine, _chatTextInputSession->SelectionStart);
int32_t caretX = screenCoords.x + gfx_get_string_width(lineBuffer, FontStyle::Medium);
int32_t caretX = screenCoords.x + GfxGetStringWidth(lineBuffer, FontStyle::Medium);
int32_t caretY = screenCoords.y + 14;
GfxFillRect(dpi, { { caretX, caretY }, { caretX + 6, caretY + 1 } }, PALETTE_INDEX_56);
@ -279,7 +279,7 @@ static int32_t chat_history_draw_string(
FormatStringToBuffer(buffer, sizeof(buffer), "{OUTLINE}{WHITE}{STRING}", text);
int32_t numLines;
gfx_wrap_string(bufferPtr, width, FontStyle::Medium, &numLines);
GfxWrapString(bufferPtr, width, FontStyle::Medium, &numLines);
auto lineHeight = font_get_line_height(FontStyle::Medium);
int32_t expectedY = screenCoords.y - (numLines * lineHeight);
@ -291,7 +291,7 @@ static int32_t chat_history_draw_string(
auto lineY = screenCoords.y;
for (int32_t line = 0; line <= numLines; ++line)
{
gfx_draw_string(dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, bufferPtr, { TEXT_COLOUR_254 });
GfxDrawString(dpi, { screenCoords.x, lineY - (numLines * lineHeight) }, bufferPtr, { TEXT_COLOUR_254 });
bufferPtr = get_string_end(bufferPtr) + 1;
lineY += lineHeight;
}
@ -307,7 +307,7 @@ int32_t chat_string_wrapped_get_height(void* args, int32_t width)
format_string(bufferPtr, 256, STR_STRING, args);
int32_t numLines;
gfx_wrap_string(bufferPtr, width, FontStyle::Medium, &numLines);
GfxWrapString(bufferPtr, width, FontStyle::Medium, &numLines);
int32_t lineHeight = font_get_line_height(FontStyle::Medium);
int32_t lineY = 0;

View File

@ -39,7 +39,7 @@ void colours_init_maps()
// Get colour maps from g1
for (int32_t i = 0; i < COLOUR_COUNT; i++)
{
const rct_g1_element* g1 = gfx_get_g1_element(SPR_PALETTE_2_START + i);
const rct_g1_element* g1 = GfxGetG1Element(SPR_PALETTE_2_START + i);
if (g1 != nullptr)
{
ColourMapA[i].colour_0 = g1->offset[INDEX_COLOUR_0];

View File

@ -1659,7 +1659,7 @@ static bool is_sprite_interacted_with_palette_set(
{
PROFILED_FUNCTION();
const rct_g1_element* g1 = gfx_get_g1_element(imageId);
const rct_g1_element* g1 = GfxGetG1Element(imageId);
if (g1 == nullptr)
{
return false;

View File

@ -81,8 +81,8 @@ void BannerObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t he
auto image0 = ImageId(_legacyType.image, COLOUR_BORDEAUX_RED);
auto image1 = ImageId(_legacyType.image + 1, COLOUR_BORDEAUX_RED);
gfx_draw_sprite(dpi, image0, screenCoords + ScreenCoordsXY{ -12, 8 });
gfx_draw_sprite(dpi, image1, screenCoords + ScreenCoordsXY{ -12, 8 });
GfxDrawSprite(dpi, image0, screenCoords + ScreenCoordsXY{ -12, 8 });
GfxDrawSprite(dpi, image1, screenCoords + ScreenCoordsXY{ -12, 8 });
}
void BannerObject::ReadJson(IReadObjectContext* context, json_t& root)

View File

@ -46,9 +46,9 @@ void EntranceObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t
{
auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 };
gfx_draw_sprite(dpi, ImageId(_legacyType.image_id + 1), screenCoords + ScreenCoordsXY{ -32, 14 });
gfx_draw_sprite(dpi, ImageId(_legacyType.image_id + 0), screenCoords + ScreenCoordsXY{ 0, 28 });
gfx_draw_sprite(dpi, ImageId(_legacyType.image_id + 2), screenCoords + ScreenCoordsXY{ 32, 44 });
GfxDrawSprite(dpi, ImageId(_legacyType.image_id + 1), screenCoords + ScreenCoordsXY{ -32, 14 });
GfxDrawSprite(dpi, ImageId(_legacyType.image_id + 0), screenCoords + ScreenCoordsXY{ 0, 28 });
GfxDrawSprite(dpi, ImageId(_legacyType.image_id + 2), screenCoords + ScreenCoordsXY{ 32, 44 });
}
void EntranceObject::ReadJson(IReadObjectContext* context, json_t& root)

View File

@ -83,7 +83,7 @@ void FootpathItemObject::Unload()
void FootpathItemObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const
{
auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 };
gfx_draw_sprite(dpi, ImageId(_legacyType.image), screenCoords - ScreenCoordsXY{ 22, 24 });
GfxDrawSprite(dpi, ImageId(_legacyType.image), screenCoords - ScreenCoordsXY{ 22, 24 });
}
static PathBitDrawType ParseDrawType(const std::string& s)

View File

@ -72,8 +72,8 @@ void FootpathObject::Unload()
void FootpathObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const
{
auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 };
gfx_draw_sprite(dpi, ImageId(_pathSurfaceDescriptor.PreviewImage), screenCoords - ScreenCoordsXY{ 49, 17 });
gfx_draw_sprite(dpi, ImageId(_queueSurfaceDescriptor.PreviewImage), screenCoords + ScreenCoordsXY{ 4, -17 });
GfxDrawSprite(dpi, ImageId(_pathSurfaceDescriptor.PreviewImage), screenCoords - ScreenCoordsXY{ 49, 17 });
GfxDrawSprite(dpi, ImageId(_queueSurfaceDescriptor.PreviewImage), screenCoords + ScreenCoordsXY{ 4, -17 });
}
void FootpathObject::ReadJson(IReadObjectContext* context, json_t& root)

View File

@ -61,20 +61,20 @@ void FootpathRailingsObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width,
for (int i = 0; i < 2; i++)
{
auto h = i * 16;
gfx_draw_sprite(dpi, img, { x - 8, y + 8 + h });
gfx_draw_sprite(dpi, img, { x + 8, y + 16 + h });
GfxDrawSprite(dpi, img, { x - 8, y + 8 + h });
GfxDrawSprite(dpi, img, { x + 8, y + 16 + h });
}
gfx_draw_sprite(dpi, helper.WithIndex(BridgeImageId + 5), { x, y - 17 });
gfx_draw_sprite(dpi, ImageId(RailingsImageId + 1), { x + 4, y - 14 });
gfx_draw_sprite(dpi, ImageId(RailingsImageId + 1), { x + 27, y - 2 });
GfxDrawSprite(dpi, helper.WithIndex(BridgeImageId + 5), { x, y - 17 });
GfxDrawSprite(dpi, ImageId(RailingsImageId + 1), { x + 4, y - 14 });
GfxDrawSprite(dpi, ImageId(RailingsImageId + 1), { x + 27, y - 2 });
}
else
{
gfx_draw_sprite(dpi, helper.WithIndex(BridgeImageId + 22), { x + 0, y + 16 });
gfx_draw_sprite(dpi, helper.WithIndex(BridgeImageId + 49), { x, y - 17 });
gfx_draw_sprite(dpi, ImageId(RailingsImageId + 1), { x + 4, y - 14 });
gfx_draw_sprite(dpi, ImageId(RailingsImageId + 1), { x + 27, y - 3 });
GfxDrawSprite(dpi, helper.WithIndex(BridgeImageId + 22), { x + 0, y + 16 });
GfxDrawSprite(dpi, helper.WithIndex(BridgeImageId + 49), { x, y - 17 });
GfxDrawSprite(dpi, ImageId(RailingsImageId + 1), { x + 4, y - 14 });
GfxDrawSprite(dpi, ImageId(RailingsImageId + 1), { x + 27, y - 3 });
}
}

View File

@ -45,9 +45,9 @@ void FootpathSurfaceObject::Unload()
void FootpathSurfaceObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const
{
auto screenCoords = ScreenCoordsXY{ width / 2 - 16, height / 2 };
gfx_draw_sprite(dpi, ImageId(BaseImageId + 3), screenCoords);
gfx_draw_sprite(dpi, ImageId(BaseImageId + 16), { screenCoords.x + 32, screenCoords.y - 16 });
gfx_draw_sprite(dpi, ImageId(BaseImageId + 8), { screenCoords.x + 32, screenCoords.y + 16 });
GfxDrawSprite(dpi, ImageId(BaseImageId + 3), screenCoords);
GfxDrawSprite(dpi, ImageId(BaseImageId + 16), { screenCoords.x + 32, screenCoords.y - 16 });
GfxDrawSprite(dpi, ImageId(BaseImageId + 8), { screenCoords.x + 32, screenCoords.y + 16 });
}
void FootpathSurfaceObject::ReadJson(IReadObjectContext* context, json_t& root)

View File

@ -47,7 +47,7 @@ struct ImageTable::RequiredImage
RequiredImage(const rct_g1_element& orig)
{
auto length = g1_calculate_data_size(&orig);
auto length = G1CalculateDataSize(&orig);
g1 = orig;
g1.offset = new uint8_t[length];
std::memcpy(g1.offset, orig.offset, length);
@ -59,7 +59,7 @@ struct ImageTable::RequiredImage
auto orig = getter(idx);
if (orig != nullptr)
{
auto length = g1_calculate_data_size(orig);
auto length = G1CalculateDataSize(orig);
g1 = *orig;
g1.offset = new uint8_t[length];
std::memcpy(g1.offset, orig->offset, length);
@ -94,13 +94,13 @@ std::vector<std::unique_ptr<ImageTable::RequiredImage>> ImageTable::ParseImages(
auto range = ParseRange(s.substr(4));
if (!range.empty())
{
if (is_csg_loaded())
if (IsCsgLoaded())
{
for (auto i : range)
{
result.push_back(std::make_unique<RequiredImage>(
static_cast<uint32_t>(SPR_CSG_BEGIN + i),
[](uint32_t idx) -> const rct_g1_element* { return gfx_get_g1_element(idx); }));
[](uint32_t idx) -> const rct_g1_element* { return GfxGetG1Element(idx); }));
}
}
else
@ -123,7 +123,7 @@ std::vector<std::unique_ptr<ImageTable::RequiredImage>> ImageTable::ParseImages(
for (auto i : range)
{
result.push_back(std::make_unique<RequiredImage>(
static_cast<uint32_t>(i), [](uint32_t idx) -> const rct_g1_element* { return gfx_get_g1_element(idx); }));
static_cast<uint32_t>(i), [](uint32_t idx) -> const rct_g1_element* { return GfxGetG1Element(idx); }));
}
}
}
@ -542,7 +542,7 @@ bool ImageTable::ReadJson(IReadObjectContext* context, json_t& root)
// First gather all the required images from inspecting the JSON
std::vector<std::unique_ptr<RequiredImage>> allImages;
auto jsonImages = root["images"];
if (!is_csg_loaded() && root.contains("noCsgImages"))
if (!IsCsgLoaded() && root.contains("noCsgImages"))
{
jsonImages = root["noCsgImages"];
usesFallbackSprites = true;
@ -611,7 +611,7 @@ bool ImageTable::ReadJson(IReadObjectContext* context, json_t& root)
void ImageTable::AddImage(const rct_g1_element* g1)
{
rct_g1_element newg1 = *g1;
auto length = g1_calculate_data_size(g1);
auto length = G1CalculateDataSize(g1);
if (length == 0)
{
newg1.offset = nullptr;

View File

@ -150,7 +150,7 @@ void LargeSceneryObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int3
if (_legacyType.flags & LARGE_SCENERY_FLAG_HAS_TERTIARY_COLOUR)
image = image.WithTertiary(COLOUR_DARK_BROWN);
gfx_draw_sprite(dpi, image, screenCoords);
GfxDrawSprite(dpi, image, screenCoords);
}
std::vector<rct_large_scenery_tile> LargeSceneryObject::ReadTiles(OpenRCT2::IStream* stream)

View File

@ -89,7 +89,7 @@ void MusicObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t hei
int32_t x = width / 2;
int32_t y = height / 2;
if (_hasPreview)
gfx_draw_sprite(dpi, ImageId(_previewImageId), { 0, 0 });
GfxDrawSprite(dpi, ImageId(_previewImageId), { 0, 0 });
else
DrawTextBasic(dpi, { x, y }, STR_WINDOW_NO_IMAGE, {}, { TextAlignment::CENTRE });
}

View File

@ -295,7 +295,7 @@ void RideObject::DrawPreview(rct_drawpixelinfo* dpi, [[maybe_unused]] int32_t wi
imageId++;
}
gfx_draw_sprite(dpi, ImageId(imageId), { 0, 0 });
GfxDrawSprite(dpi, ImageId(imageId), { 0, 0 });
}
std::string RideObject::GetDescription() const

View File

@ -75,7 +75,7 @@ void SceneryGroupObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int3
auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 };
const auto imageId = ImageId(_legacyType.image + 1, COLOUR_DARK_GREEN);
gfx_draw_sprite(dpi, imageId, screenCoords - ScreenCoordsXY{ 15, 14 });
GfxDrawSprite(dpi, imageId, screenCoords - ScreenCoordsXY{ 15, 14 });
}
static std::optional<uint8_t> GetSceneryType(const ObjectType type)

View File

@ -120,12 +120,12 @@ void SmallSceneryObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int3
screenCoords.y -= 12;
}
gfx_draw_sprite(dpi, imageId, screenCoords);
GfxDrawSprite(dpi, imageId, screenCoords);
if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS))
{
imageId = ImageId(_legacyType.image + 4).WithTransparency(COLOUR_BORDEAUX_RED);
gfx_draw_sprite(dpi, imageId, screenCoords);
GfxDrawSprite(dpi, imageId, screenCoords);
}
if (_legacyType.HasFlag(SMALL_SCENERY_FLAG_ANIMATED_FG))
@ -135,7 +135,7 @@ void SmallSceneryObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int3
{
imageId = imageId.WithSecondary(COLOUR_YELLOW);
}
gfx_draw_sprite(dpi, imageId, screenCoords);
GfxDrawSprite(dpi, imageId, screenCoords);
}
}

View File

@ -64,16 +64,16 @@ void StationObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t h
imageId = imageId.WithSecondary(colour1);
}
gfx_draw_sprite(dpi, imageId, screenCoords);
GfxDrawSprite(dpi, imageId, screenCoords);
if (Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT)
{
gfx_draw_sprite(dpi, tImageId, screenCoords);
GfxDrawSprite(dpi, tImageId, screenCoords);
}
gfx_draw_sprite(dpi, imageId.WithIndexOffset(4), screenCoords);
GfxDrawSprite(dpi, imageId.WithIndexOffset(4), screenCoords);
if (Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT)
{
gfx_draw_sprite(dpi, tImageId.WithIndexOffset(4), screenCoords);
GfxDrawSprite(dpi, tImageId.WithIndexOffset(4), screenCoords);
}
}

View File

@ -43,8 +43,8 @@ void TerrainEdgeObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32
auto screenCoords = ScreenCoordsXY{ width / 2, height / 2 };
auto imageId = ImageId(BaseImageId + 5);
gfx_draw_sprite(dpi, imageId, screenCoords + ScreenCoordsXY{ 8, -8 });
gfx_draw_sprite(dpi, imageId, screenCoords + ScreenCoordsXY{ 8, 8 });
GfxDrawSprite(dpi, imageId, screenCoords + ScreenCoordsXY{ 8, -8 });
GfxDrawSprite(dpi, imageId, screenCoords + ScreenCoordsXY{ 8, 8 });
}
void TerrainEdgeObject::ReadJson(IReadObjectContext* context, json_t& root)

View File

@ -70,7 +70,7 @@ void TerrainSurfaceObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, in
}
for (int32_t j = 0; j < 4; j++)
{
gfx_draw_sprite(dpi, imageId, screenCoords);
GfxDrawSprite(dpi, imageId, screenCoords);
screenCoords.x += 64;
}
screenCoords.y += 16;

View File

@ -81,16 +81,16 @@ void WallObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t heig
imageId = imageId.WithSecondary(COLOUR_YELLOW);
}
gfx_draw_sprite(dpi, imageId, screenCoords);
GfxDrawSprite(dpi, imageId, screenCoords);
if (_legacyType.flags & WALL_SCENERY_HAS_GLASS)
{
auto glassImageId = imageId.WithTransparency(COLOUR_BORDEAUX_RED).WithIndexOffset(6);
gfx_draw_sprite(dpi, glassImageId, screenCoords);
GfxDrawSprite(dpi, glassImageId, screenCoords);
}
else if (_legacyType.flags & WALL_SCENERY_IS_DOOR)
{
gfx_draw_sprite(dpi, imageId.WithIndexOffset(1), screenCoords);
GfxDrawSprite(dpi, imageId.WithIndexOffset(1), screenCoords);
}
}

View File

@ -151,7 +151,7 @@ static constexpr CoordsXYZ RotateBoundBoxSize(const CoordsXYZ& bbSize, const uin
static PaintStruct* CreateNormalPaintStruct(
PaintSession& session, ImageId image_id, const CoordsXYZ& offset, const BoundBoxXYZ& boundBox)
{
auto* const g1 = gfx_get_g1_element(image_id);
auto* const g1 = GfxGetG1Element(image_id);
if (g1 == nullptr)
{
return nullptr;
@ -509,7 +509,7 @@ static void PaintDrawStruct(PaintSession& session, PaintStruct* ps)
}
else
{
gfx_draw_sprite(dpi, imageId, { x, y });
GfxDrawSprite(dpi, imageId, { x, y });
}
if (ps->children != nullptr)
@ -555,11 +555,11 @@ static void PaintAttachedPS(rct_drawpixelinfo* dpi, PaintStruct* ps, uint32_t vi
auto imageId = PaintPSColourifyImage(ps, attached_ps->image_id, viewFlags);
if (attached_ps->IsMasked)
{
gfx_draw_sprite_raw_masked(dpi, screenCoords, imageId, attached_ps->ColourImageId);
GfxDrawSpriteRawMasked(dpi, screenCoords, imageId, attached_ps->ColourImageId);
}
else
{
gfx_draw_sprite(dpi, imageId, screenCoords);
GfxDrawSprite(dpi, imageId, screenCoords);
}
}
}
@ -640,7 +640,7 @@ static void PaintPSImageWithBoundingBoxes(rct_drawpixelinfo* dpi, PaintStruct* p
GfxDrawLine(dpi, { screenCoordBackTop, screenCoordLeftTop }, colour);
GfxDrawLine(dpi, { screenCoordBackTop, screenCoordRightTop }, colour);
gfx_draw_sprite(dpi, imageId, { x, y });
GfxDrawSprite(dpi, imageId, { x, y });
// vertical front
GfxDrawLine(dpi, { screenCoordFrontTop, screenCoordFrontBottom }, colour);
@ -917,7 +917,7 @@ void PaintDrawMoneyStructs(rct_drawpixelinfo* dpi, PaintStringStruct* ps)
forceSpriteFont = true;
}
gfx_draw_string_with_y_offsets(
GfxDrawStringWithYOffsets(
dpi, buffer, COLOUR_BLACK, { ps->x, ps->y }, reinterpret_cast<int8_t*>(ps->y_offsets), forceSpriteFont,
FontStyle::Medium);
} while ((ps = ps->next) != nullptr);

View File

@ -90,11 +90,11 @@ void Painter::PaintReplayNotice(rct_drawpixelinfo* dpi, const char* text)
char buffer[64]{};
FormatStringToBuffer(buffer, sizeof(buffer), "{OUTLINE}{RED}{STRING}", text);
auto stringWidth = gfx_get_string_width(buffer, FontStyle::Medium);
auto stringWidth = GfxGetStringWidth(buffer, FontStyle::Medium);
screenCoords.x = screenCoords.x - stringWidth;
if (((gCurrentTicks >> 1) & 0xF) > 4)
gfx_draw_string(dpi, screenCoords, buffer, { COLOUR_SATURATED_RED });
GfxDrawString(dpi, screenCoords, buffer, { COLOUR_SATURATED_RED });
// Make area dirty so the text doesn't get drawn over the last
GfxSetDirtyBlocks({ screenCoords, screenCoords + ScreenCoordsXY{ stringWidth, 16 } });
@ -110,9 +110,9 @@ void Painter::PaintFPS(rct_drawpixelinfo* dpi)
FormatStringToBuffer(buffer, sizeof(buffer), "{OUTLINE}{WHITE}{INT32}", _currentFPS);
// Draw Text
int32_t stringWidth = gfx_get_string_width(buffer, FontStyle::Medium);
int32_t stringWidth = GfxGetStringWidth(buffer, FontStyle::Medium);
screenCoords.x = screenCoords.x - (stringWidth / 2);
gfx_draw_string(dpi, screenCoords, buffer);
GfxDrawString(dpi, screenCoords, buffer);
// Make area dirty so the text doesn't get drawn over the last
GfxSetDirtyBlocks({ { screenCoords - ScreenCoordsXY{ 16, 4 } }, { dpi->lastStringPos.x + 16, 16 } });

View File

@ -61,9 +61,9 @@ static void PaintBannerScrollingText(
format_string(text, sizeof(text), STR_BANNER_TEXT_FORMAT, ft.Data());
}
auto stringWidth = gfx_get_string_width(text, FontStyle::Tiny);
auto stringWidth = GfxGetStringWidth(text, FontStyle::Tiny);
auto scroll = (gCurrentTicks / 2) % stringWidth;
auto imageId = scrolling_text_setup(session, STR_BANNER_TEXT_FORMAT, ft, scroll, scrollingMode, COLOUR_BLACK);
auto imageId = ScrollingTextSetup(session, STR_BANNER_TEXT_FORMAT, ft, scroll, scrollingMode, COLOUR_BLACK);
PaintAddImageAsChild(session, imageId, { 0, 0, height + 22 }, { bbOffset, { 1, 1, 21 } });
}

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