OpenTTD
tunnelbridge.h
Go to the documentation of this file.
1 /* $Id: tunnelbridge.h 27157 2015-02-22 14:01:24Z frosch $ */
2 
3 /*
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/>.
8  */
9 
12 #ifndef TUNNELBRIDGE_H
13 #define TUNNELBRIDGE_H
14 
15 #include "map_func.h"
16 
17 void MarkBridgeDirty(TileIndex begin, TileIndex end, DiagDirection direction, uint bridge_height);
18 void MarkBridgeDirty(TileIndex tile);
19 
26 static inline uint GetTunnelBridgeLength(TileIndex begin, TileIndex end)
27 {
28  int x1 = TileX(begin);
29  int y1 = TileY(begin);
30  int x2 = TileX(end);
31  int y2 = TileY(end);
32 
33  return abs(x2 + y2 - x1 - y1) - 1;
34 }
35 
37 
38 #endif /* TUNNELBRIDGE_H */