* @brief Render a player sprite * @param x dPiece coordinate * @param y dPiece coordinate * @param sx Back buffer coordinate * @param sy Back buffer coordinate */
| 418 | * @param sy Back buffer coordinate |
| 419 | */ |
| 420 | void DrawDeadPlayer(int x, int y, int sx, int sy) |
| 421 | { |
| 422 | int i, px, py, nCel, frames; |
| 423 | PlayerStruct *p; |
| 424 | BYTE *pCelBuff; |
| 425 | |
| 426 | dFlags[x][y] &= ~BFLAG_DEAD_PLAYER; |
| 427 | |
| 428 | for (i = 0; i < MAX_PLRS; i++) { |
| 429 | p = &plr[i]; |
| 430 | if (p->plractive && !p->_pHitPoints && p->plrlevel == (BYTE)currlevel && p->WorldX == x && p->WorldY == y) { |
| 431 | pCelBuff = p->_pAnimData; |
| 432 | if (!pCelBuff) { |
| 433 | // app_fatal("Drawing dead player %d \"%s\": NULL Cel Buffer", i, p->_pName); |
| 434 | break; |
| 435 | } |
| 436 | nCel = p->_pAnimFrame; |
| 437 | frames = SDL_SwapLE32(*(DWORD *)pCelBuff); |
| 438 | if (nCel < 1 || frames > 50 || nCel > frames) { |
| 439 | // app_fatal("Drawing dead player %d \"%s\": facing %d, frame %d of %d", i, p->_pName, p->_pdir, nCel, frame); |
| 440 | break; |
| 441 | } |
| 442 | dFlags[x][y] |= BFLAG_DEAD_PLAYER; |
| 443 | px = sx + p->_pxoff - p->_pAnimWidth2; |
| 444 | py = sy + p->_pyoff; |
| 445 | DrawPlayer(i, x, y, px, py, p->_pAnimData, p->_pAnimFrame, p->_pAnimWidth); |
| 446 | } |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | /** |
| 451 | * @brief Render an object sprite |
no test coverage detected