* @brief Draw item for a given tile * @param out Output buffer * @param tilePosition dPiece coordinates * @param targetBufferPosition Output buffer coordinates * @param pre Is the sprite in the background */
| 681 | * @param pre Is the sprite in the background |
| 682 | */ |
| 683 | void DrawItem(const Surface &out, Point tilePosition, Point targetBufferPosition, bool pre) |
| 684 | { |
| 685 | int8_t bItem = dItem[tilePosition.x][tilePosition.y]; |
| 686 | |
| 687 | if (bItem <= 0) |
| 688 | return; |
| 689 | |
| 690 | auto &item = Items[bItem - 1]; |
| 691 | if (item._iPostDraw == pre) |
| 692 | return; |
| 693 | |
| 694 | const ClxSprite sprite = item.AnimInfo.currentSprite(); |
| 695 | int px = targetBufferPosition.x - CalculateWidth2(sprite.width()); |
| 696 | const Point position { px, targetBufferPosition.y }; |
| 697 | if (stextflag == TalkID::None && (bItem - 1 == pcursitem || AutoMapShowItems)) { |
| 698 | ClxDrawOutlineSkipColorZero(out, GetOutlineColor(item, false), position, sprite); |
| 699 | } |
| 700 | ClxDrawLight(out, position, sprite, LightTableIndex); |
| 701 | if (item.AnimInfo.isLastFrame() || item._iCurs == ICURS_MAGIC_ROCK) |
| 702 | AddItemToLabelQueue(bItem - 1, position); |
| 703 | } |
| 704 | |
| 705 | /** |
| 706 | * @brief Check if and how a monster should be rendered |
no test coverage detected