2008-05-08 16:48:29 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/** @file elrail_func.h header file for electrified rail specific functions */
|
|
|
|
|
|
|
|
#ifndef ELRAIL_FUNC_H
|
|
|
|
#define ELRAIL_FUNC_H
|
|
|
|
|
|
|
|
#include "rail.h"
|
|
|
|
#include "transparency.h"
|
|
|
|
#include "tile_cmd.h"
|
|
|
|
#include "settings_type.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test if a rail type has catenary
|
|
|
|
* @param rt Rail type to test
|
|
|
|
*/
|
|
|
|
static inline bool HasCatenary(RailType rt)
|
|
|
|
{
|
|
|
|
return HasBit(GetRailTypeInfo(rt)->flags, RTF_CATENARY);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test if we should draw rail catenary
|
|
|
|
* @param rt Rail type to test
|
|
|
|
*/
|
|
|
|
static inline bool HasCatenaryDrawn(RailType rt)
|
|
|
|
{
|
2008-05-29 15:13:28 +00:00
|
|
|
return HasCatenary(rt) && !IsInvisibilitySet(TO_CATENARY) && !_settings_game.vehicle.disable_elrails;
|
2008-05-08 16:48:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draws overhead wires and pylons for electric railways.
|
|
|
|
* @param ti The TileInfo struct of the tile being drawn
|
|
|
|
* @see DrawCatenaryRailway
|
|
|
|
*/
|
|
|
|
void DrawCatenary(const TileInfo *ti);
|
|
|
|
void DrawCatenaryOnTunnel(const TileInfo *ti);
|
|
|
|
void DrawCatenaryOnBridge(const TileInfo *ti);
|
|
|
|
|
2009-02-04 15:01:37 +00:00
|
|
|
bool SettingsDisableElrail(int32 p1); ///< _settings_game.disable_elrail callback
|
2008-05-08 16:48:29 +00:00
|
|
|
|
|
|
|
#endif /* ELRAIL_FUNC_H */
|