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

Function DrawPlayerHelper

Source/scrollrt.cpp:660–675  ·  view source on GitHub ↗

* @brief Check if and how a player should be rendered * @param y dPiece coordinate * @param x dPiece coordinate * @param oy dPiece Y offset * @param sx Back buffer coordinate * @param sy Back buffer coordinate * @param eflag Should the sorting workaround be applied */

Source from the content-addressed store, hash-verified

658 * @param eflag Should the sorting workaround be applied
659 */
660static void DrawPlayerHelper(int x, int y, int oy, int sx, int sy, int eflag)
661{
662 int p = dPlayer[x][y + oy];
663 p = p > 0 ? p - 1 : -(p + 1);
664 PlayerStruct *pPlayer = &plr[p];
665 int px = sx + pPlayer->_pxoff - pPlayer->_pAnimWidth2;
666 int py = sy + pPlayer->_pyoff;
667
668 DrawPlayer(p, x, y + oy, px, py, pPlayer->_pAnimData, pPlayer->_pAnimFrame, pPlayer->_pAnimWidth);
669 if (eflag && pPlayer->_peflag != 0) {
670 if (pPlayer->_peflag == 2) {
671 scrollrt_draw_e_flag(x - 2, y + 1, sx - 96, sy - 16);
672 }
673 scrollrt_draw_e_flag(x - 1, y + 1, sx - 64, sy);
674 }
675}
676
677/**
678 * @brief Render object sprites

Callers 1

scrollrt_draw_dungeonFunction · 0.85

Calls 2

DrawPlayerFunction · 0.85
scrollrt_draw_e_flagFunction · 0.85

Tested by

no test coverage detected