MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ViewportDrawParentSprites

Function ViewportDrawParentSprites

src/viewport.cpp:1716–1732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1714
1715
1716static void ViewportDrawParentSprites(const ParentSpriteToSortVector *psd, const ChildScreenSpriteToDrawVector *csstdv)
1717{
1718 for (const ParentSpriteToDraw *ps : *psd) {
1719 if (ps->image != SPR_EMPTY_BOUNDING_BOX) DrawSpriteViewport(ps->image, ps->pal, ps->x, ps->y, ps->sub);
1720
1721 int child_idx = ps->first_child;
1722 while (child_idx >= 0) {
1723 const ChildScreenSpriteToDraw *cs = &(*csstdv)[child_idx];
1724 child_idx = cs->next;
1725 if (cs->relative) {
1726 DrawSpriteViewport(cs->image, cs->pal, ps->left + cs->x, ps->top + cs->y, cs->sub);
1727 } else {
1728 DrawSpriteViewport(cs->image, cs->pal, ps->x + cs->x, ps->y + cs->y, cs->sub);
1729 }
1730 }
1731 }
1732}
1733
1734/**
1735 * Draws the bounding boxes of all ParentSprites

Callers 1

ViewportDoDrawFunction · 0.85

Calls 1

DrawSpriteViewportFunction · 0.85

Tested by

no test coverage detected