OpenTTD Source 20241224-master-gf74b0cf984
|
Map writing/reading functions for tiles. More...
#include "slope_type.h"
#include "map_func.h"
#include "core/bitmath_func.hpp"
#include "settings_type.h"
Go to the source code of this file.
Functions | |
static debug_inline uint | TileHeight (Tile tile) |
Returns the height of a tile. | |
uint | TileHeightOutsideMap (int x, int y) |
Returns the height of a tile, also for tiles outside the map (virtual "black" tiles). | |
void | SetTileHeight (Tile tile, uint height) |
Sets the height of a tile. | |
uint | TilePixelHeight (Tile tile) |
Returns the height of a tile in pixels. | |
uint | TilePixelHeightOutsideMap (int x, int y) |
Returns the height of a tile in pixels, also for tiles outside the map (virtual "black" tiles). | |
static debug_inline TileType | GetTileType (Tile tile) |
Get the tiletype of a given tile. | |
bool | IsInnerTile (Tile tile) |
Check if a tile is within the map (not a border) | |
void | SetTileType (Tile tile, TileType type) |
Set the type of a tile. | |
static debug_inline bool | IsTileType (Tile tile, TileType type) |
Checks if a tile is a given tiletype. | |
bool | IsValidTile (Tile tile) |
Checks if a tile is valid. | |
Owner | GetTileOwner (Tile tile) |
Returns the owner of a tile. | |
void | SetTileOwner (Tile tile, Owner owner) |
Sets the owner of a tile. | |
bool | IsTileOwner (Tile tile, Owner owner) |
Checks if a tile belongs to the given owner. | |
void | SetTropicZone (Tile tile, TropicZone type) |
Set the tropic zone. | |
TropicZone | GetTropicZone (Tile tile) |
Get the tropic zone. | |
uint8_t | GetAnimationFrame (Tile t) |
Get the current animation frame. | |
void | SetAnimationFrame (Tile t, uint8_t frame) |
Set a new animation frame. | |
std::tuple< Slope, int > | GetTileSlopeZ (TileIndex tile) |
Return the slope of a given tile inside the map. | |
int | GetTileZ (TileIndex tile) |
Get bottom height of the tile. | |
int | GetTileMaxZ (TileIndex tile) |
Get top height of the tile inside the map. | |
bool | IsTileFlat (TileIndex tile, int *h=nullptr) |
Check if a given tile is flat. | |
Slope | GetTileSlope (TileIndex tile) |
Return the slope of a given tile inside the map. | |
std::tuple< Slope, int > | GetTilePixelSlope (TileIndex tile) |
Return the slope of a given tile. | |
std::tuple< Slope, int > | GetTilePixelSlopeOutsideMap (int x, int y) |
Return the slope of a given tile, also for tiles outside the map (virtual "black" tiles). | |
int | GetTilePixelZ (TileIndex tile) |
Get bottom height of the tile. | |
int | GetTileMaxPixelZ (TileIndex tile) |
Get top height of the tile. | |
uint | TileHash (uint x, uint y) |
Calculate a hash value from a tile position. | |
uint | TileHash2Bit (uint x, uint y) |
Get the last two bits of the TileHash from a tile position. | |
Map writing/reading functions for tiles.
Definition in file tile_map.h.
|
inline |
Get the current animation frame.
t | the tile |
Definition at line 250 of file tile_map.h.
References IsTileType(), Tile::m7(), MP_HOUSE, MP_INDUSTRY, MP_OBJECT, and MP_STATION.
Referenced by AirportTileScopeResolver::GetVariable(), HouseScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), IndustryTileScopeResolver::GetVariable(), ObjectScopeResolver::GetVariable(), StationScopeResolver::GetVariable(), and IncreaseAnimationStage().
|
inline |
Get top height of the tile.
tile | Tile to compute height of |
Definition at line 312 of file tile_map.h.
References GetTileMaxZ(), and TILE_HEIGHT.
Referenced by AfterLoadGame(), AircraftController(), DrawRailCatenary(), EnsureNoVehicleOnGround(), and SetSelectionTilesDirty().
int GetTileMaxZ | ( | TileIndex | t | ) |
Get top height of the tile inside the map.
t | Tile to compute height of |
Definition at line 136 of file tile_map.cpp.
References Map::MaxX(), Map::MaxY(), TileHeight(), TileX(), TileXY(), and TileY().
Referenced by AfterLoadGame(), AutoslopeCheckForEntranceEdge(), CheckBuildHouseSameZ(), CmdBuildBridge(), CmdBuildObject(), DoClearBridge(), DrawRailCatenaryRailway(), DrawRoadBits(), DrawRoadTypeCatenary(), FindSpring(), FloodVehicleProc(), GetOtherAqueductEnd(), GetTerrainType(), GetTileMaxPixelZ(), RiverMakeWider(), ShipTestUpDownOnLock(), and TryBuildTownHouse().
Returns the owner of a tile.
This function returns the owner of a tile. This cannot used for tiles which type is one of MP_HOUSE, MP_VOID and MP_INDUSTRY as no company owned any of these buildings.
tile | The tile to check |
Definition at line 178 of file tile_map.h.
References GB(), IsTileType(), IsValidTile(), Tile::m1(), MP_HOUSE, and MP_INDUSTRY.
Referenced by AfterLoadGame(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CheckAllowRemoveTunnelBridge(), CheckTileOwnership(), CmdBuildBridge(), CmdBuildCanal(), CmdBuildObject(), CmdBuildRailWaypoint(), CmdBuildRoad(), CmdBuildSingleRail(), CmdBuildSingleSignal(), CmdConvertRail(), CmdInsertOrder(), CmdLandscapeClear(), CmdRemoveSingleRail(), CmdRemoveSingleSignal(), CmdRenameDepot(), DisasterTick_Zeppeliner(), DoClearBridge(), DoClearTunnel(), DrawTile_Road(), DrawWaterDepot(), ExploreSegment(), ObjectPickerCallbacks::FillUsedItems(), FindStationsAroundSelection(), FixOwnerOfRailTrack(), GetSmallMapOwnerPixels(), GetTrainForReservation(), ObjectScopeResolver::GetVariable(), IsTileOwner(), IsValidTileForWaypoint(), MakeBuoy(), MakeLock(), MoveBuoysToWaypoints(), MoveWaypointsToBaseStations(), DepotWindow::OnClick(), ReallyClearObjectTile(), RemoveBuoy(), RemoveFromRailBaseStation(), RemoveLock(), RemoveRoad(), UpdateObjectColours(), and Depot::~Depot().
Return the slope of a given tile.
tile | Tile to compute slope of |
Definition at line 289 of file tile_map.h.
References GetTileSlopeZ(), and TILE_HEIGHT.
Referenced by GetNearbyTileInformation(), and ViewportAddLandscape().
std::tuple< Slope, int > GetTilePixelSlopeOutsideMap | ( | int | x, |
int | y | ||
) |
Return the slope of a given tile, also for tiles outside the map (virtual "black" tiles).
x | X coordinate of the tile to compute slope of, may be outside the map. |
y | Y coordinate of the tile to compute slope of, may be outside the map. |
h | If not nullptr , pointer to storage of z height. |
Definition at line 78 of file tile_map.cpp.
References GetTileSlopeGivenHeight(), TILE_HEIGHT, and TileHeightOutsideMap().
Referenced by ViewportAddLandscape().
|
inline |
Get bottom height of the tile.
tile | Tile to compute height of |
Definition at line 302 of file tile_map.h.
References GetTileZ(), and TILE_HEIGHT.
Referenced by CmdChangeBankBalance(), DrawRailCatenaryOnTunnel(), and SetSelectionTilesDirty().
Return the slope of a given tile inside the map.
tile | Tile to compute slope of |
Definition at line 279 of file tile_map.h.
References GetTileSlopeZ().
Referenced by AfterLoadGame(), CanBuildHouseHere(), CanPlantTreesOnTile(), CheckIfIndustryTileSlopes(), CmdBuildCanal(), CmdBuildDock(), CmdBuildLock(), CmdBuildObject(), CmdBuildRoad(), CmdBuildRoadDepot(), CmdBuildSingleRail(), CmdBuildTrainDepot(), CmdPlantTree(), CmdRemoveSingleRail(), DoFloodTile(), DrawRailCatenaryRailway(), FloodHalftile(), GetFloodingBehaviour(), GetTownRoadGridElement(), ObjectScopeResolver::GetVariable(), RoadStopScopeResolver::GetVariable(), StationScopeResolver::GetVariable(), GrowTownWithBridge(), GrowTownWithTunnel(), IsRoadAllowedHere(), IsValidTileForWaypoint(), IsWateredTile(), BuildDocksToolbarWindow::OnPlaceObject(), BuildDocksToolbarWindow::OnPlacePresize(), PerformIndustryTileSlopeCheck(), PerformStationTileSlopeCheck(), RedundantBridgeExistsNearby(), RemoveRoad(), RiverMakeWider(), SearchTileForStatue(), ShipTestUpDownOnLock(), CYapfCostBase::stSlopeCost(), and TryBuildTownHouse().
Return the slope of a given tile inside the map.
tile | Tile to compute slope of |
Definition at line 55 of file tile_map.cpp.
References GetTileSlopeGivenHeight(), Map::MaxX(), Map::MaxY(), TileHeight(), TileX(), TileXY(), and TileY().
Referenced by CheckBuildableTile(), CmdBuildBridge(), CmdBuildObject(), CmdBuildTunnel(), FlowsDown(), GetBridgeHeight(), GetFoundationSlope(), GetOtherAqueductEnd(), GetTilePixelSlope(), and GetTileSlope().
Get the tiletype of a given tile.
tile | The tile to get the TileType |
Definition at line 96 of file tile_map.h.
References GB(), Map::Size(), and Tile::type().
Referenced by AfterLoadGame(), AmbientSoundEffectCallback(), CanFollowRoad(), CanPlantTreesOnTile(), ChangeTileOwner(), CleanUpRoadBits(), ClosestTownFromTile(), CmdBuildBridge(), CmdBuildRoad(), CmdBuildSingleRail(), CmdConvertRail(), CmdConvertRoad(), CmdDeleteTown(), CmdLandscapeClear(), CmdPlantTree(), CmdRemoveSingleRail(), CmdSignalTrackHelper(), CmdTerraformLand(), ConvertRailTypes(), ConvertRoadTypes(), DoDryUp(), DoFloodTile(), DrawRailCatenary(), ExploreSegment(), GenerateRockyArea(), GetAnyRoadBits(), GetDepotVehicleType(), GetFloodingBehaviour(), GetFoundationSlope(), GetGrfSpecFeature(), GetNearbyTileInformation(), GetRailTrackBitsUniversal(), GetReservedTrackbits(), GetSlopePixelZ(), GetTerrainType(), SmallMapWindow::GetTileColours(), GetTileRailType(), GetTileTrackStatus(), GrowTownWithExtraHouse(), HighlightTownLocalAuthorityTiles(), Depot::IsOfType(), IsSuitableForFarmField(), IsTileType(), IsWateredTile(), MayAnimateTile(), MayHaveRoad(), CYapfCostRailT< Types >::OneTileCost(), CYapfCostRoadT< Types >::OneTileCost(), PlaceTreeGroupAroundTile(), PlantTreesOnTile(), Station::RemoveFromAllNearbyLists(), RemoveRoad(), RunTileLoop(), SetWaterClassDependingOnSurroundings(), TryReserveRailTrack(), UnreserveRailTrack(), UpdateSignalsInBuffer(), VehicleEnterTile(), ViewportAddLandscape(), and Town::~Town().
int GetTileZ | ( | TileIndex | tile | ) |
Get bottom height of the tile.
tile | Tile to compute height of |
Definition at line 116 of file tile_map.cpp.
References Map::MaxX(), Map::MaxY(), TileHeight(), TileX(), TileXY(), and TileY().
Referenced by AfterLoadGame(), AmbientSoundEffectCallback(), CheckNewIndustry_BubbleGen(), CheckNewIndustry_Farm(), CheckNewIndustry_Forest(), CmdBuildBridge(), FlowRiver(), GenerateStationName(), GetOtherTunnelEnd(), GetTerrainType(), GetTilePixelZ(), CanalScopeResolver::GetVariable(), IndustriesScopeResolver::GetVariable(), GrowTownWithTunnel(), IsTunnelInWayDir(), LandInfoWindow::OnInit(), PlaceTreeAtSameHeight(), PlaceTreesRandomly(), RiverMakeWider(), ShipTestUpDownOnLock(), and TileLoopClearAlps().
|
inline |
Get the tropic zone.
tile | the tile to get the zone of |
Definition at line 238 of file tile_map.h.
References GB(), Map::Size(), and Tile::type().
Referenced by CheckNewIndustry_Lumbermill(), CheckNewIndustry_Plantation(), CheckNewIndustry_Water(), CmdPlantTree(), TownViewWindow::DrawWidget(), FindSpring(), FlowRiver(), TownViewWindow::GetDesiredInfoHeight(), GetRandomTreeType(), GetSmallMapVegetationPixels(), GetTerrainType(), MakeLake(), NeighbourIsNormal(), PlaceTreesRandomly(), RiverModifyDesertZone(), SplitGroundSpriteForOverlay(), and UpdateTownGrowth().
|
inline |
Check if a tile is within the map (not a border)
tile | The tile to check |
Definition at line 109 of file tile_map.h.
References _settings_game, GameSettings::construction, ConstructionSettings::freeform_edges, Map::MaxX(), Map::MaxY(), Map::Size(), TileX(), and TileY().
Referenced by GrayscaleToMapHeights(), SetTileType(), and TgenSetTileHeight().
bool IsTileFlat | ( | TileIndex | tile, |
int * | h | ||
) |
Check if a given tile is flat.
tile | Tile to check |
h | If not nullptr , pointer to storage of z height (only if tile is flat) |
Definition at line 95 of file tile_map.cpp.
References Map::MaxX(), Map::MaxY(), TileHeight(), TileX(), TileXY(), and TileY().
Referenced by AfterLoadGame(), CheckIfIndustryTilesAreFree(), CmdBuildBuoy(), CmdBuildDock(), CmdBuildObject(), CmdBuildShipDepot(), DoBuildLock(), FindFurthestFromWater(), FindSpring(), FlowRiver(), GrowTown(), IsWateredTile(), MakeLake(), RiverMakeWider(), SetWaterClassDependingOnSurroundings(), TownCanBePlacedHere(), TryBuildLightHouse(), and TryBuildTransmitter().
Checks if a tile belongs to the given owner.
tile | The tile to check |
owner | The owner to check against |
Definition at line 214 of file tile_map.h.
References GetTileOwner().
Referenced by AfterLoadGame(), BuildObject(), ChangeOwnershipOfCompanyItems(), CmdBuildBridge(), CmdBuildCanal(), CmdBuildDock(), CmdBuildObject(), CmdBuildShipDepot(), CmdBuildVehicle(), CmdDepotMassAutoReplace(), CmdDepotSellAllVehicles(), CmdMassStartStopVehicle(), DoClearBridge(), DoClearTunnel(), GetOrderCmdFromTile(), DepotWindow::OnPaint(), RemoveRoad(), RoadFindPathToDest(), and TestTownOwnsBridge().
Checks if a tile is a given tiletype.
This function checks if a tile has the given tiletype.
tile | The tile to check |
type | The type to check against |
Definition at line 150 of file tile_map.h.
References GetTileType().
Referenced by AddClearCounter(), AddClearDensity(), AddNearbyStation(), AddTreeCount(), AddTreeGrowth(), AdjustTileh(), AdvanceSingleHouseConstruction(), AfterLoadGame(), AmbientSoundEffectCallback(), Vehicle::BeginLoading(), CalculateRoadStopCost(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CanRoadContinueIntoNextTile(), Station::CatchmentCoversTown(), ChangeOwnershipOfCompanyItems(), CheckFlatLandRailStation(), CheckFlatLandRoadStop(), CheckForDockingTile(), CheckIfIndustryTilesAreFree(), CheckNextTrainTile(), CheckSubsidised(), ClearNeighbourNonFloodingStates(), ClearPathReservation(), ClearTownHouse(), CmdBuildCanal(), CmdBuildDock(), CmdBuildLongRoad(), CmdBuildObject(), CmdBuildRailWaypoint(), CmdBuildRoad(), CmdBuildRoadStop(), CmdBuildSingleRail(), CmdDeleteTown(), CmdPlantTree(), CmdReverseTrainDirection(), CmdTerraformLand(), CmdTurnRoadVeh(), CMSAMine(), CMSATree(), CMSAWater(), Train::Crash(), CreateRandomTown(), DecHouseProcessingTime(), DeleteLastWagon(), DisasterTick_Aircraft(), DoClearTownHouseHelper(), DoFloodTile(), DoTriggerIndustryTile(), DrawRailCatenaryRailway(), DrawRoadCatenary(), ExtendTrainReservation(), FindFurthestFromWater(), FindNearestEmptyLand(), FindNearIndustryName(), FindRailStationEnd(), FindStationsAroundSelection(), FindStationsNearby(), FindSubsidyCargoDestination(), FindSubsidyTownCargoRoute(), OBJSChunkHandler::FixPointers(), FollowReservation(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::FollowTileExit(), FollowTrainReservation(), ForAllStationsAroundTiles(), FreeTrainTrackReservation(), GetAcceptanceAroundTiles(), GetAnimationFrame(), GetAxisForNewRailWaypoint(), GetCleanHouseType(), GetCleanIndustryGfx(), GetClearCounter(), GetClearDensity(), GetClosestWaterDistance(), GetEffectiveWaterClass(), GetHouseAge(), GetHouseBuildingStage(), GetHouseConstructionTick(), GetHouseProcessingTime(), GetHouseRandomBits(), GetHouseTriggers(), GetIndustryAnimationLoop(), GetIndustryConstructionCounter(), GetIndustryConstructionStage(), GetIndustryGfx(), GetIndustryIndex(), GetIndustryRandomBits(), GetIndustryTriggers(), GetIndustryType(), GetNearbyAirportTileInformation(), GetNearbyIndustryTileInformation(), GetNearbyObjectTileInformation(), GetNearbyTileInformation(), GetObjectIDAtOffset(), GetObjectIndex(), GetObjectRandomBits(), GetObjectType(), GetOrderCmdFromTile(), GetOtherTunnelBridgeEnd(), GetProductionAroundTiles(), GetRailTileType(), CanalScopeResolver::GetRandomBits(), IndustryTileScopeResolver::GetRandomBits(), ObjectScopeResolver::GetRandomBits(), GetRawClearGround(), GetRoadTileType(), GetStationAround(), GetStationGfx(), GetStationIndex(), StationFinder::GetStations(), GetStationTileRandomBits(), GetStationType(), GetTileCatchmentRadius(), GetTileHighlightType(), GetTileOwner(), GetTownIndex(), GetTrainForReservation(), GetTreeCount(), GetTreeDensity(), GetTreeGround(), GetTreeGrowth(), GetTreeType(), IndustryTileScopeResolver::GetTriggers(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), CanalScopeResolver::GetVariable(), HouseScopeResolver::GetVariable(), IndustryTileScopeResolver::GetVariable(), ObjectScopeResolver::GetVariable(), GetWaterTileRandomBits(), GetWaterTileType(), GrowTown(), GrowTownAtRoad(), GrowTownInTile(), HasOnewaySignalBlockingTrackdir(), HasPbsSignalOnTrackdir(), HasStationTileRail(), HasTileWaterClass(), HasTunnelBridgeReservation(), HasTunnelBridgeSnowOrDesert(), HouseResolverObject::HouseResolverObject(), IncHouseConstructionTick(), IncrementHouseAge(), IsAirportTile(), IsAnyRoadStop(), IsAnyRoadStopTile(), IsBridge(), IsBridgeTile(), IsBuoyTile(), IsCoastTile(), IsDockingTile(), IsDockTile(), RoadStop::IsDriveThroughRoadStopContinuation(), IsHangar(), IsHangarTile(), IsHouseCompleted(), IsIndustryCompleted(), IsLevelCrossingTile(), IsNonFloodingWaterTile(), IsNormalRoadTile(), IsObjectTypeTile(), IsPlainRailTile(), IsPossibleCrossing(), IsRailDepotTile(), IsRailStationTile(), IsRailWaypointTile(), IsRoadDepotTile(), IsRoadWaypointTile(), IsSafeWaitingPosition(), IsShipDepotTile(), IsShipDestinationTile(), IsSnowTile(), IsStationRoadStop(), IsStationRoadStopTile(), IsTileForestIndustry(), IsTunnel(), IsTunnelTile(), IsValidTile(), IsValidTileForWaypoint(), IsWaitingPositionFree(), IsWateredTile(), IsWaterTile(), Vehicle::LeaveStation(), LoadUnloadVehicle(), MakeHouseTile(), MarkTileDirtyIfCanalOrRiver(), MayHaveBridgeAbove(), MoveBuoysToWaypoints(), MoveWaypointsToBaseStations(), CYapfCostRailT< Types >::PfCalcCost(), PlaceTreeGroupAroundTile(), ProcessOrders(), RebuildTownCaches(), Station::RecomputeCatchment(), RemoveGenericRoadStop(), RemoveRoad(), ResetHouseAge(), ResetIndustryConstructionStage(), ReverseTrainDirection(), RoadFindPathToDest(), RoadTypesAllowHouseHere(), StationRect::ScanForStationTiles(), SearchLumberMillTrees(), SearchNearbyHouseClass(), SearchNearbyHouseGRFID(), SearchNearbyHouseID(), SearchTileForStatue(), SetAnimationFrame(), SetClearCounter(), SetClearDensity(), SetClearGroundDensity(), SetDefaultRailGui(), SetDockingTile(), SetHouseCompleted(), SetHouseProcessingTime(), SetHouseRandomBits(), SetHouseTriggers(), SetHouseType(), SetIndustryAnimationLoop(), SetIndustryCompleted(), SetIndustryConstructionCounter(), SetIndustryConstructionStage(), SetIndustryGfx(), SetIndustryRandomBits(), SetIndustryTriggers(), SetNonFloodingWaterTile(), SetStationGfx(), SetStationTileRandomBits(), SetTileOwner(), SetTownIndex(), SetTreeGroundDensity(), SetTreeGrowth(), SetTropicZone(), SetTunnelBridgeReservation(), SetTunnelBridgeSnowOrDesert(), SetupFarmFieldFence(), SetWaterTileType(), ShipTestUpDownOnLock(), TestTownOwnsBridge(), Industry::TileBelongsToIndustry(), TileLoop_Water(), TownCanBePlacedHere(), TownCanGrowRoad(), TrainCanLeaveTile(), TrainController(), TriggerWatchedCargoCallbacks(), TryBuildLightHouse(), TryBuildTransmitter(), UpdateHousesAndTowns(), UpdateNearestTownForRoadTiles(), UpdateStatusAfterSwap(), and WatchedCargoCallback().
|
inline |
Checks if a tile is valid.
tile | The tile to check |
Definition at line 161 of file tile_map.h.
References IsTileType(), MP_VOID, and Map::Size().
Referenced by CalculateCoverageLine(), CanConnectToRoad(), CanFollowRoad(), CanRoadContinueIntoNextTile(), CheckForDockingTile(), CheckIfIndustryTilesAreFree(), CheckIfIndustryTileSlopes(), CleanUpRoadBits(), ClearDockingTilesCheckingNeighbours(), ClearNeighbourNonFloodingStates(), CmdBuildBridge(), CmdBuildObject(), CmdBuildRoadStop(), CmdBuildTunnel(), CmdCustomNewsItem(), CmdRemoveRoadStop(), CmdStoryPageButton(), Disaster_CoalMine_Init(), DisasterTick_Big_Ufo(), DisasterTick_Submarine(), DisasterTick_Zeppeliner(), CommandHelper< Tcmd, Tret(*)(DoCommandFlag, Targs...), true >::Do(), DoTriggerIndustryTile(), DrawTileSelectionRect(), FindDockLandPart(), FlowRiver(), GetOtherAqueductEnd(), IndustryTileScopeResolver::GetRandomBits(), ObjectScopeResolver::GetRandomBits(), GetTileOwner(), IndustryTileScopeResolver::GetTriggers(), ObjectScopeResolver::GetVariable(), GrowTownInTile(), GrowTownWithBridge(), GrowTownWithTunnel(), GoalListWindow::HandleClick(), HouseResolverObject::HouseResolverObject(), InvalidateWaterRegion(), IsNeighborRoadTile(), IsShipDestinationTile(), IsTunnelInWayDir(), IsValidLink(), MakeLake(), MarkTileDirtyIfCanalOrRiver(), NeighbourIsNormal(), RedundantBridgeExistsNearby(), RiverMakeWider(), RoadTypesAllowHouseHere(), SetTileOwner(), TileLoop_Water(), TryBuildLightHouse(), and VerifyElementContentParameters().
|
inline |
Set a new animation frame.
t | the tile |
frame | the new frame number |
Definition at line 262 of file tile_map.h.
References IsTileType(), Tile::m7(), MP_HOUSE, MP_INDUSTRY, MP_OBJECT, and MP_STATION.
Referenced by AfterLoadGame(), CmdBuildRailStation(), IncreaseAnimationStage(), and MakeHouseTile().
|
inline |
Sets the height of a tile.
This function sets the height of the northern corner of a tile.
tile | The tile to change the height |
height | The new height value of the tile |
Definition at line 57 of file tile_map.h.
References Tile::height(), MAX_TILE_HEIGHT, and Map::Size().
Referenced by CmdTerraformLand(), FixSlopes(), FlatEmptyWorld(), GrayscaleToMapHeights(), MakeVoid(), and TgenSetTileHeight().
Sets the owner of a tile.
This function sets the owner status of a tile. Note that you cannot set a owner for tiles of type MP_HOUSE, MP_VOID and MP_INDUSTRY.
tile | The tile to change the owner status. |
owner | The new owner. |
Definition at line 198 of file tile_map.h.
References IsTileType(), IsValidTile(), Tile::m1(), MP_HOUSE, MP_INDUSTRY, and SB().
Referenced by AfterLoadGame(), FixOwnerOfRailTrack(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeLockTile(), MakeObject(), MakeRailDepot(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeWater(), RemoveRoad(), and SetTunnelBridgeOwner().
Set the type of a tile.
This functions sets the type of a tile. If the type MP_VOID is selected the tile must be at the south-west or south-east edges of the map and vice versa.
tile | The tile to save the new type |
type | The type to save |
Definition at line 131 of file tile_map.h.
References IsInnerTile(), MP_VOID, SB(), Map::Size(), and Tile::type().
Referenced by AfterLoadGame(), FixOwnerOfRailTrack(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeHouseTile(), MakeIndustry(), MakeLockTile(), MakeObject(), MakeRailDepot(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeVoid(), and MakeWater().
|
inline |
Set the tropic zone.
tile | the tile to set the zone of |
type | the new type |
Definition at line 225 of file tile_map.h.
References IsTileType(), MP_VOID, SB(), Map::Size(), TROPICZONE_NORMAL, and Tile::type().
Referenced by AfterLoadGame(), CmdPlantTree(), GenerateDesertArea(), PlaceTreeGroupAroundTile(), and RiverModifyDesertZone().
|
inline |
Calculate a hash value from a tile position.
x | The X coordinate |
y | The Y coordinate |
Definition at line 324 of file tile_map.h.
Referenced by AfterLoadGame(), Town::InitializeLayout(), and TileHash2Bit().
|
inline |
Get the last two bits of the TileHash from a tile position.
x | The X coordinate |
y | The Y coordinate |
Definition at line 342 of file tile_map.h.
References GB(), and TileHash().
Referenced by DrawTile_Town(), and HouseScopeResolver::GetVariable().
|
static |
Returns the height of a tile.
This function returns the height of the northern corner of a tile. This is saved in the global map-array. It does not take affect by any slope-data of the tile.
tile | The tile to get the height from |
Definition at line 29 of file tile_map.h.
References Tile::height(), and Map::Size().
Referenced by AfterLoadGame(), AmbientSoundEffectCallback(), CalcHeightdiff(), CalculateCoverageLine(), CheckIfCanLevelIndustryPlatform(), CheckNewIndustry_OilRig(), ClickChangeMaxHlCheat(), CmdBuildCanal(), CmdLevelLand(), CmdTerraformLand(), CommonRaiseLowerBigLand(), DoClearBridge(), TownViewWindow::DrawWidget(), FixSlopes(), FlowRiver(), TownViewWindow::GetDesiredInfoHeight(), GetSmallMapContoursPixels(), GetSmallMapIndustriesPixels(), GetSmallMapOwnerPixels(), GetTileHeightBelowAircraft(), GetTileMaxZ(), GetTileSlopeZ(), GetTileZ(), HeightmapCallback(), IsTileFlat(), MakeHeightmapScreenshot(), MakeLake(), MarkBridgeDirty(), MarkTileDirtyByTile(), TerraformGetHeightOfTile(), TileHeightOutsideMap(), TilePixelHeight(), and UpdateTownGrowth().
|
inline |
Returns the height of a tile, also for tiles outside the map (virtual "black" tiles).
x | X coordinate of the tile, may be outside the map. |
y | Y coordinate of the tile, may be outside the map. |
Definition at line 42 of file tile_map.h.
References Clamp(), Map::MaxX(), Map::MaxY(), TileHeight(), and TileXY().
Referenced by GetTilePixelSlopeOutsideMap(), ScrollWindowTo(), and TilePixelHeightOutsideMap().
|
inline |
Returns the height of a tile in pixels.
This function returns the height of the northern corner of a tile in pixels.
tile | The tile to get the height |
Definition at line 72 of file tile_map.h.
References TILE_HEIGHT, and TileHeight().
Referenced by SetupScreenshotViewport(), and ViewportAddLandscape().
|
inline |
Returns the height of a tile in pixels, also for tiles outside the map (virtual "black" tiles).
x | X coordinate of the tile, may be outside the map. |
y | Y coordinate of the tile, may be outside the map. |
Definition at line 84 of file tile_map.h.
References TILE_HEIGHT, and TileHeightOutsideMap().
Referenced by GetViewportY().