Make sure we the custom track type based signals for bridges and tunnels also.

(cherry picked from commit 1dc478cb654f88eab3c760bdc9f305ce3f039ec3)
This commit is contained in:
keldorkatarn 2016-04-01 22:02:57 +02:00 committed by Jonathan G Rennison
parent 5cc56d6ad9
commit 4c37aad393

View File

@ -1190,14 +1190,21 @@ static void DrawTunnelBridgeRampSignal(const TileInfo *ti)
if (ti->tileh != SLOPE_FLAT && IsBridge(ti->tile)) z += 8; // sloped bridge head
SignalVariant variant = IsTunnelBridgeSemaphore(ti->tile) ? SIG_SEMAPHORE : SIG_ELECTRIC;
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile));
SpriteID sprite;
if (variant == SIG_ELECTRIC && type == SIGTYPE_NORMAL) {
/* Normal electric signals are picked from original sprites. */
sprite = SPR_ORIGINAL_SIGNALS_BASE + ((position << 1) + is_green);
SpriteID sprite = GetCustomSignalSprite(rti, ti->tile, type, variant, is_green ? SIGNAL_STATE_GREEN : SIGNAL_STATE_RED);
bool is_custom_sprite = (sprite != 0);
if (is_custom_sprite) {
sprite += position;
} else {
/* All other signals are picked from add on sprites. */
sprite = SPR_SIGNALS_BASE + ((type - 1) * 16 + variant * 64 + (position << 1) + is_green) + (IsSignalSpritePBS(type) ? 64 : 0);
if (variant == SIG_ELECTRIC && type == SIGTYPE_NORMAL) {
/* Normal electric signals are picked from original sprites. */
sprite = SPR_ORIGINAL_SIGNALS_BASE + ((position << 1) + is_green);
} else {
/* All other signals are picked from add on sprites. */
sprite = SPR_SIGNALS_BASE + ((type - 1) * 16 + variant * 64 + (position << 1) + is_green) + (IsSignalSpritePBS(type) ? 64 : 0);
}
}
AddSortableSpriteToDraw(sprite, PAL_NONE, x, y, 1, 1, TILE_HEIGHT, z, false, 0, 0, BB_Z_SEPARATOR);