MCPcopy Create free account
hub / github.com/diasurgical/devilution / DrawItem

Function DrawItem

Source/scrollrt.cpp:577–595  ·  view source on GitHub ↗

* @brief Draw item for a given tile * @param y dPiece coordinate * @param x dPiece coordinate * @param sx Back buffer coordinate * @param sy Back buffer coordinate * @param pre Is the sprite in the background */

Source from the content-addressed store, hash-verified

575 * @param pre Is the sprite in the background
576 */
577static void DrawItem(int x, int y, int sx, int sy, BOOL pre)
578{
579 char bItem = dItem[x][y];
580 ItemStruct *pItem;
581
582 if (bItem == 0)
583 return;
584
585 pItem = &item[bItem - 1];
586 if (pItem->_iPostDraw == pre)
587 return;
588
589 assert((unsigned char)bItem <= MAXITEMS);
590 int px = sx - pItem->_iAnimWidth2;
591 if (bItem - 1 == pcursitem) {
592 CelBlitOutline(181, px, sy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth);
593 }
594 CelClippedDrawLight(px, sy, pItem->_iAnimData, pItem->_iAnimFrame, pItem->_iAnimWidth);
595}
596
597/**
598 * @brief Check if and how a mosnter should be rendered

Callers 1

scrollrt_draw_dungeonFunction · 0.85

Calls 2

CelBlitOutlineFunction · 0.85
CelClippedDrawLightFunction · 0.85

Tested by

no test coverage detected