OpenTTD: src/water.h Source File

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

water.h
Go to the documentation of this file.
1 /* $Id: water.h 25229 2013-05-06 20:48:18Z planetmaker $ */
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 WATER_H
13 #define WATER_H
14
15 #include "water_map.h"
16 #include "economy_func.h"
17
21 enum FloodingBehaviour {
22 FLOOD_NONE,
23 FLOOD_ACTIVE,
24 FLOOD_PASSIVE,
25 FLOOD_DRYUP,
26 };
27
28 FloodingBehaviour GetFloodingBehaviour(TileIndex tile);
29
30 void TileLoop_Water(TileIndex tile);
31 bool FloodHalftile(TileIndex t);
32 void DoFloodTile(TileIndex target);
33
34 void ConvertGroundTilesIntoWaterTiles();
35
36 void DrawShipDepotSprite(int x, int y, Axis axis, DepotPart part);
37 void DrawWaterClassGround(const struct TileInfo *ti);
38 void DrawShoreTile(Slope tileh);
39
40 void MakeWaterKeepingClass(TileIndex tile, Owner o);
41
42 bool RiverModifyDesertZone(TileIndex tile, void *data);
43
44 bool IsWateredTile(TileIndex tile, Direction from);
45
51 static inline Money CanalMaintenanceCost(uint32 num)
52 {
53 return (_price[PR_INFRASTRUCTURE_WATER] * num * (1 + IntSqrt(num))) >> 6; // 6 bits scaling.
54 }
55
56 #endif /* WATER_H */