Changeset - r24101:6898ff80efc8
[Not reviewed]
master
0 1 0
Niels Martin Hansen - 4 years ago 2020-02-09 19:24:56
nielsm@indvikleren.dk
Fix #7958: Use NewGRF provided catenary sprites when either front or back is overridden
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/tunnelbridge_cmd.cpp
Show inline comments
 
@@ -1118,18 +1118,18 @@ static void GetBridgeRoadCatenary(const 
 
	static const SpriteID back_offsets[6]  = { 95,  96,  99, 102, 100, 101 };
 
	static const SpriteID front_offsets[6] = { 97,  98, 103, 106, 104, 105 };
 

	
 
	/* Simplified from DrawRoadTypeCatenary() to remove all the special cases required for regular ground road */
 
	spr_back = GetCustomRoadSprite(rti, head_tile, ROTSG_CATENARY_BACK, head ? TCX_NORMAL : TCX_ON_BRIDGE);
 
	spr_front = GetCustomRoadSprite(rti, head_tile, ROTSG_CATENARY_FRONT, head ? TCX_NORMAL : TCX_ON_BRIDGE);
 
	if (spr_back == 0 || spr_front == 0) {
 
	if (spr_back == 0 && spr_front == 0) {
 
		spr_back = SPR_TRAMWAY_BASE + back_offsets[offset];
 
		spr_front = SPR_TRAMWAY_BASE + front_offsets[offset];
 
	} else {
 
		spr_back += 23 + offset;
 
		spr_front += 23 + offset;
 
		if (spr_back != 0) spr_back += 23 + offset;
 
		if (spr_front != 0) spr_front += 23 + offset;
 
	}
 
}
 

	
 
/**
 
 * Draws the road and trambits over an already drawn (lower end) of a bridge.
 
 * @param head_tile    bridge head tile with roadtype information
0 comments (0 inline, 0 general)