1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 02:05:13 +01:00

Part of #12017 - create gfx_draw_sprite overload (#12026)

* Part of #12017 - create gfx_draw_sprite overload

Part 1. Creates the overload and replaces about a half of the calls since there are too many for one PR.

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
This commit is contained in:
TomasZilinek
2020-06-23 23:32:34 +02:00
committed by GitHub
parent d2542194fa
commit 9d965ccfb6
31 changed files with 169 additions and 178 deletions

View File

@@ -46,8 +46,7 @@ void StationObject::Unload()
void StationObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t height) const
{
int32_t x = width / 2;
int32_t y = (height / 2) + 16;
auto screenCoords = ScreenCoordsXY{ width / 2, (height / 2) + 16 };
auto colour0 = COLOUR_LIGHT_BLUE;
auto colour1 = COLOUR_BORDEAUX_RED;
@@ -66,16 +65,16 @@ void StationObject::DrawPreview(rct_drawpixelinfo* dpi, int32_t width, int32_t h
tImageId |= (colour1 << 24) | IMAGE_TYPE_REMAP_2_PLUS;
}
gfx_draw_sprite(dpi, imageId + 0, x, y, 0);
gfx_draw_sprite(dpi, imageId + 0, screenCoords, 0);
if (Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT)
{
gfx_draw_sprite(dpi, tImageId, x, y, 0);
gfx_draw_sprite(dpi, tImageId, screenCoords, 0);
}
gfx_draw_sprite(dpi, imageId + 4, x, y, 0);
gfx_draw_sprite(dpi, imageId + 4, screenCoords, 0);
if (Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT)
{
gfx_draw_sprite(dpi, tImageId + 4, x, y, 0);
gfx_draw_sprite(dpi, tImageId + 4, screenCoords, 0);
}
}