(svn r12111) -Codechange: Rename Bridge to BridgeSpec, out of consistensy with other Specs in used.

pull/155/head
belugas 17 years ago
parent a9ce2a7122
commit 6a717aa49b

@ -17,7 +17,7 @@ typedef uint BridgeType;
/** 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 @@ struct Bridge {
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];

@ -79,7 +79,7 @@ static void BuildBridgeWndProc(Window *w, WindowEvent *e)
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 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, byte bridge_type)
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);

@ -1177,7 +1177,7 @@ static bool BridgeChangeInfo(uint brid, int numinfo, int prop, byte **bufp, int
}
for (int i = 0; i < numinfo; i++) {
Bridge *bridge = &_bridge[brid + i];
BridgeSpec *bridge = &_bridge[brid + i];
switch (prop) {
case 0x08: // Year of availability

@ -723,7 +723,7 @@ static const PalSpriteID * const * const _bridge_sprite_table[MAX_BRIDGES] = {
#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

@ -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 @@ bool HasBridgeFlatRamp(Slope tileh, Axis axis)
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 @@ static CommandCost CheckBridgeSlopeSouth(Axis axis, Slope *tileh, uint *z)
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;

Loading…
Cancel
Save