Codechange: Use cached town, station, industry names for list window sorting
[openttd-github.git] / src / elrail_func.h
blob04384372413122687da041199c6456ca51255aca
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file elrail_func.h header file for electrified rail specific functions */
10 #ifndef ELRAIL_FUNC_H
11 #define ELRAIL_FUNC_H
13 #include "rail.h"
14 #include "tile_cmd.h"
15 #include "transparency.h"
17 /**
18 * Test if a rail type has catenary
19 * @param rt Rail type to test
21 static inline bool HasRailCatenary(RailType rt)
23 return HasBit(GetRailTypeInfo(rt)->flags, RTF_CATENARY);
26 /**
27 * Test if we should draw rail catenary
28 * @param rt Rail type to test
30 static inline bool HasRailCatenaryDrawn(RailType rt)
32 return HasRailCatenary(rt) && !IsInvisibilitySet(TO_CATENARY) && !_settings_game.vehicle.disable_elrails;
35 void DrawRailCatenary(const TileInfo *ti);
36 void DrawRailCatenaryOnTunnel(const TileInfo *ti);
37 void DrawRailCatenaryOnBridge(const TileInfo *ti);
39 bool SettingsDisableElrail(int32 p1); ///< _settings_game.disable_elrail callback
41 #endif /* ELRAIL_FUNC_H */