4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
10 /** @file tunnelbridge.h Header file for things common for tunnels and bridges */
12 #ifndef TUNNELBRIDGE_H
13 #define TUNNELBRIDGE_H
17 void MarkBridgeDirty(TileIndex begin
, TileIndex end
, DiagDirection direction
, uint bridge_height
);
18 void MarkBridgeDirty(TileIndex tile
);
21 * Calculates the length of a tunnel or a bridge (without end tiles)
22 * @param begin The begin of the tunnel or bridge.
23 * @param end The end of the tunnel or bridge.
24 * @return length of bridge/tunnel middle
26 static inline uint
GetTunnelBridgeLength(TileIndex begin
, TileIndex end
)
28 int x1
= TileX(begin
);
29 int y1
= TileY(begin
);
33 return abs(x2
+ y2
- x1
- y1
) - 1;
36 extern TileIndex _build_tunnel_endtile
;
38 #endif /* TUNNELBRIDGE_H */