10513
|
1 |
/* $Id$ */
|
|
2 |
|
|
3 |
/** @file elrail_func.h header file for electrified rail specific functions */
|
|
4 |
|
|
5 |
#ifndef ELRAIL_FUNC_H
|
|
6 |
#define ELRAIL_FUNC_H
|
|
7 |
|
|
8 |
#include "rail.h"
|
|
9 |
#include "transparency.h"
|
|
10 |
#include "tile_cmd.h"
|
|
11 |
#include "settings_type.h"
|
|
12 |
|
|
13 |
/**
|
|
14 |
* Test if a rail type has catenary
|
|
15 |
* @param rt Rail type to test
|
|
16 |
*/
|
|
17 |
static inline bool HasCatenary(RailType rt)
|
|
18 |
{
|
|
19 |
return HasBit(GetRailTypeInfo(rt)->flags, RTF_CATENARY);
|
|
20 |
}
|
|
21 |
|
|
22 |
/**
|
|
23 |
* Test if we should draw rail catenary
|
|
24 |
* @param rt Rail type to test
|
|
25 |
*/
|
|
26 |
static inline bool HasCatenaryDrawn(RailType rt)
|
|
27 |
{
|
10776
|
28 |
return HasCatenary(rt) && !IsInvisibilitySet(TO_CATENARY) && !_settings_game.vehicle.disable_elrails;
|
10513
|
29 |
}
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Draws overhead wires and pylons for electric railways.
|
|
33 |
* @param ti The TileInfo struct of the tile being drawn
|
|
34 |
* @see DrawCatenaryRailway
|
|
35 |
*/
|
|
36 |
void DrawCatenary(const TileInfo *ti);
|
|
37 |
void DrawCatenaryOnTunnel(const TileInfo *ti);
|
|
38 |
void DrawCatenaryOnBridge(const TileInfo *ti);
|
|
39 |
|
10776
|
40 |
int32 SettingsDisableElrail(int32 p1); ///< _settings_game.disable_elrail callback
|
10513
|
41 |
|
|
42 |
#endif /* ELRAIL_FUNC_H */
|