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,8 +1190,14 @@ static void DrawTunnelBridgeRampSignal(const TileInfo *ti)
if (ti->tileh != SLOPE_FLAT && IsBridge(ti->tile)) z += 8; // sloped bridge head if (ti->tileh != SLOPE_FLAT && IsBridge(ti->tile)) z += 8; // sloped bridge head
SignalVariant variant = IsTunnelBridgeSemaphore(ti->tile) ? SIG_SEMAPHORE : SIG_ELECTRIC; SignalVariant variant = IsTunnelBridgeSemaphore(ti->tile) ? SIG_SEMAPHORE : SIG_ELECTRIC;
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(ti->tile));
SpriteID sprite; 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 {
if (variant == SIG_ELECTRIC && type == SIGTYPE_NORMAL) { if (variant == SIG_ELECTRIC && type == SIGTYPE_NORMAL) {
/* Normal electric signals are picked from original sprites. */ /* Normal electric signals are picked from original sprites. */
sprite = SPR_ORIGINAL_SIGNALS_BASE + ((position << 1) + is_green); sprite = SPR_ORIGINAL_SIGNALS_BASE + ((position << 1) + is_green);
@@ -1199,6 +1205,7 @@ static void DrawTunnelBridgeRampSignal(const TileInfo *ti)
/* All other signals are picked from add on sprites. */ /* 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); 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); AddSortableSpriteToDraw(sprite, PAL_NONE, x, y, 1, 1, TILE_HEIGHT, z, false, 0, 0, BB_Z_SEPARATOR);
} }