2008-05-08 16:48:29 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
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 */
|