author | truebrain |
Sun, 15 Jun 2008 22:37:35 +0000 | |
branch | noai |
changeset 10972 | 986675d19245 |
parent 9732 | f8eb3e208514 |
child 11126 | 72d4c9314c72 |
permissions | -rw-r--r-- |
2268 | 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 |
|
9723
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9694
diff
changeset
|
8 |
#include "gfx_type.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9694
diff
changeset
|
9 |
#include "direction_type.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9694
diff
changeset
|
10 |
#include "tile_cmd.h" |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9694
diff
changeset
|
11 |
|
3359
d4316b1af327
(svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents:
3355
diff
changeset
|
12 |
enum { |
d4316b1af327
(svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents:
3355
diff
changeset
|
13 |
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
|
14 |
}; |
d4316b1af327
(svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents:
3355
diff
changeset
|
15 |
|
9732 | 16 |
typedef uint BridgeType; |
17 |
||
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
|
18 |
/** 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
|
19 |
*/ |
9732 | 20 |
struct BridgeSpec { |
21 |
Year avail_year; ///< the year where it becomes available |
|
22 |
byte min_length; ///< the minimum length (not counting start and end tile) |
|
23 |
byte max_length; ///< the maximum length (not counting start and end tile) |
|
24 |
uint16 price; ///< the price multiplier |
|
25 |
uint16 speed; ///< maximum travel speed |
|
26 |
SpriteID sprite; ///< the sprite which is used in the GUI |
|
27 |
SpriteID pal; ///< the palette which is used in the GUI |
|
28 |
StringID material; ///< the string that contains the bridge description |
|
29 |
StringID transport_name[2]; ///< description of the bridge, when built for road or rail |
|
30 |
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge |
|
31 |
byte flags; ///< bit 0 set: disable drawing of far pillars. |
|
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6486
diff
changeset
|
32 |
}; |
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
|
33 |
|
9732 | 34 |
extern BridgeSpec _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
|
35 |
|
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
6574
diff
changeset
|
36 |
Foundation GetBridgeFoundation(Slope tileh, Axis axis); |
9724
b39bc69bb2f2
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents:
9723
diff
changeset
|
37 |
bool HasBridgeFlatRamp(Slope tileh, Axis axis); |
6467 | 38 |
|
9732 | 39 |
static inline const BridgeSpec *GetBridgeSpec(BridgeType i) |
6467 | 40 |
{ |
41 |
assert(i < lengthof(_bridge)); |
|
42 |
return &_bridge[i]; |
|
43 |
} |
|
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
|
44 |
|
9694
e72987579514
(svn r10775) [NoAI] -Sync: with trunk r10535:r10774.
rubidium
parents:
6574
diff
changeset
|
45 |
void DrawBridgeMiddle(const TileInfo *ti); |
6486
4f8af35b11eb
(svn r8908) -Codechange: declaration of DrawBridgeMiddle does not belong in a map accessors header.
rubidium
parents:
6467
diff
changeset
|
46 |
|
9732 | 47 |
bool CheckBridge_Stuff(BridgeType bridge_type, uint bridge_len); |
9723
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9694
diff
changeset
|
48 |
int CalcBridgeLenCostFactor(int x); |
eee46cb39750
(svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents:
9694
diff
changeset
|
49 |
|
9732 | 50 |
void ResetBridges(); |
51 |
||
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
|
52 |
#endif /* BRIDGE_H */ |