* Draws a selection rectangle on a tile. * * @param ti TileInfo Tile that is being drawn * @param pal Palette to apply. */
| 912 | * @param pal Palette to apply. |
| 913 | */ |
| 914 | static void DrawTileSelectionRect(const TileInfo *ti, PaletteID pal) |
| 915 | { |
| 916 | if (!IsValidTile(ti->tile)) return; |
| 917 | |
| 918 | SpriteID sel; |
| 919 | if (IsHalftileSlope(ti->tileh)) { |
| 920 | Corner halftile_corner = GetHalftileSlopeCorner(ti->tileh); |
| 921 | SpriteID sel2 = SPR_HALFTILE_SELECTION_FLAT + halftile_corner; |
| 922 | DrawSelectionSprite(sel2, pal, ti, 7 + TILE_HEIGHT, FOUNDATION_PART_HALFTILE); |
| 923 | |
| 924 | Corner opposite_corner = OppositeCorner(halftile_corner); |
| 925 | if (IsSteepSlope(ti->tileh)) { |
| 926 | sel = SPR_HALFTILE_SELECTION_DOWN; |
| 927 | } else { |
| 928 | sel = ((ti->tileh & SlopeWithOneCornerRaised(opposite_corner)) != 0 ? SPR_HALFTILE_SELECTION_UP : SPR_HALFTILE_SELECTION_FLAT); |
| 929 | } |
| 930 | sel += opposite_corner; |
| 931 | } else { |
| 932 | sel = SPR_SELECT_TILE + SlopeToSpriteOffset(ti->tileh); |
| 933 | } |
| 934 | DrawSelectionSprite(sel, pal, ti, 7, FOUNDATION_PART_NORMAL); |
| 935 | } |
| 936 | |
| 937 | static bool IsPartOfAutoLine(int px, int py) |
| 938 | { |
no test coverage detected