* Draws sprites between ground sprite and everything above. * * The sprite is either drawn as TileSprite or as ChildSprite of the active foundation. * * @param image the image to draw. * @param pal the provided palette. * @param ti TileInfo Tile that is being drawn * @param z_offset Z offset relative to the groundsprite. Only used for the sprite position, not for sprite sorting. * @param f
| 895 | * @param extra_offs_y Pixel Y offset for the sprite position. |
| 896 | */ |
| 897 | static void DrawSelectionSprite(SpriteID image, PaletteID pal, const TileInfo *ti, int z_offset, FoundationPart foundation_part, int extra_offs_x = 0, int extra_offs_y = 0) |
| 898 | { |
| 899 | if (_vd.foundation[foundation_part] == -1) { |
| 900 | /* draw on real ground */ |
| 901 | AddTileSpriteToDraw(image, pal, ti->x, ti->y, ti->z + z_offset, nullptr, extra_offs_x, extra_offs_y); |
| 902 | } else { |
| 903 | /* draw on top of foundation */ |
| 904 | AddChildSpriteToFoundation(image, pal, nullptr, foundation_part, extra_offs_x, extra_offs_y - z_offset * ZOOM_BASE); |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | /** |
| 909 | * Draws a selection rectangle on a tile. |
no test coverage detected