changeset 8535:c026695bee6c draft

(svn r12111) -Codechange: Rename Bridge to BridgeSpec, out of consistensy with other Specs in used.
author belugas <belugas@openttd.org>
date Mon, 11 Feb 2008 17:35:15 +0000
parents e1fe0fc60347
children 9876aef655b0
files src/bridge.h src/bridge_gui.cpp src/newgrf.cpp src/table/bridge_land.h src/tunnelbridge_cmd.cpp
diffstat 5 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/bridge.h
+++ b/src/bridge.h
@@ -17,7 +17,7 @@
 
 /** Struct containing information about a single bridge type
  */
-struct Bridge {
+struct BridgeSpec {
 	Year avail_year;     ///< the year where it becomes available
 	byte min_length;     ///< the minimum length (not counting start and end tile)
 	byte max_length;     ///< the maximum length (not counting start and end tile)
@@ -32,12 +32,12 @@
 	byte flags;          ///< bit 0 set: disable drawing of far pillars.
 };
 
-extern Bridge _bridge[MAX_BRIDGES];
+extern BridgeSpec _bridge[MAX_BRIDGES];
 
 Foundation GetBridgeFoundation(Slope tileh, Axis axis);
 bool HasBridgeFlatRamp(Slope tileh, Axis axis);
 
-static inline const Bridge *GetBridgeSpec(BridgeType i)
+static inline const BridgeSpec *GetBridgeSpec(BridgeType i)
 {
 	assert(i < lengthof(_bridge));
 	return &_bridge[i];
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -79,7 +79,7 @@
 
 			uint y = 15;
 			for (uint i = 0; (i < w->vscroll.cap) && ((i + w->vscroll.pos) < _bridgedata.count); i++) {
-				const Bridge *b = GetBridgeSpec(_bridgedata.indexes[i + w->vscroll.pos]);
+				const BridgeSpec *b = GetBridgeSpec(_bridgedata.indexes[i + w->vscroll.pos]);
 
 				SetDParam(2, _bridgedata.costs[i + w->vscroll.pos]);
 				SetDParam(1, b->speed * 10 / 16);
@@ -191,7 +191,7 @@
 		for (BridgeType brd_type = 0; brd_type != MAX_BRIDGES; brd_type++) {
 			if (CheckBridge_Stuff(brd_type, bridge_len)) {
 				/* bridge is accepted, add to list */
-				const Bridge *b = GetBridgeSpec(brd_type);
+				const BridgeSpec *b = GetBridgeSpec(brd_type);
 				/* Add to terraforming & bulldozing costs the cost of the
 				 * bridge itself (not computed with DC_QUERY_COST) */
 				_bridgedata.costs[j] = ret.GetCost() + (((int64)tot_bridgedata_len * _price.build_bridge * b->price) >> 8);
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -1177,7 +1177,7 @@
 	}
 
 	for (int i = 0; i < numinfo; i++) {
-		Bridge *bridge = &_bridge[brid + i];
+		BridgeSpec *bridge = &_bridge[brid + i];
 
 		switch (prop) {
 			case 0x08: // Year of availability
--- a/src/table/bridge_land.h
+++ b/src/table/bridge_land.h
@@ -723,7 +723,7 @@
 #define MB(y, mnl, mxl, p, mxs, spr, plt, dsc, nrl, nrd) \
 	{y, mnl, mxl, p, mxs, spr, plt, dsc, nrl, nrd, NULL, 0}
 
-const Bridge _orig_bridge[] = {
+const BridgeSpec _orig_bridge[] = {
 /*
 	       year of availablity
 	       |  minimum length
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -38,7 +38,7 @@
 #include "table/strings.h"
 #include "table/bridge_land.h"
 
-Bridge _bridge[MAX_BRIDGES];
+BridgeSpec _bridge[MAX_BRIDGES];
 
 /** Reset the data been eventually changed by the grf loaded. */
 void ResetBridges()
@@ -99,7 +99,7 @@
 
 static inline const PalSpriteID *GetBridgeSpriteTable(int index, byte table)
 {
-	const Bridge *bridge = GetBridgeSpec(index);
+	const BridgeSpec *bridge = GetBridgeSpec(index);
 	assert(table < 7);
 	if (bridge->sprite_table == NULL || bridge->sprite_table[table] == NULL) {
 		return _bridge_sprite_table[index][table];
@@ -153,7 +153,7 @@
 
 bool CheckBridge_Stuff(BridgeType bridge_type, uint bridge_len)
 {
-	const Bridge *b = GetBridgeSpec(bridge_type);
+	const BridgeSpec *b = GetBridgeSpec(bridge_type);
 	uint max; // max possible length of a bridge (with patch 100)
 
 	if (bridge_type >= MAX_BRIDGES) return false;