# HG changeset patch # User belugas # Date 1202751315 0 # Node ID ef36a2eb934554355bfcdfcd4d44ff8729d93cbc # Parent 5d05519d1c501ef8c94e189ea9c4c6f854fa2771 (svn r12111) -Codechange: Rename Bridge to BridgeSpec, out of consistensy with other Specs in used. diff -r 5d05519d1c50 -r ef36a2eb9345 src/bridge.h --- a/src/bridge.h Mon Feb 11 12:42:49 2008 +0000 +++ b/src/bridge.h Mon Feb 11 17:35:15 2008 +0000 @@ -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]; diff -r 5d05519d1c50 -r ef36a2eb9345 src/bridge_gui.cpp --- a/src/bridge_gui.cpp Mon Feb 11 12:42:49 2008 +0000 +++ b/src/bridge_gui.cpp Mon Feb 11 17:35:15 2008 +0000 @@ -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); diff -r 5d05519d1c50 -r ef36a2eb9345 src/newgrf.cpp --- a/src/newgrf.cpp Mon Feb 11 12:42:49 2008 +0000 +++ b/src/newgrf.cpp Mon Feb 11 17:35:15 2008 +0000 @@ -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 diff -r 5d05519d1c50 -r ef36a2eb9345 src/table/bridge_land.h --- a/src/table/bridge_land.h Mon Feb 11 12:42:49 2008 +0000 +++ b/src/table/bridge_land.h Mon Feb 11 17:35:15 2008 +0000 @@ -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 diff -r 5d05519d1c50 -r ef36a2eb9345 src/tunnelbridge_cmd.cpp --- a/src/tunnelbridge_cmd.cpp Mon Feb 11 12:42:49 2008 +0000 +++ b/src/tunnelbridge_cmd.cpp Mon Feb 11 17:35:15 2008 +0000 @@ -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;