changeset 7882 | 308cab08d2f3 |
parent 7849 | 0a1c0af2c96c |
child 7928 | 63e18de69e50 |
7881:7838dbc8bbab | 7882:308cab08d2f3 |
---|---|
1374 uint x = TileX(tile) * TILE_SIZE + SignalPositions[side][pos].x; |
1374 uint x = TileX(tile) * TILE_SIZE + SignalPositions[side][pos].x; |
1375 uint y = TileY(tile) * TILE_SIZE + SignalPositions[side][pos].y; |
1375 uint y = TileY(tile) * TILE_SIZE + SignalPositions[side][pos].y; |
1376 |
1376 |
1377 SpriteID sprite; |
1377 SpriteID sprite; |
1378 |
1378 |
1379 /* _signal_base is set by our NewGRF Action 5 loader. If it is 0 then we |
1379 if (GetSignalType(tile, track) == SIGTYPE_NORMAL && GetSignalVariant(tile, track) == SIG_ELECTRIC) { |
1380 * just draw the standard signals, else we get the offset from _signal_base |
|
1381 * and draw that sprite. All the signal sprites are loaded sequentially. */ |
|
1382 if (_signal_base == 0 || (GetSignalType(tile, track) == SIGTYPE_NORMAL && GetSignalVariant(tile, track) == SIG_ELECTRIC)) { |
|
1383 sprite = SignalBase[side][GetSignalVariant(tile, track)][GetSignalType(tile, track)] + image + condition; |
1380 sprite = SignalBase[side][GetSignalVariant(tile, track)][GetSignalType(tile, track)] + image + condition; |
1384 } else { |
1381 } else { |
1385 sprite = _signal_base + (GetSignalType(tile, track) - 1) * 16 + GetSignalVariant(tile, track) * 64 + image + condition; |
1382 sprite = SPR_SIGNALS_BASE + (GetSignalType(tile, track) - 1) * 16 + GetSignalVariant(tile, track) * 64 + image + condition; |
1386 } |
1383 } |
1387 |
1384 |
1388 AddSortableSpriteToDraw(sprite, PAL_NONE, x, y, 1, 1, BB_HEIGHT_UNDER_BRIDGE, GetSaveSlopeZ(x, y, track)); |
1385 AddSortableSpriteToDraw(sprite, PAL_NONE, x, y, 1, 1, BB_HEIGHT_UNDER_BRIDGE, GetSaveSlopeZ(x, y, track)); |
1389 } |
1386 } |
1390 |
1387 |