bridge.h
author celestar
Sat, 30 Dec 2006 17:16:07 +0000
branchcustombridgeheads
changeset 5607 5169e3e15ce9
parent 5573 afa6f92a71fd
permissions -rw-r--r--
(svn r7652) [cbh] - Fix: On last commit, I messed up some check and trains could not longer leave the "on bridge" status. Oops.
2268
a28a946df64f (svn r2788) Fix Id tag
tron
parents: 2263
diff changeset
     1
/* $Id$ */
2262
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
     2
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
     3
/** @file bridge.h Header file for bridges */
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
     4
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
     5
#ifndef BRIDGE_H
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
     6
#define BRIDGE_H
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
     7
3359
d4316b1af327 (svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents: 3355
diff changeset
     8
enum {
d4316b1af327 (svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents: 3355
diff changeset
     9
	MAX_BRIDGES = 13
d4316b1af327 (svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents: 3355
diff changeset
    10
};
d4316b1af327 (svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents: 3355
diff changeset
    11
2262
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    12
/** Struct containing information about a single bridge type
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    13
 */
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    14
typedef struct Bridge {
4293
2c24234a7aec (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
rubidium
parents: 3977
diff changeset
    15
	Year avail_year;     ///< the year in which the bridge becomes available
2262
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    16
	byte min_length;     ///< the minimum length of the bridge (not counting start and end tile)
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    17
	byte max_length;     ///< the maximum length of the bridge (not counting start and end tile)
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    18
	uint16 price;        ///< the relative price of the bridge
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    19
	uint16 speed;        ///< maximum travel speed
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    20
	PalSpriteID sprite;  ///< the sprite which is used in the GUI (possibly with a recolor sprite)
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    21
	StringID material;   ///< the string that contains the bridge description
2478
16b05f1de6bb (svn r3004) -Feature, NewGRF: Support loading of bridge attributes and tables from GRF. Currently drawing tall pillars uses old data.
peter1138
parents: 2268
diff changeset
    22
	PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge
16b05f1de6bb (svn r3004) -Feature, NewGRF: Support loading of bridge attributes and tables from GRF. Currently drawing tall pillars uses old data.
peter1138
parents: 2268
diff changeset
    23
	byte flags;          ///< bit 0 set: disable drawing of far pillars.
2262
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    24
} Bridge;
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    25
2478
16b05f1de6bb (svn r3004) -Feature, NewGRF: Support loading of bridge attributes and tables from GRF. Currently drawing tall pillars uses old data.
peter1138
parents: 2268
diff changeset
    26
extern const Bridge orig_bridge[MAX_BRIDGES];
2763
d579caf58b59 (svn r3308) BAD
tron
parents: 2478
diff changeset
    27
extern Bridge _bridge[MAX_BRIDGES];
2262
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    28
3636
d87b21df2944 (svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
tron
parents: 3359
diff changeset
    29
uint GetBridgeFoundation(Slope tileh, Axis axis);
5573
afa6f92a71fd (svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents: 4293
diff changeset
    30
uint SetSpeedLimitOnBridge(Vehicle *);
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents: 2763
diff changeset
    31
2262
bd59b2d8d75f (svn r2782) -Codechange: Started cleaning the bridge code. Removed numerous global variables containing bridge information and joined them in a struct. Introduced GetBridgeType and GetBridgePiece and fixed some minor stuff (whitespace etc)
celestar
parents:
diff changeset
    32
#endif /* BRIDGE_H */