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

Function scrollrt_draw_dungeon

Source/scrollrt.cpp:685–755  ·  view source on GitHub ↗

* @brief Render object sprites * @param sx dPiece coordinate * @param sy dPiece coordinate * @param dx Back buffer coordinate * @param dy Back buffer coordinate * @param eflag Should the sorting workaround be applied */

Source from the content-addressed store, hash-verified

683 * @param eflag Should the sorting workaround be applied
684 */
685static void scrollrt_draw_dungeon(int sx, int sy, int dx, int dy, int eflag)
686{
687 int mi, px, py, nCel, nMon, negMon, frames;
688 char bFlag, bDead, bObj, bItem, bPlr, bArch, bMap, negPlr, dd;
689 DeadStruct *pDeadGuy;
690 BYTE *pCelBuff;
691
692 assert((DWORD)sx < MAXDUNX);
693 assert((DWORD)sy < MAXDUNY);
694 bFlag = dFlags[sx][sy];
695 bDead = dDead[sx][sy];
696 bArch = dArch[sx][sy];
697 bMap = dTransVal[sx][sy];
698
699 negMon = dMonster[sx][sy - 1];
700
701 if (visiondebug && bFlag & BFLAG_LIT) {
702 CelClippedDraw(dx, dy, pSquareCel, 1, 64);
703 }
704
705 if (MissilePreFlag) {
706 DrawMissile(sx, sy, dx, dy, TRUE);
707 }
708
709 if (light_table_index < lightmax && bDead != 0) {
710 pDeadGuy = &dead[(bDead & 0x1F) - 1];
711 dd = (bDead >> 5) & 7;
712 px = dx - pDeadGuy->_deadWidth2;
713 pCelBuff = pDeadGuy->_deadData[dd];
714 assert(pDeadGuy->_deadData[dd] != NULL);
715 if (pCelBuff != NULL) {
716 if (pDeadGuy->_deadtrans != 0) {
717 Cl2DrawLightTbl(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth, pDeadGuy->_deadtrans);
718 } else {
719 Cl2DrawLight(px, dy, pCelBuff, pDeadGuy->_deadFrame, pDeadGuy->_deadWidth);
720 }
721 }
722 }
723 DrawObject(sx, sy, dx, dy, 1);
724 DrawItem(sx, sy, dx, dy, 1);
725 if (bFlag & BFLAG_PLAYERLR) {
726 assert((DWORD)(sy-1) < MAXDUNY);
727 DrawPlayerHelper(sx, sy, -1, dx, dy, eflag);
728 }
729 if (bFlag & BFLAG_MONSTLR && negMon < 0) {
730 DrawMonsterHelper(sx, sy, -1, dx, dy, eflag);
731 }
732 if (bFlag & BFLAG_DEAD_PLAYER) {
733 DrawDeadPlayer(sx, sy, dx, dy);
734 }
735 if (dPlayer[sx][sy] > 0) {
736 DrawPlayerHelper(sx, sy, 0, dx, dy, eflag);
737 }
738 if (dMonster[sx][sy] > 0) {
739 DrawMonsterHelper(sx, sy, 0, dx, dy, eflag);
740 }
741 DrawMissile(sx, sy, dx, dy, FALSE);
742 DrawObject(sx, sy, dx, dy, 0);

Callers 1

drawRowFunction · 0.85

Calls 11

CelClippedDrawFunction · 0.85
DrawMissileFunction · 0.85
Cl2DrawLightTblFunction · 0.85
Cl2DrawLightFunction · 0.85
DrawObjectFunction · 0.85
DrawItemFunction · 0.85
DrawPlayerHelperFunction · 0.85
DrawMonsterHelperFunction · 0.85
DrawDeadPlayerFunction · 0.85
CelClippedBlitLightTransFunction · 0.85
CelBlitFrameFunction · 0.85

Tested by

no test coverage detected