* Draw an group of sprites on the map. * @param ti Information about the tile to draw on. * @param dts The sprite layout to draw. * @param spec Object spec to draw. */
| 445 | * @param spec Object spec to draw. |
| 446 | */ |
| 447 | static void DrawTileLayout(const TileInfo *ti, const DrawTileSpriteSpan &dts, const ObjectSpec *spec) |
| 448 | { |
| 449 | PaletteID palette = (spec->flags.Test(ObjectFlag::Uses2CC) ? SPR_2CCMAP_BASE : PALETTE_RECOLOUR_START) + Object::GetByTile(ti->tile)->colour; |
| 450 | |
| 451 | SpriteID image = dts.ground.sprite; |
| 452 | PaletteID pal = dts.ground.pal; |
| 453 | |
| 454 | if (GB(image, 0, SPRITE_WIDTH) != 0) { |
| 455 | /* If the ground sprite is the default flat water sprite, draw also canal/river borders |
| 456 | * Do not do this if the tile's WaterClass is 'land'. */ |
| 457 | if ((image == SPR_FLAT_WATER_TILE || spec->flags.Test(ObjectFlag::DrawWater)) && IsTileOnWater(ti->tile)) { |
| 458 | DrawWaterClassGround(ti); |
| 459 | } else { |
| 460 | DrawGroundSprite(image, GroundSpritePaletteTransform(image, pal, palette)); |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | DrawNewGRFTileSeq(ti, &dts, TO_STRUCTURES, 0, palette); |
| 465 | } |
| 466 | |
| 467 | /** |
| 468 | * Draw an object on the map. |
no test coverage detected