Changeset - r3231:d8ffea4d8937
[Not reviewed]
master
0 2 0
tron - 18 years ago 2006-03-16 10:00:50
tron@openttd.org
(svn r3904) Move GetBridgePiece() and GetBridgeType() to bridge_map.h and make the only place which still extracted that info diretly use the wrapper
2 files changed with 22 insertions and 20 deletions:
0 comments (0 inline, 0 general)
bridge_map.h
Show inline comments
 
@@ -21,6 +21,27 @@ static inline bool IsBridgeMiddle(TileIn
 
}
 

	
 

	
 
/**
 
 * Determines which piece of a bridge is contained in the current tile
 
 * @param tile The tile to analyze
 
 * @return the piece
 
 */
 
static inline uint GetBridgePiece(TileIndex tile)
 
{
 
	return GB(_m[tile].m2, 0, 4);
 
}
 

	
 

	
 
/**
 
 * Determines the type of bridge on a tile
 
 * @param tile The tile to analyze
 
 * @return The bridge type
 
 */
 
static inline uint GetBridgeType(TileIndex tile)
 
{
 
	return GB(_m[tile].m2, 4, 4);
 
}
 

	
 

	
 
/**
 
 * Get the direction pointing onto the bridge
tunnelbridge_cmd.c
Show inline comments
 
@@ -97,25 +97,6 @@ static inline const PalSpriteID *GetBrid
 
	}
 
}
 

	
 
/**
 
 * Determines which piece of a bridge is contained in the current tile
 
 * @param tile The tile to analyze
 
 * @return the piece
 
 */
 
static inline int GetBridgePiece(TileIndex tile)
 
{
 
	return GB(_m[tile].m2, 0, 4);
 
}
 

	
 
/**
 
 * Determines the type of bridge on a tile
 
 * @param tile The tile to analyze
 
 * @return The bridge type
 
 */
 
static inline int GetBridgeType(TileIndex tile)
 
{
 
	return GB(_m[tile].m2, 4, 4);
 
}
 

	
 
/**	check if bridge can be built on slope
 
 *	direction 0 = X-axis, direction 1 = Y-axis
 
@@ -1215,7 +1196,7 @@ static void GetTileDesc_TunnelBridge(Til
 
		td->str = (GetTunnelTransportType(tile) == TRANSPORT_RAIL) ?
 
			STR_5017_RAILROAD_TUNNEL : STR_5018_ROAD_TUNNEL;
 
	} else {
 
		td->str = _bridge_tile_str[GB(_m[tile].m5, 1, 2) << 4 | GB(_m[tile].m2, 4, 4)];
 
		td->str = _bridge_tile_str[GB(_m[tile].m5, 1, 2) << 4 | GetBridgeType(tile)];
 

	
 
		// the owner is stored at the end of the bridge
 
		if (IsBridgeMiddle(tile)) tile = GetSouthernBridgeEnd(tile);
0 comments (0 inline, 0 general)