00001 /* $Id$ */ 00002 00003 /* 00004 * This file is part of OpenTTD. 00005 * 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. 00006 * 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. 00007 * 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/>. 00008 */ 00009 00012 #ifndef WATER_H 00013 #define WATER_H 00014 00015 #include "water_map.h" 00016 #include "economy_func.h" 00017 00021 enum FloodingBehaviour { 00022 FLOOD_NONE, 00023 FLOOD_ACTIVE, 00024 FLOOD_PASSIVE, 00025 FLOOD_DRYUP, 00026 }; 00027 00028 FloodingBehaviour GetFloodingBehaviour(TileIndex tile); 00029 00030 void TileLoop_Water(TileIndex tile); 00031 bool FloodHalftile(TileIndex t); 00032 void DoFloodTile(TileIndex target); 00033 00034 void ConvertGroundTilesIntoWaterTiles(); 00035 00036 void DrawShipDepotSprite(int x, int y, Axis axis, DepotPart part); 00037 void DrawWaterClassGround(const struct TileInfo *ti); 00038 void DrawShoreTile(Slope tileh); 00039 00040 void MakeWaterKeepingClass(TileIndex tile, Owner o); 00041 00042 bool RiverModifyDesertZone(TileIndex tile, void *data); 00043 00049 static inline Money CanalMaintenanceCost(uint32 num) 00050 { 00051 return (_price[PR_INFRASTRUCTURE_WATER] * num * (1 + IntSqrt(num))) >> 6; // 6 bits scaling. 00052 } 00053 00054 #endif /* WATER_H */