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

Fix #12079: incorrect drawing of attached paint structs (#12082)

* Fix #12079: incorrect drawing of attached paint structs

The issue is caused by the paint_struct x and y coordinates being incorrectly marked as unsigned. Unfortunately they cannot easily be converted without careful rework. Therefore this is a stop gap until the type is changed to preferably a ScreenCoords.
This commit is contained in:
Duncan
2020-06-29 23:13:23 +01:00
committed by GitHub
parent ec33551b24
commit c723a1a314

View File

@@ -522,7 +522,8 @@ static void paint_attached_ps(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t
attached_paint_struct* attached_ps = ps->attached_ps;
for (; attached_ps; attached_ps = attached_ps->next)
{
auto screenCoords = ScreenCoordsXY{ attached_ps->x + ps->x, attached_ps->y + ps->y };
auto screenCoords = ScreenCoordsXY{ attached_ps->x + static_cast<int16_t>(ps->x),
attached_ps->y + static_cast<int16_t>(ps->y) };
uint32_t imageId = paint_ps_colourify_image(attached_ps->image_id, ps->sprite_type, viewFlags);
if (attached_ps->flags & PAINT_STRUCT_FLAG_IS_MASKED)