|
@@ -1941,27 +1941,23 @@ static void DrawTile_Track(TileInfo *ti)
|
|
|
if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
|
|
|
|
|
|
if (HasSignals(ti->tile)) DrawSignals(ti->tile, rails);
|
|
|
} else {
|
|
|
/* draw depot */
|
|
|
const DrawTileSprites *dts;
|
|
|
const DrawTileSeqStruct *dtss;
|
|
|
uint32 relocation;
|
|
|
SpriteID pal = PAL_NONE;
|
|
|
|
|
|
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
|
|
|
|
|
|
if (IsInvisibilitySet(TO_BUILDINGS)) {
|
|
|
/* Draw rail instead of depot */
|
|
|
dts = &_depot_invisible_gfx_table[GetRailDepotDirection(ti->tile)];
|
|
|
} else {
|
|
|
dts = &_depot_gfx_table[GetRailDepotDirection(ti->tile)];
|
|
|
}
|
|
|
|
|
|
relocation = rti->total_offset;
|
|
|
|
|
|
image = dts->ground.sprite;
|
|
|
if (image != SPR_FLAT_GRASS_TILE) image += rti->total_offset;
|
|
|
|
|
|
/* adjust ground tile for desert
|
|
|
* don't adjust for snow, because snow in depots looks weird */
|
|
|
if (IsSnowRailGround(ti->tile) && _settings_game.game_creation.landscape == LT_TROPIC) {
|
|
@@ -1982,43 +1978,14 @@ static void DrawTile_Track(TileInfo *ti)
|
|
|
default: break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
|
|
|
|
|
|
foreach_draw_tile_seq(dtss, dts->seq) {
|
|
|
SpriteID image = dtss->image.sprite;
|
|
|
SpriteID pal = dtss->image.pal;
|
|
|
|
|
|
/* Stop drawing sprite sequence once we meet a sprite that doesn't have to be opaque */
|
|
|
if (IsInvisibilitySet(TO_BUILDINGS) && !HasBit(image, SPRITE_MODIFIER_OPAQUE)) return;
|
|
|
|
|
|
/* Unlike stations, our default waypoint has no variation for
|
|
|
* different railtype, so don't use the railtype offset if
|
|
|
* no relocation is set */
|
|
|
if (HasBit(image, SPRITE_MODIFIER_USE_OFFSET)) {
|
|
|
image += rti->total_offset;
|
|
|
} else {
|
|
|
image += relocation;
|
|
|
}
|
|
|
|
|
|
pal = SpriteLayoutPaletteTransform(image, pal, _drawtile_track_palette);
|
|
|
|
|
|
if ((byte)dtss->delta_z != 0x80) {
|
|
|
AddSortableSpriteToDraw(
|
|
|
image, pal,
|
|
|
ti->x + dtss->delta_x, ti->y + dtss->delta_y,
|
|
|
dtss->size_x, dtss->size_y,
|
|
|
dtss->size_z, ti->z + dtss->delta_z,
|
|
|
!HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS)
|
|
|
);
|
|
|
} else {
|
|
|
/* For stations and original spritelayouts delta_x and delta_y are signed */
|
|
|
AddChildSpriteScreen(image, pal, dtss->delta_x, dtss->delta_y, !HasBit(image, SPRITE_MODIFIER_OPAQUE) && IsTransparencySet(TO_BUILDINGS));
|
|
|
}
|
|
|
}
|
|
|
/* No NewGRF depots, so no relocation */
|
|
|
DrawStationTileSeq(ti, dts, TO_BUILDINGS, rti->total_offset, 0, _drawtile_track_palette);
|
|
|
}
|
|
|
DrawBridgeMiddle(ti);
|
|
|
}
|
|
|
|
|
|
|
|
|
static void DrawTileSequence(int x, int y, SpriteID ground, const DrawTileSeqStruct *dtss, uint32 offset)
|