|
OpenTTD Source 20260531-master-g0e951f3528
|
Handling of water tiles. More...
#include "stdafx.h"#include "landscape.h"#include "viewport_func.h"#include "command_func.h"#include "town.h"#include "news_func.h"#include "depot_base.h"#include "depot_func.h"#include "water.h"#include "industry_map.h"#include "newgrf_canal.h"#include "strings_func.h"#include "vehicle_func.h"#include "sound_func.h"#include "company_func.h"#include "clear_map.h"#include "tree_map.h"#include "aircraft.h"#include "effectvehicle_func.h"#include "tunnelbridge_map.h"#include "station_base.h"#include "ai/ai.hpp"#include "game/game.hpp"#include "core/random_func.hpp"#include "core/backup_type.hpp"#include "timer/timer_game_calendar.h"#include "company_base.h"#include "company_gui.h"#include "newgrf_generic.h"#include "industry.h"#include "water_cmd.h"#include "landscape_cmd.h"#include "pathfinder/water_regions.h"#include "town_type.h"#include "table/strings.h"#include "safeguards.h"#include "table/water_land.h"Go to the source code of this file.
Functions | |
| static void | MarkTileDirtyIfCanalOrRiver (TileIndex tile) |
| Marks tile dirty if it is a canal or river tile. | |
| static void | MarkCanalsAndRiversAroundDirty (TileIndex tile) |
| Marks the tiles around a tile as dirty, if they are canals or rivers. | |
| void | ClearNeighbourNonFloodingStates (TileIndex tile) |
| Clear non-flooding state of the tiles around a tile. | |
| CommandCost | CmdBuildShipDepot (DoCommandFlags flags, TileIndex tile, Axis axis) |
| Build a ship depot. | |
| bool | IsPossibleDockingTile (Tile t) |
| Check whether it is feasible that the given tile could be a docking tile. | |
| void | CheckForDockingTile (TileIndex t) |
| Mark the supplied tile as a docking tile if it is suitable for docking. | |
| void | MakeWaterKeepingClass (TileIndex tile, Owner o) |
| static CommandCost | RemoveShipDepot (TileIndex tile, DoCommandFlags flags) |
| static uint8_t | GetLockPartMinimalBridgeHeight (LockPart lock_part) |
| Get the minimal height required for a bridge above a lock part. | |
| static CommandCost | DoBuildLock (TileIndex tile, DiagDirection dir, DoCommandFlags flags) |
| Builds a lock. | |
| static CommandCost | RemoveLock (TileIndex tile, DoCommandFlags flags) |
| Remove a lock. | |
| CommandCost | CmdBuildLock (DoCommandFlags flags, TileIndex tile) |
| Builds a lock. | |
| void | MakeRiverAndModifyDesertZoneAround (TileIndex tile) |
| Make a river tile and remove desert directly around it. | |
| CommandCost | CmdBuildCanal (DoCommandFlags flags, TileIndex tile, TileIndex start_tile, WaterClass wc, bool diagonal) |
| Build a piece of canal. | |
| static CommandCost | ClearTile_Water (TileIndex tile, DoCommandFlags flags) |
| Tile callback function signature for clearing a tile. | |
| bool | IsWateredTile (TileIndex tile, Direction from) |
| return true if a tile is a water tile wrt. | |
| static void | DrawWaterSprite (SpriteID base, uint offset, CanalFeature feature, TileIndex tile) |
| Draw a water sprite, potentially with a NewGRF-modified sprite offset. | |
| static void | DrawWaterEdges (bool canal, uint offset, TileIndex tile) |
| Draw canal or river edges. | |
| static void | DrawSeaWater (TileIndex) |
| Draw a plain sea water tile with no edges. | |
| static void | DrawCanalWater (TileIndex tile) |
| Draw a canal styled water tile with dikes around. | |
| static void | DrawWaterTileStruct (const TileInfo *ti, std::span< const DrawTileSeqStruct > seq, SpriteID base, uint offset, PaletteID palette, CanalFeature feature) |
| Draw a build sprite sequence for water tiles. | |
| static void | DrawWaterLock (const TileInfo *ti) |
| Draw a lock tile. | |
| static void | DrawWaterDepot (const TileInfo *ti) |
| Draw a ship depot tile. | |
| static void | DrawRiverWater (const TileInfo *ti) |
| void | DrawShoreTile (Slope tileh) |
| void | DrawWaterClassGround (const TileInfo *ti) |
| static void | DrawTile_Water (TileInfo *ti) |
| Tile callback function signature for drawing a tile and its contents to the screen. | |
| void | DrawShipDepotSprite (int x, int y, Axis axis, DepotPart part) |
| static int | GetSlopePixelZ_Water (TileIndex tile, uint x, uint y, bool ground_vehicle) |
Tile callback function signature for obtaining the world Z coordinate of a given point of a tile. | |
| static void | GetTileDesc_Water (TileIndex tile, TileDesc &td) |
| Tile callback function signature for obtaining a tile description. | |
| static void | FloodVehicle (Vehicle *v) |
| Handle the flooding of a vehicle. | |
| static void | FloodVehicleProc (Vehicle *v, int z) |
| Flood a vehicle if we are allowed to flood it, i.e. | |
| static void | FloodVehiclesOnTile (TileIndex tile, int z) |
| static void | FloodVehicles (TileIndex tile) |
| Finds a vehicle to flood. | |
| FloodingBehaviour | GetFloodingBehaviour (TileIndex tile) |
| Returns the behaviour of a tile during flooding. | |
| static void | DoFloodTile (TileIndex target) |
| Floods a tile. | |
| static void | DoDryUp (TileIndex tile) |
| Drys a tile up. | |
| void | TileLoop_Water (TileIndex tile) |
| Tile callback function signature for running periodic tile updates. | |
| void | ConvertGroundTilesIntoWaterTiles () |
| static TrackStatus | GetTileTrackStatus_Water (TileIndex tile, TransportType mode, RoadTramType sub_mode, DiagDirection side) |
| Tile callback function signature for getting the possible tracks that can be taken on a given tile by a given transport. | |
| static bool | ClickTile_Water (TileIndex tile) |
| Tile callback function signature for clicking a tile. | |
| static void | ChangeTileOwner_Water (TileIndex tile, Owner old_owner, Owner new_owner) |
| Tile callback function signature for changing the owner of a tile. | |
| static CommandCost | TerraformTile_Water (TileIndex tile, DoCommandFlags flags, int z_new, Slope tileh_new) |
| Tile callback function signature of the terraforming callback. | |
| static CommandCost | CheckBuildAbove_Water (TileIndex tile, DoCommandFlags flags, Axis axis, int height) |
| Tile callback function signature to test if a bridge can be built above a tile. | |
Variables | |
| static const Directions | _flood_from_dirs [] |
| Describes from which directions a specific slope can be flooded (if the tile is floodable at all). | |
| const TileTypeProcs | _tile_type_water_procs |
| TileTypeProcs definitions for TileType::Water tiles. | |
Handling of water tiles.
Definition in file water_cmd.cpp.
|
static |
Tile callback function signature for changing the owner of a tile.
| tile | The tile to process. |
| old_owner | The owner to replace. |
| new_owner | The owner to replace with. |
Definition at line 1421 of file water_cmd.cpp.
References Bankrupt, Canal, Execute, GetLockPart(), GetWaterClass(), INVALID_OWNER, IsLock(), IsShipDepot(), IsTileOwner(), LOCK_DEPOT_TILE_FACTOR, Middle, OWNER_NONE, and SetTileOwner().
|
static |
Tile callback function signature to test if a bridge can be built above a tile.
| tile | The involved tile. |
| flags | Command flags passed to the build command. |
| axis | Axis of bridge being built. |
| height | Absolute height of bridge platform. |
Definition at line 1470 of file water_cmd.cpp.
References CommandCostWithParam(), GetLockPart(), GetLockPartMinimalBridgeHeight(), GetTileMaxZ(), IsCoast(), IsLock(), IsWater(), and TILE_HEIGHT_STEP.
| 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 201 of file water_cmd.cpp.
References OrthogonalTileArea::Add(), Begin, Station::docking_station, End, BaseStation::GetByTile(), Industry::GetByTile(), Industry, IsDockTile(), IsDockWaterPart(), IsOilRig(), IsTileType(), IsValidTile(), Industry::neutral_station, SetDockingTile(), Station, 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 98 of file water_cmd.cpp.
References Begin, End, IsTileType(), IsValidTile(), SetNonFloodingWaterTile(), TileOffsByDir(), and Water.
Referenced by BuildObject(), ClearTile_Water(), CmdBuildBuoy(), CmdLandscapeClear(), PlantTreesOnTile(), and RemoveLock().
|
static |
Tile callback function signature for clearing a tile.
| tile | The tile to clear. |
| flags | The command flags. |
Definition at line 580 of file water_cmd.cpp.
References _current_company, _price, _settings_game, Auto, ChangeTownRating(), CheckTileOwnership(), Clear, ClearCanal, ClearNeighbourNonFloodingStates(), ClearRough, ClearWater, ClosestTownFromTile(), CMD_ERROR, Coast, Construction, Depot, DirtyCompanyInfrastructureWindows(), End, EnsureNoVehicleOnGround(), Execute, CommandCost::Failed(), GetLockDirection(), GetLockPart(), GetTileOwner(), GetTileSlope(), GetWaterTileType(), IsCanal(), IsInsideMM(), IsRiver(), IsSlopeWithOneCornerRaised(), Lock, MarkCanalsAndRiversAroundDirty(), Map::MaxX(), Map::MaxY(), NoWater, OWNER_NONE, OWNER_WATER, RATING_WATER_MINIMUM, RATING_WATER_RIVER_DOWN_STEP, RemoveLock(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileX(), TileY(), and ToTileIndexDiff().
|
static |
Tile callback function signature for clicking a tile.
| tile | The tile that was clicked. |
Definition at line 1411 of file water_cmd.cpp.
References Depot, GetShipDepotNorthTile(), GetWaterTileType(), Ship, and ShowDepotWindow().
| CommandCost CmdBuildCanal | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| TileIndex | start_tile, | ||
| WaterClass | wc, | ||
| bool | diagonal ) |
Build a piece of canal.
| flags | type of operation |
| tile | end tile of stretch-dragging |
| start_tile | start tile of stretch-dragging |
| wc | waterclass to build. sea and river can only be built in scenario editor |
| diagonal | Whether to use the Orthogonal (0) or Diagonal (1) iterator. |
Definition at line 499 of file water_cmd.cpp.
References _current_company, _price, CommandCost::AddCost(), BuildCanal, Canal, CheckForDockingTile(), CMD_ERROR, Construction, TileIterator::Create(), Desert, DirtyCompanyInfrastructureWindows(), Editor, Execute, CommandCost::Failed(), CommandCost::GetCost(), GetTileOwner(), GetTileSlope(), GetTropicZone(), INVALID_TILE, IsCanal(), IsInclinedSlope(), IsTileOwner(), IsTileType(), IsValidWaterClass(), IsWaterTile(), MakeCanal(), MakeRiver(), MakeSea(), MarkCanalsAndRiversAroundDirty(), MarkTileDirtyByTile(), Normal, OWNER_NONE, River, RIVER_OFFSET_DESERT_DISTANCE, Sea, SetTropicZone(), Map::Size(), SLOPE_FLAT, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileHeight(), and Water.
| CommandCost CmdBuildLock | ( | DoCommandFlags | flags, |
| TileIndex | tile ) |
Builds a lock.
| flags | type of operation |
| tile | tile where to place the lock |
Definition at line 460 of file water_cmd.cpp.
References _settings_game, DoBuildLock(), GetInclinedSlopeDirection(), GetTileSlope(), Invalid, IsInsideMM(), Map::MaxX(), Map::MaxY(), ReverseDiagDir(), TileAddByDiagDir(), TileX(), and TileY().
| CommandCost CmdBuildShipDepot | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| Axis | axis ) |
Build a ship depot.
| flags | type of operation |
| tile | tile where ship depot is built |
| axis | depot orientation (Axis) |
Definition at line 113 of file water_cmd.cpp.
References _current_company, _price, CommandCost::AddCost(), Auto, BuildDepotShip, Canal, CheckForDockingTile(), CMD_ERROR, Construction, DirtyCompanyInfrastructureWindows(), Execute, CommandCost::Failed(), CommandCost::GetCost(), GetWaterClass(), HasTileWaterClass(), HasTileWaterGround(), IsBridgeAbove(), IsTileFlat(), IsTileOwner(), IsValidAxis(), IsWaterTile(), LOCK_DEPOT_TILE_FACTOR, MakeDefaultName(), MakeShipDepot(), MarkTileDirtyByTile(), North, South, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and TileOffsByAxis().
| void ConvertGroundTilesIntoWaterTiles | ( | ) |
Definition at line 1347 of file water_cmd.cpp.
|
static |
Builds a lock.
| tile | Central tile of the lock. |
| dir | Uphill direction. |
| flags | Operation to perform. |
Definition at line 333 of file water_cmd.cpp.
References _current_company, _price, CommandCost::AddCost(), BuildCanal, BuildLock, Canal, CheckForDockingTile(), CommandCostWithParam(), Construction, DirtyCompanyInfrastructureWindows(), EnsureNoVehicleOnGround(), Execute, CommandCost::Failed(), GetBridgeHeight(), CommandCost::GetCost(), GetLockPartMinimalBridgeHeight(), GetSouthernBridgeEnd(), GetTileMaxZ(), GetWaterClass(), HasTileWaterGround(), Company::infrastructure, InvalidateWaterRegion(), IsBridgeAbove(), IsTileFlat(), IsWaterTile(), LOCK_DEPOT_TILE_FACTOR, MakeLock(), MarkCanalsAndRiversAroundDirty(), MarkTileDirtyByTile(), Middle, CommandCost::Succeeded(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TILE_HEIGHT_STEP, TileOffsByDiagDir(), and CompanyInfrastructure::water.
Referenced by CmdBuildLock().
|
static |
Drys a tile up.
| tile | The tile to consider. |
Definition at line 1247 of file water_cmd.cpp.
References _current_company, Execute, FenceHoriz1, FenceHoriz2, FenceVert1, FenceVert2, GetRailGroundType(), GetTileType(), GetTrackBits(), Grass, HalfTileWater, IsCoast(), IsPlainRail(), MakeClear(), MarkTileDirtyByTile(), OWNER_WATER, Railway, SetRailGroundType(), SetTreeGroundDensity(), TRACK_BIT_LEFT, TRACK_BIT_LOWER, TRACK_BIT_RIGHT, TRACK_BIT_UPPER, Trees, and Water.
Referenced by TileLoop_Water().
|
static |
Floods a tile.
| target | The tile to consider. |
Definition at line 1180 of file water_cmd.cpp.
References _current_company, CheckForDockingTile(), Clear, Execute, FloodHalftile(), FloodVehicles(), GetTileSlope(), GetTileType(), InvalidateWaterRegion(), IsPlainRail(), IsPossibleDockingTile(), IsSlopeWithOneCornerRaised(), IsTileType(), MakeSea(), MakeShore(), MarkCanalsAndRiversAroundDirty(), MarkTileDirtyByTile(), OWNER_WATER, Railway, SetTreeGroundDensity(), Shore, SLOPE_FLAT, Trees, UpdateSignalsInBuffer(), and Water.
Referenced by TileLoop_Water().
|
static |
Draw a canal styled water tile with dikes around.
| tile | The tile to draw as canal. |
Definition at line 823 of file water_cmd.cpp.
References _water_feature, CFF_HAS_FLAT_SPRITE, DrawWaterEdges(), DrawWaterSprite(), GetCanalSprite(), and HasBit().
|
static |
Definition at line 912 of file water_cmd.cpp.
|
static |
Draw a plain sea water tile with no edges.
Definition at line 814 of file water_cmd.cpp.
References DrawGroundSprite().
Definition at line 1007 of file water_cmd.cpp.
| void DrawShoreTile | ( | Slope | tileh | ) |
Definition at line 950 of file water_cmd.cpp.
|
static |
Tile callback function signature for drawing a tile and its contents to the screen.
| ti | Information about the tile to draw |
Definition at line 978 of file water_cmd.cpp.
References Clear, Coast, Depot, DiagDirToAxis(), DrawBridgeMiddle(), DrawWaterDepot(), DrawWaterLock(), GetLockDirection(), GetWaterTileType(), Lock, TileInfo::tile, TileInfo::tileh, and X.
| void DrawWaterClassGround | ( | const TileInfo * | ti | ) |
Definition at line 967 of file water_cmd.cpp.
|
static |
Draw a ship depot tile.
| ti | The tile information of the ship depot tile. |
Definition at line 906 of file water_cmd.cpp.
References _shipdepot_display_data, DrawWaterTileStruct(), GetCompanyPalette(), GetShipDepotAxis(), GetShipDepotPart(), GetTileOwner(), and TileInfo::tile.
Referenced by DrawTile_Water().
|
static |
Draw canal or river edges.
| canal | True if canal edges should be drawn, false for river edges. |
| offset | Sprite offset. |
| tile | Tile to draw. |
Definition at line 761 of file water_cmd.cpp.
References DrawWaterSprite(), E, GetCanalSprite(), IsWateredTile(), N, NE, NW, S, SE, SW, TileAddXY(), and W.
Referenced by DrawCanalWater().
|
static |
Draw a lock tile.
| ti | The tile information of the lock tile. |
Definition at line 864 of file water_cmd.cpp.
References _lock_display_data, _water_feature, CFF_HAS_FLAT_SPRITE, DrawGroundSprite(), DrawWaterTileStruct(), GetCanalSprite(), GetLockDirection(), GetLockPart(), DrawTileSprites::GetSequence(), DrawTileSprites::ground, HasBit(), PalSpriteID::sprite, TileInfo::tile, Upper, and Coord3D< T >::z.
Referenced by DrawTile_Water().
|
static |
Draw a water sprite, potentially with a NewGRF-modified sprite offset.
| base | Sprite base. |
| offset | Sprite offset. |
| feature | The type of sprite that is drawn. |
| tile | Tile index to draw. |
Definition at line 746 of file water_cmd.cpp.
References DrawGroundSprite(), and GetCanalSpriteOffset().
Referenced by DrawCanalWater(), and DrawWaterEdges().
|
static |
Draw a build sprite sequence for water tiles.
If buildings are invisible, nothing will be drawn.
| ti | Tile info. |
| seq | Sprite sequence to draw. |
| base | Base sprite. |
| offset | Additional sprite offset. |
| palette | Palette to use. |
| feature | The canal feature to get the sprite offset to apply from. |
Definition at line 848 of file water_cmd.cpp.
References AddSortableSpriteToDraw(), Buildings, GetCanalSpriteOffset(), IsInvisibilitySet(), IsTransparencySet(), and TileInfo::tile.
Referenced by DrawWaterDepot(), and DrawWaterLock().
|
static |
Handle the flooding of a vehicle.
This sets the vehicle state to crashed, creates a newsitem and dirties the necessary windows.
| v | The vehicle to flood. |
Definition at line 1053 of file water_cmd.cpp.
References _settings_client, Accident, Vehicle::Crash(), CreateEffectVehicleRel(), EV_EXPLOSION_LARGE, GetEncodedString(), AI::NewEvent(), Game::NewEvent(), Vehicle::owner, SND_12_EXPLOSION, and Vehicle::tile.
Referenced by FloodVehicleProc().
|
static |
Flood a vehicle if we are allowed to flood it, i.e.
when it is on the ground.
| v | The vehicle to test for flooding. |
| z | The z of level to flood. |
Definition at line 1069 of file water_cmd.cpp.
References AIR_SHADOW, Aircraft, Station::airport, Crashed, AirportFTAClass::delta_z, Vehicle::First(), FloodVehicle(), BaseStation::GetByTile(), Airport::GetFTA(), GetTileMaxZ(), IsAirportTile(), Road, Vehicle::subtype, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), Vehicle::tile, Train, BaseVehicle::type, Vehicle::vehstatus, and Vehicle::z_pos.
|
static |
Finds a vehicle to flood.
It does not find vehicles that are already crashed on bridges, i.e. flooded.
| tile | the tile where to find a vehicle to flood |
Definition at line 1111 of file water_cmd.cpp.
References Station::airport, GetBridgePixelHeight(), BaseStation::GetByTile(), GetOtherBridgeEnd(), IsAirportTile(), and IsBridgeTile().
Referenced by DoFloodTile().
|
static |
Definition at line 1099 of file water_cmd.cpp.
| FloodingBehaviour GetFloodingBehaviour | ( | TileIndex | tile | ) |
Returns the behaviour of a tile during flooding.
| tile | The tile to get the behaviour for. |
Definition at line 1140 of file water_cmd.cpp.
References Active, DryOut, GetRailGroundType(), GetTileSlope(), GetTileType(), GetTreeGround(), GetWaterClass(), HalfTileWater, Industry, IsCoast(), IsSlopeWithOneCornerRaised(), None, Object, Railway, Sea, Shore, Station, Trees, Void, and Water.
Referenced by CheckRailSlope(), and TileLoop_Water().
|
static |
Get the minimal height required for a bridge above a lock part.
| lock_part | the lock part. |
Definition at line 316 of file water_cmd.cpp.
References End, and to_underlying().
Referenced by CheckBuildAbove_Water(), and DoBuildLock().
|
static |
Tile callback function signature for obtaining the world Z coordinate of a given point of a tile.
| tile | The queries tile for the Z coordinate. |
| x | World X coordinate in tile "units". |
| y | World Y coordinate in tile "units". |
| ground_vehicle | Whether to get the Z coordinate of the ground vehicle, or the ground. |
Definition at line 1017 of file water_cmd.cpp.
References GetPartialPixelZ(), and GetTilePixelSlope().
Tile callback function signature for obtaining a tile description.
| tile | Tile being queried |
| td | Storage pointer for returned tile description |
Definition at line 1025 of file water_cmd.cpp.
References TileDesc::build_date, Canal, Clear, Coast, Depot, GetTileOwner(), GetWaterClass(), GetWaterTileType(), Lock, TileDesc::owner, River, Sea, and TileDesc::str.
|
static |
Tile callback function signature for getting the possible tracks that can be taken on a given tile by a given transport.
The return value contains the existing trackdirs and signal states.
see track_func.h for usage of TrackStatus.
| tile | the tile to get the track status from |
| mode | the mode of transportation |
| sub_mode | used to differentiate between different kinds within the mode |
| side | The side where the tile is entered. |
Definition at line 1383 of file water_cmd.cpp.
References AxisToTrackBits(), Clear, Coast, Depot, DiagDirToDiagTrackBits(), GetLockDirection(), GetShipDepotAxis(), GetTileSlope(), GetWaterTileType(), IsTileFlat(), Lock, TileX(), TileY(), TRACK_BIT_ALL, TRACK_BIT_LEFT, TRACK_BIT_LOWER, TRACK_BIT_NONE, TRACK_BIT_RIGHT, TRACK_BIT_UPPER, TRACK_BIT_X, TRACK_BIT_Y, TrackBitsToTrackdirBits(), TRACKDIR_BIT_NONE, and TRANSPORT_WATER.
| bool IsPossibleDockingTile | ( | Tile | t | ) |
Check whether it is feasible that the given tile could be a docking tile.
| t | The tile to query. |
true iff there is a chance the tile could be a docking tile. Definition at line 179 of file water_cmd.cpp.
References GetLockPart(), GetTileTrackStatus(), GetTileType(), Invalid, IsLock(), IsValidTile(), Middle, Railway, Station, TRACK_BIT_NONE, TrackdirBitsToTrackBits(), TRANSPORT_WATER, TunnelBridge, and Water.
Referenced by ClearDockingTilesCheckingNeighbours(), CmdBuildSingleRail(), and DoFloodTile().
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 675 of file water_cmd.cpp.
References Clear, Coast, Depot, DiagDirToAxis(), DirToDiagDir(), E, GetIndustryIndex(), GetLockDirection(), GetRailGroundType(), GetTileSlope(), GetTileType(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), GetWaterTileType(), HalfTileWater, Industry, IsBuoy(), IsDock(), IsOilRig(), IsPlainRail(), IsTileFlat(), IsTileOnWater(), IsTileType(), Lock, N, NE, NW, Object, Railway, ReverseDiagDir(), S, SE, SLOPE_E, SLOPE_N, SLOPE_S, SLOPE_W, Station, SW, TileOffsByDir(), TRANSPORT_WATER, TunnelBridge, Void, W, and Water.
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 479 of file water_cmd.cpp.
References Desert, GetTropicZone(), MakeRiver(), MarkTileDirtyByTile(), Normal, RIVER_OFFSET_DESERT_DISTANCE, and SetTropicZone().
Referenced by MakeLake(), MakeWetlands(), and RiverMakeWider().
| void MakeWaterKeepingClass | ( | TileIndex | tile, |
| Owner | o ) |
Definition at line 225 of file water_cmd.cpp.
|
inlinestatic |
Marks tile dirty if it is a canal or river tile.
Called to avoid glitches when flooding tiles next to canal tile.
| tile | tile to check |
Definition at line 76 of file water_cmd.cpp.
References IsCanal(), IsRiver(), IsTileType(), IsValidTile(), MarkTileDirtyByTile(), and Water.
Referenced by MarkCanalsAndRiversAroundDirty().
|
static |
Remove a lock.
| tile | Central tile of the lock. |
| flags | Operation to perform. |
Definition at line 415 of file water_cmd.cpp.
References _price, CheckTileOwnership(), ClearLock, ClearNeighbourNonFloodingStates(), Construction, DirtyCompanyInfrastructureWindows(), EnsureNoVehicleOnGround(), Execute, CommandCost::Failed(), GetLockDirection(), GetTileOwner(), GetWaterClass(), Company::infrastructure, LOCK_DEPOT_TILE_FACTOR, MakeRiver(), MarkCanalsAndRiversAroundDirty(), OWNER_NONE, River, CommandCost::Succeeded(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileOffsByDiagDir(), and CompanyInfrastructure::water.
Referenced by ClearTile_Water().
|
static |
Definition at line 276 of file water_cmd.cpp.
|
static |
Tile callback function signature of the terraforming callback.
The function is called when a tile is affected by a terraforming operation. It has to check if terraforming of the tile is allowed and return extra terraform-cost that depend on the tiletype. With DoCommandFlag::Execute in flags it has to perform tiletype-specific actions (like clearing land etc., but not the terraforming itself).
| tile | The involved tile. |
| flags | Command flags passed to the terraform command (DoCommandFlag::Execute, DoCommandFlag::QueryCost, etc.). |
| z_new | TileZ after terraforming. |
| tileh_new | Slope after terraforming. |
Definition at line 1458 of file water_cmd.cpp.
References IsCanal(), IsRiver(), and IsWaterTile().
| void TileLoop_Water | ( | TileIndex | tile | ) |
Tile callback function signature for running periodic tile updates.
| tile | The tile to update. |
Let a water tile floods its diagonal adjoining tiles called by TileLoop_Industry, TileLoop_Rail, TileLoop_Station, TileLoop_Object, TileLoop_Trees and TileLoop_Void.
Definition at line 1292 of file water_cmd.cpp.
References _flood_from_dirs, Active, AddTileIndexDiffCWrap(), AmbientSoundEffect(), Begin, DoDryUp(), DoFloodTile(), DryOut, End, GetFloodingBehaviour(), GetFoundationSlope(), GetTreeGround(), INVALID_TILE, IsBuoy(), IsDock(), IsNonFloodingWaterTile(), IsTileType(), IsValidTile(), Passive, ReverseDir(), SetNonFloodingWaterTile(), Shore, SLOPE_HALFTILE_MASK, SLOPE_STEEP, Station, TileIndexDiffCByDir(), Trees, and Water.
Referenced by TileLoop_Industry(), TileLoop_Object(), TileLoop_Rail(), TileLoop_Station(), TileLoop_Trees(), and TileLoop_Void().
|
static |
Describes from which directions a specific slope can be flooded (if the tile is floodable at all).
Definition at line 52 of file water_cmd.cpp.
Referenced by TileLoop_Water().
|
extern |
TileTypeProcs definitions for TileType::Water tiles.
Definition at line 58 of file landscape.cpp.