author | belugas |
Wed, 23 Jan 2008 17:40:37 +0000 | |
changeset 8393 | a0ab817a8b73 |
parent 8379 | 94fcc26a241a |
child 8398 | 1e181e2e4e15 |
permissions | -rw-r--r-- |
2268 | 1 |
/* $Id$ */ |
2262
252cfd94c54d
(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 |
|
252cfd94c54d
(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 */ |
252cfd94c54d
(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 |
|
252cfd94c54d
(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 |
252cfd94c54d
(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 |
252cfd94c54d
(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 |
|
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8119
diff
changeset
|
8 |
#include "gfx_type.h" |
8222
ce0457729295
(svn r11785) -Codechange: remove some unneeded includes.
rubidium
parents:
8138
diff
changeset
|
9 |
#include "direction_type.h" |
8138
dbfdc08fa6b9
(svn r11700) -Codechange: reduce the amount of unnecessary includes.
rubidium
parents:
8123
diff
changeset
|
10 |
#include "tile_cmd.h" |
8123
ce31d2843a95
(svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents:
8119
diff
changeset
|
11 |
|
3359
633290bf1117
(svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents:
3355
diff
changeset
|
12 |
enum { |
633290bf1117
(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 |
633290bf1117
(svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents:
3355
diff
changeset
|
14 |
}; |
633290bf1117
(svn r4154) -Moved MAX_BRIDGES in bridge.h and made it an enum. This makes two drops ...
celestar
parents:
3355
diff
changeset
|
15 |
|
2262
252cfd94c54d
(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 |
/** Struct containing information about a single bridge type |
252cfd94c54d
(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 |
*/ |
6248
e4a2ed7e5613
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6160
diff
changeset
|
18 |
struct Bridge { |
4293
4b7006c1b5eb
(svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
rubidium
parents:
3977
diff
changeset
|
19 |
Year avail_year; ///< the year in which the bridge becomes available |
2262
252cfd94c54d
(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 |
byte min_length; ///< the minimum length of the bridge (not counting start and end tile) |
252cfd94c54d
(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 |
byte max_length; ///< the maximum length of the bridge (not counting start and end tile) |
252cfd94c54d
(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
|
22 |
uint16 price; ///< the relative price of the bridge |
252cfd94c54d
(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
|
23 |
uint16 speed; ///< maximum travel speed |
5668
36b39f4a9032
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents:
5475
diff
changeset
|
24 |
SpriteID sprite; ///< the sprite which is used in the GUI |
36b39f4a9032
(svn r8128) -Codechange: Split sprite and palette remap into separate 32 bit values.
peter1138
parents:
5475
diff
changeset
|
25 |
SpriteID pal; ///< the palette which is used in the GUI |
2262
252cfd94c54d
(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
|
26 |
StringID material; ///< the string that contains the bridge description |
2478
cd6a02ba3853
(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
|
27 |
PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge |
cd6a02ba3853
(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
|
28 |
byte flags; ///< bit 0 set: disable drawing of far pillars. |
6248
e4a2ed7e5613
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6160
diff
changeset
|
29 |
}; |
2262
252cfd94c54d
(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
|
30 |
|
2478
cd6a02ba3853
(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
|
31 |
extern const Bridge orig_bridge[MAX_BRIDGES]; |
2763 | 32 |
extern Bridge _bridge[MAX_BRIDGES]; |
2262
252cfd94c54d
(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 |
|
7335
141c6b86ec1f
(svn r10698) -Codechange [FS#1082]: simplify the code related to foundations. Primarily removal of (duplicated|magic) code and introduction of few helper functions to ease foundation determination. Patch by frosch.
rubidium
parents:
7318
diff
changeset
|
34 |
Foundation GetBridgeFoundation(Slope tileh, Axis axis); |
8379
94fcc26a241a
(svn r11946) -Fix: slope detection of bridge ramps.
frosch
parents:
8222
diff
changeset
|
35 |
bool HasBridgeFlatRamp(Slope tileh, Axis axis); |
6141 | 36 |
|
37 |
static inline const Bridge *GetBridge(uint i) |
|
38 |
{ |
|
39 |
assert(i < lengthof(_bridge)); |
|
40 |
return &_bridge[i]; |
|
41 |
} |
|
3355
e414a0b104a6
(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
|
42 |
|
7318
632cd0497770
(svn r10673) -Cleanup: some assorted style cleanups. Primarily type* var -> type *var.
rubidium
parents:
6248
diff
changeset
|
43 |
void DrawBridgeMiddle(const TileInfo *ti); |
6160
fa42299e967e
(svn r8908) -Codechange: declaration of DrawBridgeMiddle does not belong in a map accessors header.
rubidium
parents:
6141
diff
changeset
|
44 |
|
8119
52b48108425a
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium
parents:
7335
diff
changeset
|
45 |
bool CheckBridge_Stuff(byte bridge_type, uint bridge_len); |
52b48108425a
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium
parents:
7335
diff
changeset
|
46 |
uint32 GetBridgeLength(TileIndex begin, TileIndex end); |
52b48108425a
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium
parents:
7335
diff
changeset
|
47 |
int CalcBridgeLenCostFactor(int x); |
52b48108425a
(svn r11680) -Codechange: refactor more out of openttd.h and functions.h.
rubidium
parents:
7335
diff
changeset
|
48 |
|
2262
252cfd94c54d
(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
|
49 |
#endif /* BRIDGE_H */ |