| 697 | } |
| 698 | |
| 699 | static inline void PaintDrawStruct(PaintSession& session, PaintStruct* ps) |
| 700 | { |
| 701 | auto screenPos = ps->ScreenPos; |
| 702 | if (ps->InteractionItem == ViewportInteractionItem::entity) |
| 703 | { |
| 704 | if (session.rt.zoom_level >= ZoomLevel{ 1 }) |
| 705 | { |
| 706 | screenPos.x = floor2(screenPos.x, 2); |
| 707 | screenPos.y = floor2(screenPos.y, 2); |
| 708 | if (session.rt.zoom_level >= ZoomLevel{ 2 }) |
| 709 | { |
| 710 | screenPos.x = floor2(screenPos.x, 4); |
| 711 | screenPos.y = floor2(screenPos.y, 4); |
| 712 | } |
| 713 | } |
| 714 | } |
| 715 | auto imageId = PaintPSColourifyImage(ps, ps->image_id, session.ViewFlags); |
| 716 | if (gPaintBoundingBoxes) |
| 717 | { |
| 718 | PaintPSImageWithBoundingBoxes(session, ps, imageId, screenPos.x, screenPos.y); |
| 719 | } |
| 720 | else |
| 721 | { |
| 722 | GfxDrawSprite(session.rt, imageId, screenPos); |
| 723 | } |
| 724 | |
| 725 | if (ps->Children != nullptr) |
| 726 | { |
| 727 | PaintDrawStruct(session, ps->Children); |
| 728 | } |
| 729 | else |
| 730 | { |
| 731 | PaintAttachedPS(session.rt, ps, session.ViewFlags); |
| 732 | } |
| 733 | } |
| 734 | |
| 735 | /** |
| 736 | * |
no test coverage detected