* @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 */
| 683 | * @param eflag Should the sorting workaround be applied |
| 684 | */ |
| 685 | static 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); |
no test coverage detected