|
@@ -788,26 +788,34 @@ static void DrawBridgeTramBits(int x, in
|
|
|
static const uint front_bb_offset_x[6] = { 15, 0, 0, 15, 0, 15 };
|
|
|
static const uint front_bb_offset_y[6] = { 0, 15, 15, 0, 15, 0 };
|
|
|
|
|
|
/* The sprites under the vehicles are drawn as SpriteCombine. StartSpriteCombine() has already been called
|
|
|
* The bounding boxes here are the same as for bridge front/roof */
|
|
|
if (head || !IsInvisibilitySet(TO_BRIDGES)) {
|
|
|
AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, !head && IsTransparencySet(TO_BRIDGES));
|
|
|
AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + tram_offsets[overlay][offset], PAL_NONE,
|
|
|
x, y, size_x[offset], size_y[offset], 0x28, z,
|
|
|
!head && IsTransparencySet(TO_BRIDGES));
|
|
|
}
|
|
|
|
|
|
/* Do not draw catenary if it is set invisible */
|
|
|
if (IsInvisibilitySet(TO_CATENARY)) return;
|
|
|
|
|
|
AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + back_offsets[offset], PAL_NONE, x, y, size_x[offset], size_y[offset], 0x28, z, IsTransparencySet(TO_CATENARY));
|
|
|
if (!IsInvisibilitySet(TO_CATENARY)) {
|
|
|
AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + back_offsets[offset], PAL_NONE,
|
|
|
x, y, size_x[offset], size_y[offset], 0x28, z,
|
|
|
IsTransparencySet(TO_CATENARY));
|
|
|
}
|
|
|
|
|
|
/* Start a new SpriteCombine for the front part */
|
|
|
EndSpriteCombine();
|
|
|
StartSpriteCombine();
|
|
|
|
|
|
/* For sloped sprites the bounding box needs to be higher, as the pylons stop on a higher point */
|
|
|
AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + front_offsets[offset], PAL_NONE, x, y, size_x[offset] + front_bb_offset_x[offset], size_y[offset] + front_bb_offset_y[offset], 0x28, z, IsTransparencySet(TO_CATENARY), front_bb_offset_x[offset], front_bb_offset_y[offset]);
|
|
|
if (!IsInvisibilitySet(TO_CATENARY)) {
|
|
|
AddSortableSpriteToDraw(SPR_TRAMWAY_BASE + front_offsets[offset], PAL_NONE,
|
|
|
x, y, size_x[offset] + front_bb_offset_x[offset], size_y[offset] + front_bb_offset_y[offset], 0x28, z,
|
|
|
IsTransparencySet(TO_CATENARY), front_bb_offset_x[offset], front_bb_offset_y[offset]);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Draws a tunnel of bridge tile.
|
|
|
* For tunnels, this is rather simple, as you only needa draw the entrance.
|
|
|
* Bridges are a bit more complex. base_offset is where the sprite selection comes into play
|