mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
(svn r20423) -Change [FS#3947]: Make snow on bridges depend on bridgeheight.
This commit is contained in:
parent
b6cf38a912
commit
7f1425c333
@ -503,14 +503,14 @@ void DrawCatenaryOnBridge(const TileInfo *ti)
|
||||
|
||||
height = GetBridgeHeight(end);
|
||||
|
||||
SpriteID wire_base = GetWireBase(end);
|
||||
SpriteID wire_base = GetWireBase(end, TC_ON_BRIDGE);
|
||||
|
||||
AddSortableSpriteToDraw(wire_base + sss->image_offset, PAL_NONE, ti->x + sss->x_offset, ti->y + sss->y_offset,
|
||||
sss->x_size, sss->y_size, sss->z_size, height + sss->z_offset,
|
||||
IsTransparencySet(TO_CATENARY)
|
||||
);
|
||||
|
||||
SpriteID pylon_base = GetPylonBase(end);
|
||||
SpriteID pylon_base = GetPylonBase(end, TC_ON_BRIDGE);
|
||||
|
||||
/* Finished with wires, draw pylons
|
||||
* every other tile needs a pylon on the northern end */
|
||||
|
@ -333,9 +333,13 @@ uint32 GetTerrainType(TileIndex tile, TileContext context)
|
||||
}
|
||||
|
||||
case MP_TUNNELBRIDGE:
|
||||
/* During map generation the snowstate may not be valid yet, as the tileloop may not have run yet. */
|
||||
if (_generating_world) goto genworld; // we do not care about foundations here
|
||||
has_snow = HasTunnelBridgeSnowOrDesert(tile);
|
||||
if (context == TC_ON_BRIDGE) {
|
||||
has_snow = (GetBridgeHeight(tile) > GetSnowLine());
|
||||
} else {
|
||||
/* During map generation the snowstate may not be valid yet, as the tileloop may not have run yet. */
|
||||
if (_generating_world) goto genworld; // we do not care about foundations here
|
||||
has_snow = HasTunnelBridgeSnowOrDesert(tile);
|
||||
}
|
||||
break;
|
||||
|
||||
case MP_STATION:
|
||||
|
@ -21,6 +21,7 @@
|
||||
enum TileContext {
|
||||
TC_NORMAL, ///< Nothing special.
|
||||
TC_UPPER_HALFTILE, ///< Querying information about the upper part of a tile with halftile foundation.
|
||||
TC_ON_BRIDGE, ///< Querying information about stuff on the bridge (via some bridgehead).
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1253,7 +1253,7 @@ void DrawBridgeMiddle(const TileInfo *ti)
|
||||
} else if (transport_type == TRANSPORT_RAIL) {
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(GetRailType(rampsouth));
|
||||
if (rti->UsesOverlay()) {
|
||||
SpriteID surface = GetCustomRailSprite(rti, rampsouth, RTSG_BRIDGE);
|
||||
SpriteID surface = GetCustomRailSprite(rti, rampsouth, RTSG_BRIDGE, TC_ON_BRIDGE);
|
||||
if (surface != 0) {
|
||||
AddSortableSpriteToDraw(surface + axis, PAL_NONE, x, y, 16, 16, 0, bridge_z, IsTransparencySet(TO_BRIDGES));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user