| 961 | } |
| 962 | |
| 963 | static void drawStruct(const Gfx::RenderTarget& rt, Gfx::DrawingContext& drawingCtx, const PaintStruct& ps, const bool shouldCull) |
| 964 | { |
| 965 | auto imageId = ps.imageId; |
| 966 | |
| 967 | if (shouldCull) |
| 968 | { |
| 969 | imageId = ImageId(imageId.getIndex()).withTranslucency(ExtColour::unk30); |
| 970 | } |
| 971 | |
| 972 | auto imagePos = ps.vpPos; |
| 973 | if (ps.type == Ui::ViewportInteraction::InteractionItem::entity) |
| 974 | { |
| 975 | const auto zoomAlign = 1U << rt.zoomLevel; |
| 976 | imagePos.x = Numerics::floor2(imagePos.x, zoomAlign); |
| 977 | imagePos.y = Numerics::floor2(imagePos.y, zoomAlign); |
| 978 | } |
| 979 | |
| 980 | if ((ps.flags & PaintStructFlags::hasMaskedImage) != PaintStructFlags::none) |
| 981 | { |
| 982 | drawingCtx.drawImageMasked(imagePos, imageId, ps.maskedImageId); |
| 983 | } |
| 984 | else |
| 985 | { |
| 986 | drawingCtx.drawImage(imagePos, imageId); |
| 987 | } |
| 988 | } |
| 989 | |
| 990 | static void drawAttachStruct(const Gfx::RenderTarget& rt, Gfx::DrawingContext& drawingCtx, const PaintStruct& ps, const AttachedPaintStruct& attachPs, const bool shouldCull) |
| 991 | { |
no test coverage detected