MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / PaintDrawStruct

Function PaintDrawStruct

src/openrct2/paint/Paint.cpp:699–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

697}
698
699static 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 *

Callers 1

PaintDrawStructsFunction · 0.85

Calls 5

floor2Function · 0.85
PaintPSColourifyImageFunction · 0.85
GfxDrawSpriteFunction · 0.85
PaintAttachedPSFunction · 0.85

Tested by

no test coverage detected