OpenTTD
|
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 uint | TileHeight (TileIndex tile) |
Returns the height of a tile. | |
uint | TileHeightOutsideMap (int x, int y) |
Returns the tile height for a coordinate outside map. | |
static void | SetTileHeight (TileIndex tile, uint height) |
Sets the height of a tile. | |
static uint | TilePixelHeight (TileIndex tile) |
Returns the height of a tile in pixels. | |
static uint | TilePixelHeightOutsideMap (int x, int y) |
Returns the tile height for a coordinate outside map. | |
static TileType | GetTileType (TileIndex tile) |
Get the tiletype of a given tile. | |
static bool | IsInnerTile (TileIndex tile) |
Check if a tile is within the map (not a border) | |
static void | SetTileType (TileIndex tile, TileType type) |
Set the type of a tile. | |
static bool | IsTileType (TileIndex tile, TileType type) |
Checks if a tile is a give tiletype. | |
static bool | IsValidTile (TileIndex tile) |
Checks if a tile is valid. | |
static Owner | GetTileOwner (TileIndex tile) |
Returns the owner of a tile. | |
static void | SetTileOwner (TileIndex tile, Owner owner) |
Sets the owner of a tile. | |
static bool | IsTileOwner (TileIndex tile, Owner owner) |
Checks if a tile belongs to the given owner. | |
static void | SetTropicZone (TileIndex tile, TropicZone type) |
Set the tropic zone. | |
static TropicZone | GetTropicZone (TileIndex tile) |
Get the tropic zone. | |
static byte | GetAnimationFrame (TileIndex t) |
Get the current animation frame. | |
static void | SetAnimationFrame (TileIndex t, byte frame) |
Set a new animation frame. | |
Slope | GetTileSlope (TileIndex tile, int *h=NULL) |
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=NULL) |
Check if a given tile is flat. | |
static Slope | GetTilePixelSlope (TileIndex tile, int *h) |
Return the slope of a given tile. | |
Slope | GetTilePixelSlopeOutsideMap (int x, int y, int *h) |
Return the slope of a given tile outside the map. | |
static int | GetTilePixelZ (TileIndex tile) |
Get bottom height of the tile. | |
int | GetTilePixelZOutsideMap (int x, int y) |
Get bottom height of the tile outside map. | |
static int | GetTileMaxPixelZ (TileIndex tile) |
Get top height of the tile. | |
int | GetTileMaxPixelZOutsideMap (int x, int y) |
Get top height of the tile outside the map. | |
static uint | TileHash (uint x, uint y) |
Calculate a hash value from a tile position. | |
static 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.
|
inlinestatic |
Get the current animation frame.
t | the tile |
Definition at line 243 of file tile_map.h.
References _me, IsTileType(), TileExtended::m7, MP_HOUSE, MP_INDUSTRY, MP_OBJECT, and MP_STATION.
Referenced by AnimationBase< IndustryAnimationBase, IndustryTileSpec, Industry, int, GetSimpleIndustryCallback >::AnimateTile(), IndustriesScopeResolver::GetVariable(), IndustryTileScopeResolver::GetVariable(), AirportTileScopeResolver::GetVariable(), HouseScopeResolver::GetVariable(), StationScopeResolver::GetVariable(), ObjectScopeResolver::GetVariable(), and IncreaseAnimationStage().
|
inlinestatic |
Get top height of the tile.
t | Tile to compute height of |
Definition at line 299 of file tile_map.h.
References GetTileMaxZ(), and TILE_HEIGHT.
Referenced by DrawCatenary(), EnsureNoVehicleOnGround(), and SetSelectionTilesDirty().
int GetTileMaxPixelZOutsideMap | ( | int | x, |
int | y | ||
) |
Get top height of the tile outside the map.
tile | Tile outside to compute height of. |
Definition at line 235 of file tile_map.cpp.
References max(), TILE_HEIGHT, and TileHeightOutsideMap().
int GetTileMaxZ | ( | TileIndex | t | ) |
Get top height of the tile inside the map.
t | Tile to compute height of |
Definition at line 215 of file tile_map.cpp.
References MapMaxX(), MapMaxY(), TileDiffXY(), TileHeight(), TileHeightOutsideMap(), TileX(), and TileY().
Referenced by AutoslopeCheckForEntranceEdge(), BuildTownHouse(), CheckBuildHouseSameZ(), CmdBuildBridge(), CmdBuildObject(), DoClearBridge(), DrawCatenaryRailway(), DrawRoadBits(), DrawTramCatenary(), FindSpring(), FloodVehicleProc(), GetOtherAqueductEnd(), GetTerrainType(), and GetTileMaxPixelZ().
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 171 of file tile_map.h.
References _m, GB(), IsTileType(), IsValidTile(), MP_HOUSE, and MP_INDUSTRY.
Referenced by AfterLoadCompanyStats(), AfterLoadGame(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CheckAllowRemoveTunnelBridge(), CheckTileOwnership(), CmdBuildBridge(), CmdBuildObject(), CmdBuildRailWaypoint(), CmdBuildRoad(), CmdBuildSingleRail(), CmdBuildSingleSignal(), CmdConvertRail(), CmdInsertOrder(), CmdRemoveSingleRail(), CmdRemoveSingleSignal(), CmdRenameDepot(), DisasterTick_Big_Ufo(), DisasterTick_Zeppeliner(), DoClearBridge(), DoClearTunnel(), DrawTile_Road(), DrawWaterDepot(), ExploreSegment(), 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 |
h | If not NULL , pointer to storage of z height |
Definition at line 273 of file tile_map.h.
References GetTileSlope(), and TILE_HEIGHT.
Referenced by GetNearbyTileInformation(), and ViewportAddLandscape().
Slope GetTilePixelSlopeOutsideMap | ( | int | x, |
int | y, | ||
int * | h | ||
) |
Return the slope of a given tile outside the map.
tile | Tile outside the map to compute slope of. |
h | If not NULL , pointer to storage of z height. |
Definition at line 141 of file tile_map.cpp.
References GetTileSlopeGivenHeight(), TILE_HEIGHT, and TileHeightOutsideMap().
Referenced by ViewportAddLandscape().
|
inlinestatic |
Get bottom height of the tile.
tile | Tile to compute height of |
Definition at line 287 of file tile_map.h.
References GetTileZ(), and TILE_HEIGHT.
Referenced by DrawCatenaryOnTunnel(), and SetSelectionTilesDirty().
int GetTilePixelZOutsideMap | ( | int | x, |
int | y | ||
) |
Get bottom height of the tile outside map.
tile | Tile outside the map to compute height of. |
Definition at line 200 of file tile_map.cpp.
References min(), TILE_HEIGHT, and TileHeightOutsideMap().
Return the slope of a given tile inside the map.
tile | Tile to compute slope of |
h | If not NULL , pointer to storage of z height |
Definition at line 115 of file tile_map.cpp.
References GetTileSlopeGivenHeight(), MapMaxX(), MapMaxY(), MapSize(), SLOPE_FLAT, TileDiffXY(), TileHeight(), TileX(), and TileY().
Referenced by BuildTownHouse(), CanBuildHouseHere(), CanPlantTreesOnTile(), CheckBuildableTile(), CheckIfIndustryTilesAreFree(), CmdBuildBridge(), CmdBuildCanal(), CmdBuildDock(), CmdBuildLock(), CmdBuildObject(), CmdBuildRoad(), CmdBuildRoadDepot(), CmdBuildSingleRail(), CmdBuildTrainDepot(), CmdBuildTunnel(), CmdPlantTree(), CmdRemoveSingleRail(), DoFloodTile(), DrawCatenaryRailway(), FloodHalftile(), FlowsDown(), GetBridgeHeight(), GetFloodingBehaviour(), GetFoundationSlope(), GetOtherAqueductEnd(), GetTilePixelSlope(), GetTownRoadGridElement(), StationScopeResolver::GetVariable(), ObjectScopeResolver::GetVariable(), GrowTownWithBridge(), IsRoadAllowedHere(), IsValidTileForWaypoint(), IsWateredTile(), BuildDocksToolbarWindow::OnPlaceObject(), BuildDocksToolbarWindow::OnPlacePresize(), PerformIndustryTileSlopeCheck(), PerformStationTileSlopeCheck(), RemoveRoad(), SearchTileForStatue(), and CYapfCostBase::stSlopeCost().
Get the tiletype of a given tile.
tile | The tile to get the TileType |
Definition at line 89 of file tile_map.h.
References _m, GB(), and MapSize().
Referenced by AfterLoadCompanyStats(), AfterLoadGame(), AmbientSoundEffectCallback(), CanEnterTileOwnerCheck(), CanFollowRoad(), CanPlantTreesOnTile(), ChangeTileOwner(), CheckIfFarEnoughFromConflictingIndustry(), CleanUpRoadBits(), ClosestTownFromTile(), CmdBuildBridge(), CmdBuildRoad(), CmdBuildSingleRail(), CmdConvertRail(), CmdDeleteTown(), CmdLandscapeClear(), CmdPlantTree(), CmdRemoveSingleRail(), CmdTerraformLand(), DoDryUp(), DoFloodTile(), DrawCatenary(), ExploreSegment(), GenerateRockyArea(), GetAnyRoadBits(), GetDepotVehicleType(), GetFloodingBehaviour(), GetFoundationSlope(), GetGrfSpecFeature(), GetNearbyTileInformation(), GetRailTrackBitsUniversal(), GetReservedTrackbits(), GetTerrainType(), GetTileRailType(), GetTileTrackStatus(), GrowTownWithExtraHouse(), IsCloseToTown(), Depot::IsOfType(), IsSuitableForFarmField(), IsTileType(), IsWateredTile(), NPFMarkTile(), CYapfCostRoadT< Types >::OneTileCost(), CYapfCostRailT< Types >::OneTileCost(), PlantTreesOnTile(), 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 182 of file tile_map.cpp.
References MapMaxX(), MapMaxY(), min(), TileDiffXY(), TileHeight(), TileX(), and TileY().
Referenced by AmbientSoundEffectCallback(), CheckNewIndustry_BubbleGen(), CheckNewIndustry_Farm(), CheckNewIndustry_Forest(), CmdBuildBridge(), GetOtherTunnelEnd(), GetTerrainType(), GetTilePixelZ(), IndustriesScopeResolver::GetVariable(), CanalScopeResolver::GetVariable(), IsTunnelInWayDir(), LandInfoWindow::OnInit(), PlaceTreeAtSameHeight(), PlaceTreesRandomly(), and TileLoopClearAlps().
|
inlinestatic |
Get the tropic zone.
tile | the tile to get the zone of |
Definition at line 231 of file tile_map.h.
References _m, GB(), and MapSize().
Referenced by CheckNewIndustry_Lumbermill(), CheckNewIndustry_Plantation(), CheckNewIndustry_Water(), CmdPlantTree(), TownViewWindow::DrawWidget(), FindSpring(), FlowRiver(), TownViewWindow::GetDesiredInfoHeight(), GetRandomTreeType(), GetTerrainType(), MakeLake(), NeighbourIsDesert(), PlaceTreesRandomly(), RiverModifyDesertZone(), SplitGroundSpriteForOverlay(), and UpdateTownGrowRate().
|
inlinestatic |
Check if a tile is within the map (not a border)
tile | The tile to check |
Definition at line 102 of file tile_map.h.
References _settings_game, GameSettings::construction, ConstructionSettings::freeform_edges, MapSize(), TileX(), and TileY().
Referenced by GrayscaleToMapHeights(), IsTileFlat(), SetTileType(), and TgenSetTileHeight().
bool IsTileFlat | ( | TileIndex | tile, |
int * | h | ||
) |
Check if a given tile is flat.
tile | Tile to check |
h | If not NULL , pointer to storage of z height (only if tile is flat) |
Definition at line 159 of file tile_map.cpp.
References IsInnerTile(), MapSize(), TileDiffXY(), and TileHeight().
Referenced by AfterLoadGame(), CheckIfIndustryTilesAreFree(), CmdBuildBuoy(), CmdBuildDock(), CmdBuildObject(), CmdBuildShipDepot(), DoBuildLock(), FindFurthestFromWater(), FindSpring(), FlowRiver(), GrowTown(), IsWateredTile(), MakeLake(), 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 207 of file tile_map.h.
References GetTileOwner().
Referenced by AfterLoadGame(), BuildObject(), CanEnterTileOwnerCheck(), ChangeOwnershipOfCompanyItems(), CmdBuildBridge(), CmdBuildCanal(), CmdBuildObject(), CmdBuildVehicle(), CmdDeleteTown(), CmdDepotMassAutoReplace(), DoClearBridge(), DoClearTunnel(), GetOrderCmdFromTile(), DepotWindow::OnPaint(), RemoveRoad(), RoadFindPathToDest(), and Town::~Town().
Checks if a tile is a give tiletype.
This function checks if a tile got the given tiletype.
tile | The tile to check |
type | The type to check against |
Definition at line 143 of file tile_map.h.
References GetTileType().
Referenced by AddClearCounter(), AddClearDensity(), AddNearbyStation(), AddTreeCount(), AddTreeCounter(), AddTreeGrowth(), AdjustTileh(), AfterLoadGame(), AmbientSoundEffectCallback(), Vehicle::BeginLoading(), CanBuildHouseHere(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CanEnterTile(), CanEnterTileOwnerCheck(), ChangeOwnershipOfCompanyItems(), CheckFlatLandRailStation(), CheckFlatLandRoadStop(), CheckIfIndustryTilesAreFree(), CheckNextTrainTile(), CheckSubsidised(), ClearPathReservation(), CmdBuildCanal(), CmdBuildDock(), CmdBuildLongRoad(), CmdBuildObject(), CmdBuildRailWaypoint(), CmdBuildRoad(), CmdBuildRoadStop(), CmdBuildSingleRail(), CmdPlantTree(), CmdRemoveRoadStop(), CmdReverseTrainDirection(), CmdTerraformLand(), CmdTurnRoadVeh(), CMSAMine(), CMSATree(), CMSAWater(), Train::Crash(), DecHouseProcessingTime(), DeleteLastWagon(), DisasterTick_Aircraft(), DoClearTownHouseHelper(), DoFloodTile(), DoTriggerIndustryTile(), DrawCatenaryRailway(), ExtendTrainReservation(), FindFurthestFromWater(), FindIndustryToDeliver(), FindNearestEmptyLand(), FindNearIndustryName(), FindRailStationEnd(), FindStationsAroundTiles(), FindStationsNearby(), FixOldVehicles(), FollowReservation(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::FollowTileExit(), FollowTrainReservation(), FreeTrainTrackReservation(), GetAnimationFrame(), GetAxisForNewWaypoint(), GetCleanHouseType(), GetCleanIndustryGfx(), GetClearCounter(), GetClearDensity(), GetClosestWaterDistance(), GetDockOffset(), 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(), GetRailTileType(), IndustryTileScopeResolver::GetRandomBits(), CanalScopeResolver::GetRandomBits(), HouseScopeResolver::GetRandomBits(), ObjectScopeResolver::GetRandomBits(), GetRawClearGround(), GetRoadOwner(), GetRoadTileType(), GetStationAround(), GetStationGfx(), GetStationIndex(), GetStationTileRandomBits(), GetStationType(), GetTileOwner(), GetTownIndex(), GetTrainForReservation(), GetTreeCount(), GetTreeCounter(), GetTreeDensity(), GetTreeGround(), GetTreeGrowth(), GetTreeType(), IndustryTileScopeResolver::GetTriggers(), HouseScopeResolver::GetTriggers(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), IndustryTileScopeResolver::GetVariable(), CanalScopeResolver::GetVariable(), HouseScopeResolver::GetVariable(), ObjectScopeResolver::GetVariable(), GetWaterTileRandomBits(), GetWaterTileType(), GrowTown(), GrowTownAtRoad(), GrowTownInTile(), HasOnewaySignalBlockingTrackdir(), HasPbsSignalOnTrackdir(), HasStationTileRail(), HasTileWaterClass(), HasTunnelBridgeReservation(), HasTunnelBridgeSnowOrDesert(), IncHouseConstructionTick(), IncrementHouseAge(), IsAirportTile(), IsBridge(), IsBridgeTile(), IsBuoyTile(), IsCoastTile(), IsDockTile(), RoadStop::IsDriveThroughRoadStopContinuation(), IsHangar(), IsHangarTile(), IsHouseCompleted(), IsIndustryCompleted(), IsLevelCrossingTile(), IsNormalRoadTile(), IsObjectTypeTile(), IsPlainRailTile(), IsPossibleCrossing(), IsRailDepotTile(), IsRailStationTile(), IsRailWaypointTile(), IsRoadDepotTile(), IsRoadStop(), IsRoadStopTile(), IsSafeWaitingPosition(), IsShipDepotTile(), IsSnowTile(), IsTileForestIndustry(), IsTunnel(), IsTunnelTile(), IsValidTile(), IsValidTileForWaypoint(), IsWaitingPositionFree(), IsWateredTile(), IsWaterTile(), Vehicle::LeaveStation(), LoadUnloadVehicle(), MakeHouseTile(), MakeSingleHouseBigger(), MarkTileDirtyIfCanalOrRiver(), MayHaveBridgeAbove(), MoveBuoysToWaypoints(), MoveWaypointsToBaseStations(), CYapfCostRailT< Types >::PfCalcCost(), ProcessOrders(), RebuildTownCaches(), RemoveRoad(), ResetHouseAge(), ResetIndustryConstructionStage(), ReverseTrainDirection(), RoadFindPathToDest(), StationRect::ScanForStationTiles(), SearchLumberMillTrees(), SearchNearbyHouseClass(), SearchNearbyHouseGRFID(), SearchNearbyHouseID(), SearchTileForStatue(), SetAnimationFrame(), SetClearCounter(), SetClearDensity(), SetClearGroundDensity(), SetDefaultRailGui(), SetHouseCompleted(), SetHouseProcessingTime(), SetHouseRandomBits(), SetHouseTriggers(), SetHouseType(), SetIndustryAnimationLoop(), SetIndustryCompleted(), SetIndustryConstructionCounter(), SetIndustryConstructionStage(), SetIndustryGfx(), SetIndustryRandomBits(), SetIndustryTriggers(), SetRoadTypes(), SetStationGfx(), SetStationTileRandomBits(), SetTileOwner(), SetTownIndex(), SetTreeCounter(), SetTreeGroundDensity(), SetTreeGrowth(), IndustryTileScopeResolver::SetTriggers(), HouseScopeResolver::SetTriggers(), SetTropicZone(), SetTunnelBridgeReservation(), SetTunnelBridgeSnowOrDesert(), SetupFarmFieldFence(), Industry::TileBelongsToIndustry(), TileLoop_Water(), TownCanBePlacedHere(), TrainCanLeaveTile(), TrainController(), TriggerWatchedCargoCallbacks(), TryBuildLightHouse(), TryBuildTransmitter(), UpdateHousesAndTowns(), UpdateNearestTownForRoadTiles(), UpdateStatusAfterSwap(), UpdateTownCargoes(), and WatchedCargoCallback().
|
inlinestatic |
Checks if a tile is valid.
tile | The tile to check |
Definition at line 154 of file tile_map.h.
References IsTileType(), MapSize(), and MP_VOID.
Referenced by CanFollowRoad(), CheckIfIndustryTilesAreFree(), CleanUpRoadBits(), CmdBuildBridge(), CmdBuildRoadStop(), CmdBuildTunnel(), CmdCreateGoal(), CmdCustomNewsItem(), CmdRemoveRoadStop(), Disaster_CoalMine_Init(), DisasterTick_Big_Ufo(), DisasterTick_Submarine(), DisasterTick_Zeppeliner(), DoCommand(), DoCommandPInternal(), DoTriggerIndustryTile(), DrawTileSelectionRect(), FlowRiver(), GetOtherAqueductEnd(), IndustryTileScopeResolver::GetRandomBits(), HouseScopeResolver::GetRandomBits(), ObjectScopeResolver::GetRandomBits(), GetTileOwner(), IndustryTileScopeResolver::GetTriggers(), HouseScopeResolver::GetTriggers(), ObjectScopeResolver::GetVariable(), GrowTownInTile(), GrowTownWithBridge(), GoalListWindow::HandleClick(), IsNeighborRoadTile(), IsTunnelInWayDir(), MakeLake(), NPFHash(), SetTileOwner(), IndustryTileScopeResolver::SetTriggers(), HouseScopeResolver::SetTriggers(), TileLoop_Water(), TryBuildLightHouse(), and VerifyElementContentParameters().
|
inlinestatic |
Set a new animation frame.
t | the tile |
frame | the new frame number |
Definition at line 255 of file tile_map.h.
References _me, IsTileType(), TileExtended::m7, MP_HOUSE, MP_INDUSTRY, MP_OBJECT, and MP_STATION.
Referenced by AfterLoadGame(), AnimationBase< IndustryAnimationBase, IndustryTileSpec, Industry, int, GetSimpleIndustryCallback >::AnimateTile(), AnimationBase< IndustryAnimationBase, IndustryTileSpec, Industry, int, GetSimpleIndustryCallback >::ChangeAnimationFrame(), CmdBuildRailStation(), IncreaseAnimationStage(), and MakeHouseTile().
|
inlinestatic |
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 49 of file tile_map.h.
References _m, Tile::height, MapSize(), and MAX_TILE_HEIGHT.
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 191 of file tile_map.h.
References _m, IsTileType(), IsValidTile(), MP_HOUSE, MP_INDUSTRY, and SB().
Referenced by AfterLoadGame(), FixOwnerOfRailTrack(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeLockTile(), MakeObject(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeWater(), and RemoveRoad().
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 124 of file tile_map.h.
References _m, IsInnerTile(), MapSize(), MP_VOID, and SB().
Referenced by MakeBridgeRamp(), MakeClear(), MakeField(), MakeHouseTile(), MakeIndustry(), MakeLockTile(), MakeObject(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeVoid(), and MakeWater().
|
inlinestatic |
Set the tropic zone.
tile | the tile to set the zone of |
type | the new type |
Definition at line 218 of file tile_map.h.
References _m, IsTileType(), MapSize(), MP_VOID, SB(), and TROPICZONE_NORMAL.
Referenced by AfterLoadGame(), CmdPlantTree(), GenerateDesertArea(), and RiverModifyDesertZone().
|
inlinestatic |
Calculate a hash value from a tile position.
x | The X coordinate |
y | The Y coordinate |
Definition at line 314 of file tile_map.h.
Referenced by AfterLoadGame(), Town::InitializeLayout(), River_Hash(), and TileHash2Bit().
|
inlinestatic |
Get the last two bits of the TileHash from a tile position.
x | The X coordinate |
y | The Y coordinate |
Definition at line 332 of file tile_map.h.
References GB(), and TileHash().
Referenced by DrawTile_Town(), and HouseScopeResolver::GetVariable().
|
inlinestatic |
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 31 of file tile_map.h.
References _m, Tile::height, and MapSize().
Referenced by AfterLoadGame(), AmbientSoundEffectCallback(), CalcHeightdiff(), CheckIfCanLevelIndustryPlatform(), CheckNewIndustry_OilRig(), ClampXYToMap(), ClickChangeMaxHlCheat(), CmdBuildCanal(), CmdLevelLand(), CmdTerraformLand(), CommonRaiseLowerBigLand(), DoClearBridge(), TownViewWindow::DrawWidget(), FixSlopes(), FlowRiver(), TownViewWindow::GetDesiredInfoHeight(), GetSmallMapContoursPixels(), GetSmallMapIndustriesPixels(), GetSmallMapOwnerPixels(), GetTileHeightBelowAircraft(), GetTileMaxZ(), GetTileSlope(), GetTileZ(), HeightmapCallback(), IsTileFlat(), MakeLake(), MarkBridgeDirty(), TerraformGetHeightOfTile(), TileHeightOutsideMap(), TilePixelHeight(), and UpdateTownGrowRate().
uint TileHeightOutsideMap | ( | int | x, |
int | y | ||
) |
Returns the tile height for a coordinate outside map.
Such a height is needed for painting the area outside map using completely black tiles. The idea is descending to heightlevel 0 as fast as possible.
x | The X-coordinate (same unit as TileX). |
y | The Y-coordinate (same unit as TileY). |
Definition at line 25 of file tile_map.cpp.
References MapMaxX(), MapMaxY(), max(), TileHeight(), and TileXY().
Referenced by GetTileMaxPixelZOutsideMap(), GetTileMaxZ(), GetTilePixelSlopeOutsideMap(), GetTilePixelZOutsideMap(), ScrollWindowTo(), and TilePixelHeightOutsideMap().
|
inlinestatic |
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 64 of file tile_map.h.
References TILE_HEIGHT, and TileHeight().
Referenced by MarkTileDirtyByTile(), SetupScreenshotViewport(), and ViewportAddLandscape().
|
inlinestatic |
Returns the tile height for a coordinate outside map.
Such a height is needed for painting the area outside map using completely black tiles. The idea is descending to heightlevel 0 as fast as possible.
x | The X-coordinate (same unit as TileX). |
y | The Y-coordinate (same unit as TileY). |
Definition at line 77 of file tile_map.h.
References TILE_HEIGHT, and TileHeightOutsideMap().
Referenced by GetViewportY(), and MarkTileDirtyByTileOutsideMap().