1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Use const ImageId in drawing functions

This commit is contained in:
Gymnasiast
2022-09-28 23:00:58 +02:00
parent d352ca3d01
commit cedccf9b0e
15 changed files with 68 additions and 80 deletions

View File

@@ -758,12 +758,13 @@ static void ttf_process_format_code(rct_drawpixelinfo* dpi, const FmtString::tok
}
case FormatToken::InlineSprite:
{
auto g1 = gfx_get_g1_element(token.parameter & 0x7FFFF);
auto imageId = ImageId::FromUInt32(token.parameter);
auto g1 = gfx_get_g1_element(imageId.GetIndex());
if (g1 != nullptr && g1->width <= 32 && g1->height <= 32)
{
if (!(info->flags & TEXT_DRAW_FLAG_NO_DRAW))
{
gfx_draw_sprite(dpi, token.parameter, { info->x, info->y }, 0);
gfx_draw_sprite(dpi, imageId, { info->x, info->y });
}
info->x += g1->width;
}