OpenTTD Source 20241224-master-gee860a5c8e
|
Functions related to water (management) More...
Go to the source code of this file.
Enumerations | |
enum | FloodingBehaviour { FLOOD_NONE , FLOOD_ACTIVE , FLOOD_PASSIVE , FLOOD_DRYUP } |
Describes the behaviour of a tile during flooding. More... | |
Functions | |
FloodingBehaviour | GetFloodingBehaviour (TileIndex tile) |
Returns the behaviour of a tile during flooding. | |
void | ClearNeighbourNonFloodingStates (TileIndex tile) |
Clear non-flooding state of the tiles around a tile. | |
void | TileLoop_Water (TileIndex tile) |
Let a water tile floods its diagonal adjoining tiles called from tunnelbridge_cmd, and by TileLoop_Industry() and TileLoop_Track() | |
bool | FloodHalftile (TileIndex t) |
Called from water_cmd if a non-flat rail-tile gets flooded and should be converted to shore. | |
void | ConvertGroundTilesIntoWaterTiles () |
void | DrawShipDepotSprite (int x, int y, Axis axis, DepotPart part) |
void | DrawWaterClassGround (const struct TileInfo *ti) |
void | DrawShoreTile (Slope tileh) |
void | MakeWaterKeepingClass (TileIndex tile, Owner o) |
void | CheckForDockingTile (TileIndex t) |
Mark the supplied tile as a docking tile if it is suitable for docking. | |
void | MakeRiverAndModifyDesertZoneAround (TileIndex tile) |
Make a river tile and remove desert directly around it. | |
bool | IsWateredTile (TileIndex tile, Direction from) |
return true if a tile is a water tile wrt. | |
Money | CanalMaintenanceCost (uint32_t num) |
Calculates the maintenance cost of a number of canal tiles. | |
Variables | |
static const uint | RIVER_OFFSET_DESERT_DISTANCE = 5 |
Circular tile search radius to create non-desert around a river tile. | |
Functions related to water (management)
Definition in file water.h.
enum FloodingBehaviour |
Describes the behaviour of a tile during flooding.
|
inline |
Calculates the maintenance cost of a number of canal tiles.
num | Number of canal tiles. |
Definition at line 51 of file water.h.
References IntSqrt().
Referenced by CompaniesGenStatistics(), CompanyInfrastructureWindow::DrawWidget(), CompanyInfrastructureWindow::GetTotalMaintenanceCost(), and CompanyInfrastructureWindow::UpdateWidgetSize().
void CheckForDockingTile | ( | TileIndex | t | ) |
Mark the supplied tile as a docking tile if it is suitable for docking.
Tiles surrounding the tile are tested to be docks with correct orientation.
t | Tile to test. |
Definition at line 195 of file water_cmd.cpp.
References OrthogonalTileArea::Add(), DIAGDIR_BEGIN, DIAGDIR_END, Station::docking_station, BaseStation::GetByTile(), Industry::GetByTile(), IsDockTile(), IsDockWaterPart(), IsOilRig(), IsTileType(), IsValidTile(), MP_INDUSTRY, MP_STATION, Industry::neutral_station, SetDockingTile(), and TileOffsByDiagDir().
Referenced by ClearDockingTilesCheckingNeighbours(), CmdBuildBridge(), CmdBuildBuoy(), CmdBuildCanal(), CmdBuildShipDepot(), CmdBuildSingleRail(), DoBuildLock(), and DoFloodTile().
void ClearNeighbourNonFloodingStates | ( | TileIndex | tile | ) |
Clear non-flooding state of the tiles around a tile.
tile | The centre of the tile where other tiles' non-flooding state is cleared. |
Definition at line 97 of file water_cmd.cpp.
References DIR_BEGIN, DIR_END, IsTileType(), IsValidTile(), MP_WATER, SetNonFloodingWaterTile(), and TileOffsByDir().
Referenced by BuildObject(), CmdBuildBuoy(), CmdLandscapeClear(), PlantTreesOnTile(), and RemoveLock().
void ConvertGroundTilesIntoWaterTiles | ( | ) |
Definition at line 1300 of file water_cmd.cpp.
Definition at line 956 of file water_cmd.cpp.
void DrawShoreTile | ( | Slope | tileh | ) |
Definition at line 905 of file water_cmd.cpp.
bool FloodHalftile | ( | TileIndex | t | ) |
Called from water_cmd if a non-flat rail-tile gets flooded and should be converted to shore.
The function floods the lower halftile, if the tile has a halftile foundation.
t | The tile to flood. |
Definition at line 762 of file rail_cmd.cpp.
References _current_company, ApplyFoundationToSlope(), CornerToTrackBits(), DC_EXEC, FindFirstTrack(), GetHighestSlopeCorner(), GetRailFoundation(), GetTileSlope(), GetTrackBits(), IsNonContinuousFoundation(), IsPlainRailTile(), IsSlopeWithOneCornerRaised(), IsSlopeWithThreeCornersRaised(), IsSteepSlope(), MakeShore(), MarkTileDirtyByTile(), OppositeCorner(), OWNER_WATER, RAIL_GROUND_WATER, and Backup< T >::Restore().
Referenced by DoFloodTile().
FloodingBehaviour GetFloodingBehaviour | ( | TileIndex | tile | ) |
Returns the behaviour of a tile during flooding.
Definition at line 1092 of file water_cmd.cpp.
References FLOOD_ACTIVE, FLOOD_DRYUP, FLOOD_NONE, GetTileSlope(), GetTileType(), GetTreeGround(), GetWaterClass(), IsCoast(), IsSlopeWithOneCornerRaised(), MP_INDUSTRY, MP_OBJECT, MP_RAILWAY, MP_STATION, MP_TREES, MP_VOID, MP_WATER, RAIL_GROUND_WATER, TREE_GROUND_SHORE, and WATER_CLASS_SEA.
Referenced by CheckRailSlope(), and TileLoop_Water().
return true if a tile is a water tile wrt.
a certain direction.
tile | The tile of interest. |
from | The direction of interest. |
Definition at line 636 of file water_cmd.cpp.
References DiagDirToAxis(), DIR_E, DIR_N, DIR_NE, DIR_NW, DIR_S, DIR_SE, DIR_SW, DIR_W, DirToDiagDir(), GetIndustryIndex(), GetLockDirection(), GetTileSlope(), GetTileType(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), GetWaterTileType(), IsBuoy(), IsDock(), IsOilRig(), IsPlainRail(), IsTileFlat(), IsTileOnWater(), IsTileType(), MP_INDUSTRY, MP_OBJECT, MP_RAILWAY, MP_STATION, MP_TUNNELBRIDGE, MP_VOID, MP_WATER, RAIL_GROUND_WATER, ReverseDiagDir(), SLOPE_E, SLOPE_N, SLOPE_S, SLOPE_W, TileOffsByDir(), TRANSPORT_WATER, WATER_TILE_CLEAR, WATER_TILE_COAST, WATER_TILE_DEPOT, and WATER_TILE_LOCK.
Referenced by DrawWaterEdges(), and CanalScopeResolver::GetVariable().
void MakeRiverAndModifyDesertZoneAround | ( | TileIndex | tile | ) |
Make a river tile and remove desert directly around it.
tile | The tile to change into river and create non-desert around |
Definition at line 454 of file water_cmd.cpp.
References CircularTileSearch(), MakeRiver(), MarkTileDirtyByTile(), RIVER_OFFSET_DESERT_DISTANCE, and RiverModifyDesertZone().
Referenced by FlowRiver(), MakeLake(), and RiverMakeWider().
Definition at line 219 of file water_cmd.cpp.
void TileLoop_Water | ( | TileIndex | tile | ) |
Let a water tile floods its diagonal adjoining tiles called from tunnelbridge_cmd, and by TileLoop_Industry() and TileLoop_Track()
tile | the water/shore tile that floods |
Definition at line 1245 of file water_cmd.cpp.
References _flood_from_dirs, AddTileIndexDiffCWrap(), AmbientSoundEffect(), DIR_BEGIN, DIR_END, DoDryUp(), DoFloodTile(), FLOOD_ACTIVE, FLOOD_DRYUP, FLOOD_PASSIVE, GetFloodingBehaviour(), GetFoundationSlope(), GetTreeGround(), HasBit(), INVALID_TILE, IsBuoy(), IsDock(), IsNonFloodingWaterTile(), IsTileType(), IsValidTile(), MP_STATION, MP_TREES, MP_WATER, ReverseDir(), SetNonFloodingWaterTile(), SLOPE_HALFTILE_MASK, SLOPE_STEEP, TileIndexDiffCByDir(), and TREE_GROUND_SHORE.
|
static |
Circular tile search radius to create non-desert around a river tile.
Definition at line 42 of file water.h.
Referenced by CmdBuildCanal(), and MakeRiverAndModifyDesertZoneAround().