diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index d9a2e4261a..63bd58634c 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -90,7 +90,8 @@ static void paint_session_add_ps_to_quadrant(paint_session * session, paint_stru /** * Extracted from 0x0098196c, 0x0098197c, 0x0098198c, 0x0098199c */ -static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, LocationXYZ16 offset, LocationXYZ16 boundBoxSize, LocationXYZ16 boundBoxOffset, uint8 rotation) +static paint_struct * sub_9819_c( + paint_session * session, uint32 image_id, LocationXYZ16 offset, LocationXYZ16 boundBoxSize, LocationXYZ16 boundBoxOffset) { if (session->NextFreePaintStruct >= session->EndOfPaintStructArray) return nullptr; auto g1 = gfx_get_g1_element(image_id & 0x7FFFF); @@ -102,7 +103,7 @@ static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, Locat paint_struct * ps = &session->NextFreePaintStruct->basic; ps->image_id = image_id; - switch (rotation) + switch (session->CurrentRotation) { case 0: rotate_map_coordinates(&offset.x, &offset.y, 0); @@ -120,7 +121,7 @@ static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, Locat offset.x += session->SpritePosition.x; offset.y += session->SpritePosition.y; - LocationXY16 map = coordinate_3d_to_2d(&offset, rotation); + LocationXY16 map = coordinate_3d_to_2d(&offset, session->CurrentRotation); ps->x = map.x; ps->y = map.y; @@ -140,7 +141,7 @@ static paint_struct * sub_9819_c(paint_session * session, uint32 image_id, Locat // This probably rotates the variables so they're relative to rotation 0. - switch (rotation) + switch (session->CurrentRotation) { case 0: boundBoxSize.x--; @@ -920,7 +921,7 @@ paint_struct * sub_98197C( LocationXYZ16 offset = { x_offset, y_offset, z_offset }; LocationXYZ16 boundBoxSize = { bound_box_length_x, bound_box_length_y, bound_box_length_z }; LocationXYZ16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }; - paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset, rotation); + paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset); if (ps == nullptr) { return nullptr; @@ -990,7 +991,7 @@ paint_struct * sub_98198C( LocationXYZ16 offset = { x_offset, y_offset, z_offset }; LocationXYZ16 boundBoxSize = { bound_box_length_x, bound_box_length_y, bound_box_length_z }; LocationXYZ16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }; - paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset, rotation); + paint_struct * ps = sub_9819_c(session, image_id, offset, boundBoxSize, boundBoxOffset); if (ps == nullptr) { return nullptr; @@ -1045,7 +1046,7 @@ paint_struct * sub_98199C( LocationXYZ16 offset = { x_offset, y_offset, z_offset }; LocationXYZ16 boundBox = { bound_box_length_x, bound_box_length_y, bound_box_length_z }; LocationXYZ16 boundBoxOffset = { bound_box_offset_x, bound_box_offset_y, bound_box_offset_z }; - paint_struct * ps = sub_9819_c(session, image_id, offset, boundBox, boundBoxOffset, rotation); + paint_struct * ps = sub_9819_c(session, image_id, offset, boundBox, boundBoxOffset); if (ps == nullptr) {