2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-08 16:48:29 +00:00
|
|
|
/** @file elrail_func.h header file for electrified rail specific functions */
|
|
|
|
|
|
|
|
#ifndef ELRAIL_FUNC_H
|
|
|
|
#define ELRAIL_FUNC_H
|
|
|
|
|
|
|
|
#include "rail.h"
|
|
|
|
#include "tile_cmd.h"
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "transparency.h"
|
2008-05-08 16:48:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test if a rail type has catenary
|
|
|
|
* @param rt Rail type to test
|
|
|
|
*/
|
2016-11-05 11:53:03 +00:00
|
|
|
static inline bool HasRailCatenary(RailType rt)
|
2008-05-08 16:48:29 +00:00
|
|
|
{
|
|
|
|
return HasBit(GetRailTypeInfo(rt)->flags, RTF_CATENARY);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test if we should draw rail catenary
|
|
|
|
* @param rt Rail type to test
|
|
|
|
*/
|
2016-11-05 11:53:03 +00:00
|
|
|
static inline bool HasRailCatenaryDrawn(RailType rt)
|
2008-05-08 16:48:29 +00:00
|
|
|
{
|
2016-11-05 11:53:03 +00:00
|
|
|
return HasRailCatenary(rt) && !IsInvisibilitySet(TO_CATENARY) && !_settings_game.vehicle.disable_elrails;
|
2008-05-08 16:48:29 +00:00
|
|
|
}
|
|
|
|
|
2016-11-05 11:53:03 +00:00
|
|
|
void DrawRailCatenary(const TileInfo *ti);
|
|
|
|
void DrawRailCatenaryOnTunnel(const TileInfo *ti);
|
|
|
|
void DrawRailCatenaryOnBridge(const TileInfo *ti);
|
2008-05-08 16:48:29 +00:00
|
|
|
|
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 */
|