Functions related to maps. More...
#include "core/math_func.hpp"
#include "tile_type.h"
#include "map_type.h"
#include "direction_func.h"
Go to the source code of this file.
Defines | |
#define | TILE_MASK(x) ((x) & _map_tile_mask) |
'Wraps' the given tile to it is within the map. | |
#define | TILE_ADD(x, y) ((x) + (y)) |
Adds to tiles together. | |
#define | TILE_ADDXY(tile, x, y) TILE_ADD(tile, TileDiffXY(x, y)) |
Adds a given offset to a tile. | |
#define | RandomTile() RandomTileSeed(Random()) |
Get a valid random tile. | |
#define | TILE_LOOP(var, w, h, tile) |
A loop which iterates to a square of tiles. | |
Typedefs | |
typedef int32 | TileIndexDiff |
An offset value between to tiles. | |
typedef bool | TestTileOnSearchProc (TileIndex tile, void *user_data) |
A callback function type for searching tiles. | |
Functions | |
void | AllocateMap (uint size_x, uint size_y, bool allocate_map_heightdata) |
(Re)allocates a map with the given dimension | |
void | CopyHeightlevelDataFromOldToExtended () |
Copies the contents of the old heightlevel array (4 bits in Tile.type_height) into the new heightlevel array (_map_heightdata). | |
bool | CopyHeightlevelDataFromExtendedToOld () |
Copies the contents of the _map_heightdata array into the old place of heightlevel information in Tile.type_height. | |
static uint | MapLogX () |
Logarithm of the map size along the X side. | |
static uint | MapLogY () |
Logarithm of the map size along the y side. | |
static uint | MapSizeX () |
Get the size of the map along the X. | |
static uint | MapSizeY () |
Get the size of the map along the Y. | |
static uint | MapSize () |
Get the size of the map. | |
static uint | MapMaxX () |
Gets the maximum X coordinate within the map, including MP_VOID. | |
static uint | MapMaxY () |
Gets the maximum Y coordinate within the map, including MP_VOID. | |
static uint | ScaleByMapSize (uint n) |
Scales the given value by the map size, where the given value is for a 256 by 256 map. | |
static uint | ScaleByMapSize1D (uint n) |
Scales the given value by the maps circumference, where the given value is for a 256 by 256 map. | |
static TileIndex | TileXY (uint x, uint y) |
Returns the TileIndex of a coordinate. | |
static TileIndexDiff | TileDiffXY (int x, int y) |
Calculates an offset for the given coordinate(-offset). | |
static TileIndex | TileVirtXY (uint x, uint y) |
Get a tile from the virtual XY-coordinate. | |
static uint | TileX (TileIndex tile) |
Get the X component of a tile. | |
static uint | TileY (TileIndex tile) |
Get the Y component of a tile. | |
static TileIndexDiff | ToTileIndexDiff (TileIndexDiffC tidc) |
Return the offset between to tiles from a TileIndexDiffC struct. | |
TileIndex | TileAddWrap (TileIndex tile, int addx, int addy) |
This function checks if we add addx/addy to tile, if we do wrap around the edges. | |
static TileIndexDiffC | TileIndexDiffCByDiagDir (DiagDirection dir) |
Returns the TileIndexDiffC offset from a DiagDirection. | |
static TileIndexDiffC | TileIndexDiffCByDir (Direction dir) |
Returns the TileIndexDiffC offset from a Direction. | |
static TileIndex | AddTileIndexDiffCWrap (TileIndex tile, TileIndexDiffC diff) |
Add a TileIndexDiffC to a TileIndex and returns the new one. | |
static TileIndexDiffC | TileIndexToTileIndexDiffC (TileIndex tile_a, TileIndex tile_b) |
Returns the diff between two tiles. | |
uint | DistanceManhattan (TileIndex, TileIndex) |
also known as L1-Norm. Is the shortest distance one could go over diagonal tracks (or roads) | |
uint | DistanceSquare (TileIndex, TileIndex) |
euclidian- or L2-Norm squared | |
uint | DistanceMax (TileIndex, TileIndex) |
also known as L-Infinity-Norm | |
uint | DistanceMaxPlusManhattan (TileIndex, TileIndex) |
Max + Manhattan. | |
uint | DistanceFromEdge (TileIndex) |
shortest distance from any edge of the map | |
uint | DistanceFromEdgeDir (TileIndex, DiagDirection) |
distance from the map edge in given direction | |
static TileIndexDiff | TileOffsByDiagDir (DiagDirection dir) |
Convert a DiagDirection to a TileIndexDiff. | |
static TileIndexDiff | TileOffsByDir (Direction dir) |
Convert a Direction to a TileIndexDiff. | |
static TileIndex | TileAddByDiagDir (TileIndex tile, DiagDirection dir) |
Adds a DiagDir to a tile. | |
static DiagDirection | DiagdirBetweenTiles (TileIndex tile_from, TileIndex tile_to) |
Determines the DiagDirection to get from one tile to another. | |
bool | CircularTileSearch (TileIndex *tile, uint size, TestTileOnSearchProc proc, void *user_data) |
Function performing a search around a center tile and going outward, thus in circle. | |
bool | CircularTileSearch (TileIndex *tile, uint radius, uint w, uint h, TestTileOnSearchProc proc, void *user_data) |
Generalized circular search allowing for rectangles and a hole. | |
static TileIndex | RandomTileSeed (uint32 r) |
Get a random tile out of a given seed. | |
uint | GetClosestWaterDistance (TileIndex tile, bool water) |
Finds the distance for the closest tile with water/land given a tile. | |
Variables | |
uint | _map_tile_mask |
_map_size - 1 (to mask the mapsize) | |
Tile * | _m |
Pointer to the tile-array. | |
TileExtended * | _me |
Pointer to the extended tile-array. | |
TileHeightData * | _map_heightdata |
Pointer to the tile-array saving extended heightlevel data. |
Functions related to maps.
Definition in file map_func.h.
#define RandomTile | ( | ) | RandomTileSeed(Random()) |
Get a valid random tile.
Definition at line 436 of file map_func.h.
Referenced by CmdBuildIndustry(), DisasterTick_Big_Ufo(), DisasterTick_Ufo(), PlaceIndustry(), PlaceTreeGroups(), and ReleaseDisastersTargetingVehicle().
#define TILE_ADD | ( | x, | ||
y | ||||
) | ((x) + (y)) |
Adds to tiles together.
x | One tile | |
y | Another tile to add |
Definition at line 257 of file map_func.h.
Referenced by CalcHeightdiff(), CircularTileSearch(), FindRailStationEnd(), FindStationsNearby(), Ship::GetOrderStationLocation(), GetOtherAqueductEnd(), GrowTown(), IsNeighborRoadTile(), NPFSaveTargetData(), OPFShipChooseTrack(), CYapfReserveTrack< Types >::ReserveRailStationPlatform(), SetRailStationPlatformReservation(), TileAddByDiagDir(), and CYapfReserveTrack< Types >::UnreserveSingleTrack().
#define TILE_ADDXY | ( | tile, | ||
x, | ||||
y | ||||
) | TILE_ADD(tile, TileDiffXY(x, y)) |
Adds a given offset to a tile.
tile | The tile to add an offset on it | |
x | The x offset to add to the tile | |
y | The y offset to add to the tile |
Definition at line 271 of file map_func.h.
Referenced by AfterLoadGame(), CheckAllowRemoveRoad(), CheckNewIndustry_OilRefinery(), CheckNewIndustry_OilRig(), DrawWaterEdges(), FindStationsNearby(), TileArea::GetCenterTile(), GetOtherAqueductEnd(), HeightmapCallback(), and MakeTownHouseBigger().
#define TILE_LOOP | ( | var, | ||
w, | ||||
h, | ||||
tile | ||||
) |
for (uint var = tile, cur_h = (h); cur_h > 0; --cur_h, var += TileDiffXY(0, 1) - (w)) \ for (uint cur_w = (w); cur_w > 0; --cur_w, var++)
A loop which iterates to a square of tiles.
This macro starts 2 nested loops which iterates over a square of tiles.
var | The name of the variable which contains the current tile | |
w | The width (x-width) of the square | |
h | The heigth (y-width) of the square | |
tile | The start tile of the square |
Definition at line 452 of file map_func.h.
Referenced by CopyPaste::CopyArea(), CopyPaste::internal_PasteArea(), and CopyPaste::PasteLandscape().
#define TILE_MASK | ( | x | ) | ((x) & _map_tile_mask) |
'Wraps' the given tile to it is within the map.
It does this by masking the 'high' bits of.
x | the tile to 'wrap' |
Definition at line 28 of file map_func.h.
Referenced by DisasterTick_Big_Ufo(), GetNearbyTile(), and RandomTileSeed().
typedef bool TestTileOnSearchProc(TileIndex tile, void *user_data) |
A callback function type for searching tiles.
tile | The tile to test | |
user_data | additional data for the callback function to use |
Definition at line 415 of file map_func.h.
typedef int32 TileIndexDiff |
An offset value between to tiles.
This value is used fro the difference between to tiles. It can be added to a tileindex to get the resulting tileindex of the start tile applied with this saved difference.
Definition at line 167 of file map_func.h.
static TileIndex AddTileIndexDiffCWrap | ( | TileIndex | tile, | |
TileIndexDiffC | diff | |||
) | [inline, static] |
Add a TileIndexDiffC to a TileIndex and returns the new one.
Returns tile + the diff given in diff. If the result tile would end up outside of the map, INVALID_TILE is returned instead.
tile | The base tile to add the offset on | |
diff | The offset to add on the tile |
Definition at line 313 of file map_func.h.
References INVALID_TILE, MapSizeX(), MapSizeY(), TileX(), TileXY(), TileY(), TileIndexDiffC::x, and TileIndexDiffC::y.
Referenced by TileLoop_Water().
void AllocateMap | ( | uint | size_x, | |
uint | size_y, | |||
bool | allocate_map_heightdata | |||
) |
(Re)allocates a map with the given dimension
size_x | the width of the map along the NE/SW edge | |
size_y | the 'height' of the map along the SE/NW edge |
Reason for this additional parameter: This procedure is called in different circumstances. If we call it during the generation of a new map, everything is ok, we know about the configuration setting regarding additional heightlevels.
If, however, we call it while loading a savegame, we call it before we load the configuration. So, in this case we call it at a point where we don't know yet wether we need the _map_heightdata array or not. So, in this case, we ignore it in this procedure and construct it in LoadMAPH in misc.cpp if and only if we need it.
Definition at line 56 of file map.cpp.
References _map_log_x, _map_log_y, _map_size, _map_size_x, _map_size_y, _map_tile_mask, AllowMoreHeightlevels(), DEBUG, error(), FindFirstBit(), MAX_MAP_SIZE, MAX_MAP_TILES, and MIN_MAP_SIZE.
bool CircularTileSearch | ( | TileIndex * | tile, | |
uint | size, | |||
TestTileOnSearchProc | proc, | |||
void * | user_data | |||
) |
Function performing a search around a center tile and going outward, thus in circle.
Although it really is a square search... Every tile will be tested by means of the callback function proc, which will determine if yes or no the given tile meets criteria of search.
tile | to start the search from. Upon completion, it will return the tile matching the search | |
size,: | number of tiles per side of the desired search area | |
proc,: | callback testing function pointer. | |
user_data | to be passed to the callback function. Depends on the implementation |
Definition at line 326 of file map.cpp.
References CircularTileSearch(), DIR_N, TILE_ADD, and TileOffsByDir().
Referenced by ChopLumberMillTrees(), CircularTileSearch(), FindNearestGoodCoastalTownSpot(), FindStationsNearby(), GetDistanceFromNearbyHouse(), Station::RecomputeIndustriesNear(), and TownActionBuildStatue().
bool CircularTileSearch | ( | TileIndex * | tile, | |
uint | radius, | |||
uint | w, | |||
uint | h, | |||
TestTileOnSearchProc | proc, | |||
void * | user_data | |||
) |
Generalized circular search allowing for rectangles and a hole.
Function performing a search around a center rectangle and going outward. The center rectangle is left out from the search. To do a rectangular search without a hole, set either h or w to zero. Every tile will be tested by means of the callback function proc, which will determine if yes or no the given tile meets criteria of search.
tile | to start the search from. Upon completion, it will return the tile matching the search. This tile should be directly north of the hole (if any). | |
radius | How many tiles to search outwards. Note: This is a radius and thus different from the size parameter of the other CircularTileSearch function, which is a diameter. | |
w | the width of the inner rectangle | |
h | the height of the inner rectangle | |
proc | callback testing function pointer. | |
user_data | to be passed to the callback function. Depends on the implementation |
Definition at line 364 of file map.cpp.
References DIAGDIR_BEGIN, INVALID_TILE, MapSizeX(), MapSizeY(), TileX(), TileXY(), TileY(), TileIndexDiffC::x, and TileIndexDiffC::y.
bool CopyHeightlevelDataFromExtendedToOld | ( | ) |
Copies the contents of the _map_heightdata array into the old place of heightlevel information in Tile.type_height.
But only, if all heightlevels can be encoded in 4 bit. If not, the procedure returns immediately, leaving some type_height values in their original state and some not.
void CopyHeightlevelDataFromOldToExtended | ( | ) |
Copies the contents of the old heightlevel array (4 bits in Tile.type_height) into the new heightlevel array (_map_heightdata).
Constructs _map_heightdata according to map size.
Used when switching the allow_more_heightlevel setting.
static DiagDirection DiagdirBetweenTiles | ( | TileIndex | tile_from, | |
TileIndex | tile_to | |||
) | [inline, static] |
Determines the DiagDirection to get from one tile to another.
The tiles do not necessarily have to be adjacent.
tile_from | Origin tile | |
tile_to | Destination tile |
Definition at line 395 of file map_func.h.
References DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_SE, DIAGDIR_SW, TileX(), and TileY().
Referenced by AIBridge::_BuildBridgeRoad1(), AIBridge::_BuildBridgeRoad2(), AITunnel::_BuildTunnelRoad1(), AITunnel::_BuildTunnelRoad2(), and AIMarine::AreWaterTilesConnected().
uint DistanceFromEdge | ( | TileIndex | tile | ) |
shortest distance from any edge of the map
shortest distance from any edge of the map
tile | the tile to get the distance from |
Definition at line 285 of file map.cpp.
References MapSizeX(), MapSizeY(), min(), TileX(), and TileY().
Referenced by CheckNewIndustry_OilRefinery(), CheckNewIndustry_OilRig(), GrayscaleToMapHeights(), GrowTownWithExtraHouse(), IsRoadAllowedHere(), TownCanBePlacedHere(), and VpSelectTilesWithMethod().
uint DistanceFromEdgeDir | ( | TileIndex | tile, | |
DiagDirection | dir | |||
) |
distance from the map edge in given direction
distance from the map edge in given direction
tile | the tile to get the distance from | |
dir | the direction of interest |
Definition at line 302 of file map.cpp.
References _settings_game, GameSettings::construction, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_SE, DIAGDIR_SW, ConstructionSettings::freeform_edges, MapMaxX(), MapMaxY(), TileX(), and TileY().
Referenced by GetOtherAqueductEnd().
also known as L1-Norm. Is the shortest distance one could go over diagonal tracks (or roads)
also known as L1-Norm. Is the shortest distance one could go over diagonal tracks (or roads)
The Manhattan distance is the sum of the delta of both the X and Y component. Also known as L1-Norm
t0 | the start tile | |
t1 | the end tile |
Definition at line 225 of file map.cpp.
References Delta(), TileX(), and TileY().
Referenced by LinkGraphComponent::AddNode(), AirportGetNearestTown(), AIMarine::AreWaterTilesConnected(), AIRail::BuildRail(), CalcClosestTownFromTile(), CalcRaildirsDrawstyle(), AIRoad::CanBuildConnectedRoadPartsHere(), ClosestTownFromTile(), CopyPaste::CopyArea(), DeliverGoods(), FindDeletedWaypointCloseTo(), GetClosestDeletedStation(), GetClosestObject(), GetCountAndDistanceOfClosestInstance(), GetDistanceFromNearbyHouse(), AITown::GetDistanceManhattanToTile(), AITile::GetDistanceManhattanToTile(), AIStation::GetDistanceManhattanToTile(), AIIndustry::GetDistanceManhattanToTile(), GetMovingAverageLength(), IndustryGetVariable(), IsCloseToTown(), ObjectGetVariable(), CargoPayment::PayTransfer(), Station::RecomputeIndustriesNear(), AIRail::RemoveRail(), VpSelectTilesWithMethod(), VpSetPresizeRange(), and YapfTrainCheckReverse().
also known as L-Infinity-Norm
also known as L-Infinity-Norm
Also known as L-Infinity-Norm.
t0 | the start tile | |
t1 | the end tile |
Definition at line 257 of file map.cpp.
References Delta(), max(), TileX(), and TileY().
Referenced by CheckIfFarEnoughFromConflictingIndustry(), CheckIfIndustryIsAllowed(), and FindStationsNearby().
euclidian- or L2-Norm squared
euclidian- or L2-Norm squared
The 'Square' distance is the square of the shortest (straight line) distance between the two tiles. Also known as euclidian- or L2-Norm squared.
t0 | the start tile | |
t1 | the end tile |
Definition at line 242 of file map.cpp.
References TileX(), and TileY().
Referenced by FindNearestHangar(), AITown::GetDistanceSquareToTile(), AITile::GetDistanceSquareToTile(), AIStation::GetDistanceSquareToTile(), AIIndustry::GetDistanceSquareToTile(), GetTownRadiusGroup(), IndustryGetVariable(), ObjectGetVariable(), and UpdateTownGrowRate().
uint GetClosestWaterDistance | ( | TileIndex | tile, | |
bool | water | |||
) |
Finds the distance for the closest tile with water/land given a tile.
tile | the tile to find the distance too | |
water | whether to find water or land |
Definition at line 408 of file map.cpp.
References _settings_game, GameSettings::construction, DIAGDIR_BEGIN, ConstructionSettings::freeform_edges, HasTileWaterGround(), IsInsideMM(), IsTileType(), MapMaxX(), MapMaxY(), MapSize(), MP_VOID, MP_WATER, TileX(), TileXY(), and TileY().
Referenced by FindFurthestFromWater(), and IndustryGetVariable().
static uint MapLogX | ( | ) | [inline, static] |
Logarithm of the map size along the X side.
Definition at line 64 of file map_func.h.
References _map_log_x.
Referenced by ScaleByMapSize(), ScaleByMapSize1D(), StartupIndustryDailyChanges(), TGPGetMaxAllowedHeight(), TileVirtXY(), TileXY(), TileY(), and ToTileIndexDiff().
static uint MapLogY | ( | ) | [inline, static] |
Logarithm of the map size along the y side.
Definition at line 75 of file map_func.h.
References _map_log_y.
Referenced by ScaleByMapSize(), ScaleByMapSize1D(), StartupIndustryDailyChanges(), and TGPGetMaxAllowedHeight().
static uint MapMaxX | ( | ) | [inline, static] |
Gets the maximum X coordinate within the map, including MP_VOID.
Definition at line 115 of file map_func.h.
References MapSizeX().
Referenced by AfterLoadGame(), CalcRaildirsDrawstyle(), CheckIfCanLevelIndustryPlatform(), CmdBuildTunnel(), CreateEffectVehicleAbove(), DisasterTick_Aircraft(), DistanceFromEdgeDir(), SmallMapWindow::DrawSmallMapColumn(), Station::GetCatchmentRect(), GetClosestWaterDistance(), GetNorthernEndOfColumn(), GetSouthernEndOfColumn(), GetTileMaxZ(), GetTileSlope(), GetTileZ(), GrayscaleToMapHeights(), GUIPlaceProcDragXY(), HeightmapCallback(), IsTunnelInWay(), MakeWorldScreenshot(), SetAircraftPosition(), SmallMapWindow::SetNewScroll(), SetSelectionTilesDirty(), SetTileType(), SetWaterClassDependingOnSurroundings(), TerraformTileHeight(), TgenSetTileHeight(), TileAddWrap(), TileHeightOutsideMap(), TileX(), and TranslateXYToTileCoord().
static uint MapMaxY | ( | ) | [inline, static] |
Gets the maximum Y coordinate within the map, including MP_VOID.
Definition at line 124 of file map_func.h.
References MapSizeY().
Referenced by AfterLoadGame(), CalcRaildirsDrawstyle(), CheckIfCanLevelIndustryPlatform(), CreateEffectVehicleAbove(), DistanceFromEdgeDir(), SmallMapWindow::DrawSmallMapColumn(), Station::GetCatchmentRect(), GetClosestWaterDistance(), GetNorthernEndOfColumn(), GetSouthernEndOfColumn(), GetTileMaxZ(), GetTileSlope(), GetTileZ(), GrayscaleToMapHeights(), GUIPlaceProcDragXY(), IsTunnelInWay(), MakeWorldScreenshot(), SetAircraftPosition(), SmallMapWindow::SetNewScroll(), SetSelectionTilesDirty(), SetTileType(), SetWaterClassDependingOnSurroundings(), TerraformTileHeight(), TgenSetTileHeight(), TileAddWrap(), TileHeightOutsideMap(), and TranslateXYToTileCoord().
static uint MapSize | ( | ) | [inline, static] |
Get the size of the map.
Definition at line 105 of file map_func.h.
References _map_size.
Referenced by AfterLoadCompanyStats(), AfterLoadGame(), ChangeOwnershipOfCompanyItems(), TileArea::ClampToMap(), ClearAllTrafficLights(), CmdBuildCanal(), CmdBuildLongRoad(), CmdClearArea(), CmdConvertRail(), CmdDeleteTown(), CmdLevelLand(), CmdPlantTree(), CmdRailTrackHelper(), CmdRemoveFromRailStation(), CmdRemoveFromRailWaypoint(), CmdRemoveLongRoad(), CmdSignalTrackHelper(), CmdTerraformLand(), CopyHeightlevelDataFromExtendedToOld(), CopyHeightlevelDataFromOldToExtended(), DEF_CONSOLE_CMD(), DiagonalTileIterator::DiagonalTileIterator(), DoCommand(), DoCommandPInternal(), DrawStationCoverageAreaText(), FindStationsNearby(), GetClosestWaterDistance(), AIMap::GetMapSize(), GetTileSlope(), GetTileType(), GetTropicZone(), GrowTownAtRoad(), GrowTownInTile(), IsValidTile(), AITile::LevelTiles(), Load_MAPH(), AITile::LowerTile(), MakeWorldScreenshot(), DiagonalTileIterator::operator++(), AITile::RaiseTile(), SetDefaultRailGui(), SetTileHeight(), SetTileType(), SetTropicZone(), TerraformTileHeight(), TileHeight(), UpdateAllBlockSignals(), UpdateHousesAndTowns(), UpdateNearestTownForRoadTiles(), and Town::~Town().
static uint MapSizeX | ( | ) | [inline, static] |
Get the size of the map along the X.
Definition at line 85 of file map_func.h.
References _map_size_x.
Referenced by _GenerateWorld(), AddTileIndexDiffCWrap(), AllocHeightMap(), AIRail::AreTilesConnected(), CircularTileSearch(), TileArea::ClampToMap(), DEF_CONSOLE_CMD(), Disaster_Small_Ufo_Init(), DisasterTick_Aircraft(), DisasterTick_Big_Ufo_Destroyer(), DistanceFromEdge(), FixSlopes(), FlatEmptyWorld(), GenerateLandscape(), GenerateWorld(), GetAcceptanceAroundTiles(), AIVehicle::GetLocation(), AIMap::GetMapSizeX(), GetProductionAroundTiles(), GetTileHeightBelowAircraft(), GrayscaleToMapHeights(), CopyPaste::internal_PasteArea(), MakeHeightmapScreenshot(), MapMaxX(), DiagonalTileIterator::operator++(), ServerNetworkUDPSocketHandler::Receive_CLIENT_FIND_SERVER(), ScrollWindowTo(), ServerNetworkAdminSocketHandler::SendWelcome(), SetSelectionTilesDirty(), SimulateDrag(), TerraformTileHeight(), and TileDiffXY().
static uint MapSizeY | ( | ) | [inline, static] |
Get the size of the map along the Y.
Definition at line 95 of file map_func.h.
References _map_size_y.
Referenced by _GenerateWorld(), AddTileIndexDiffCWrap(), AllocHeightMap(), CircularTileSearch(), TileArea::ClampToMap(), DEF_CONSOLE_CMD(), Disaster_Small_Ufo_Init(), DisasterTick_Zeppeliner(), DistanceFromEdge(), FixSlopes(), FlatEmptyWorld(), GenerateLandscape(), GenerateWorld(), GetAcceptanceAroundTiles(), AIVehicle::GetLocation(), AIMap::GetMapSizeY(), GetProductionAroundTiles(), GetTileHeightBelowAircraft(), GrayscaleToMapHeights(), CopyPaste::internal_PasteArea(), MakeHeightmapScreenshot(), MapMaxY(), DiagonalTileIterator::operator++(), ServerNetworkUDPSocketHandler::Receive_CLIENT_FIND_SERVER(), ScrollWindowTo(), ServerNetworkAdminSocketHandler::SendWelcome(), SetSelectionTilesDirty(), and TerraformTileHeight().
static TileIndex RandomTileSeed | ( | uint32 | r | ) | [inline, static] |
Get a random tile out of a given seed.
r | the random 'seed' |
Definition at line 425 of file map_func.h.
References TILE_MASK.
Referenced by PlaceTreesRandomly().
static uint ScaleByMapSize | ( | uint | n | ) | [inline, static] |
Scales the given value by the map size, where the given value is for a 256 by 256 map.
n | the value to scale |
Definition at line 135 of file map_func.h.
References CeilDiv(), MapLogX(), and MapLogY().
Referenced by GenerateLandscape(), GenerateTowns(), GenerateTrees(), GetNumberOfIndustries(), GetScaledIndustryGenerationProbability(), IndustryBuildData::MonthlyLoop(), and PlaceTreesRandomly().
static uint ScaleByMapSize1D | ( | uint | n | ) | [inline, static] |
Scales the given value by the maps circumference, where the given value is for a 256 by 256 map.
n | the value to scale |
Definition at line 149 of file map_func.h.
References CeilDiv(), MapLogX(), and MapLogY().
Referenced by GetScaledIndustryGenerationProbability(), and UpdateViewportPosition().
static TileIndex TileAddByDiagDir | ( | TileIndex | tile, | |
DiagDirection | dir | |||
) | [inline, static] |
Adds a DiagDir to a tile.
tile | The current tile | |
dir | The direction in which we want to step |
Definition at line 383 of file map_func.h.
References TILE_ADD, and TileOffsByDiagDir().
Referenced by CleanUpRoadBits(), ClearPathReservation(), CmdRemoveSingleSignal(), GrowTownAtRoad(), GrowTownInTile(), GrowTownWithBridge(), GrowTownWithExtraHouse(), MaskWireBits(), NeighbourHasReachableRoad(), BuildDocksToolbarWindow::OnPlaceObject(), BuildDocksToolbarWindow::OnPlacePresize(), SetWaterClassDependingOnSurroundings(), TryPathReserve(), and UpdateLevelCrossing().
This function checks if we add addx/addy to tile, if we do wrap around the edges.
For example, tile = (10,2) and addx = +3 and addy = -4. This function will now return INVALID_TILE, because the y is wrapped. This is needed in for example, farmland. When the tile is not wrapped, the result will be tile + TileDiffXY(addx, addy)
tile | the 'starting' point of the adding | |
addx | the amount of tiles in the X direction to add | |
addy | the amount of tiles in the Y direction to add |
Definition at line 182 of file map.cpp.
References _settings_game, GameSettings::construction, ConstructionSettings::freeform_edges, INVALID_TILE, MapMaxX(), MapMaxY(), TileDiffXY(), TileX(), and TileY().
Referenced by CheckIfIndustryTilesAreFree(), CmdBuildRoadStop(), CmdRemoveRoadStop(), CountMapSquareAround(), DisasterTick_Big_Ufo_Destroyer(), FindStationsAroundTiles(), PlaceTreeAtSameHeight(), and PlaceTreeGroups().
static TileIndexDiff TileDiffXY | ( | int | x, | |
int | y | |||
) | [inline, static] |
Calculates an offset for the given coordinate(-offset).
This function calculate an offset value which can be added to an TileIndex. The coordinates can be negative.
x | The offset in x direction | |
y | The offset in y direction |
Definition at line 192 of file map_func.h.
References MapSizeX().
Referenced by AITileList_IndustryAccepting::AITileList_IndustryAccepting(), AITileList_IndustryProducing::AITileList_IndustryProducing(), AIRoad::CanBuildConnectedRoadPartsHere(), ChangeIndustryProduction(), CheckCanTerraformSurroundingTiles(), CheckIfCanLevelIndustryPlatform(), CmdBuildBridge(), CmdBuildRailStation(), CmdBuildShipDepot(), CmdRemoveLongRoad(), CmdTerraformLand(), CopyPaste::CopyArea(), Disaster_CoalMine_Init(), DrawTrafficLights(), GetHouseNorthPart(), GetIntraTLCAllowedDirections(), GetNearbyTile(), GetOtherShipDepotTile(), Station::GetPlatformLength(), GetReferenceTile(), Airport::GetRotatedTileFromOffset(), GetStationAround(), GetTileMaxZ(), GetTileSlope(), GetTileZ(), GUIPlaceProcDragXY(), CopyPaste::internal_PasteArea(), MakeTownHouse(), Station::MarkTilesDirty(), NeighbourIsDesert(), NormaliseTileOffset(), OrthogonalTileIterator::operator++(), AITile::PlantTreeRectangle(), TerraformAddDirtyTileAround(), TileAddWrap(), and UpdateHousesAndTowns().
static TileIndexDiffC TileIndexDiffCByDiagDir | ( | DiagDirection | dir | ) | [inline, static] |
Returns the TileIndexDiffC offset from a DiagDirection.
dir | The given direction |
Definition at line 281 of file map_func.h.
References _tileoffs_by_diagdir, and IsValidDiagDirection().
static TileIndexDiffC TileIndexDiffCByDir | ( | Direction | dir | ) | [inline, static] |
Returns the TileIndexDiffC offset from a Direction.
dir | The given direction |
Definition at line 295 of file map_func.h.
References _tileoffs_by_dir, and IsValidDirection().
Referenced by TileLoop_Water().
static TileIndexDiffC TileIndexToTileIndexDiffC | ( | TileIndex | tile_a, | |
TileIndex | tile_b | |||
) | [inline, static] |
Returns the diff between two tiles.
tile_a | from tile | |
tile_b | to tile |
Definition at line 329 of file map_func.h.
References TileX(), TileY(), TileIndexDiffC::x, and TileIndexDiffC::y.
Referenced by GetTownRoadGridElement(), TownLayoutAllows2x2HouseHere(), and TownLayoutAllowsHouseHere().
static TileIndexDiff TileOffsByDiagDir | ( | DiagDirection | dir | ) | [inline, static] |
Convert a DiagDirection to a TileIndexDiff.
dir | The DiagDirection |
Definition at line 354 of file map_func.h.
References _tileoffs_by_diagdir, IsValidDiagDirection(), and ToTileIndexDiff().
Referenced by AIBridge::_BuildBridgeRoad1(), AIBridge::_BuildBridgeRoad2(), AITunnel::_BuildTunnelRoad1(), AITunnel::_BuildTunnelRoad2(), CheckFree2x2Area(), RoadStop::Entry::CheckIntegrity(), CheckTownBuild2House(), CheckTownBuild2x2House(), RoadStop::ClearDriveThrough(), CmdBuildDock(), CmdBuildLongRoad(), CmdBuildRailWaypoint(), CmdBuildRoad(), CmdBuildTunnel(), CmdConvertRail(), ConnectRoadToStructure(), Disaster_CoalMine_Init(), DisasterTick_Submarine(), DoBuildLock(), DoClearBridge(), DrawCatenaryRailway(), DrawTile_TunnelBridge(), ExploreSegment(), ExtendTrainReservation(), FixAllReservations(), FixOwnerOfRailTrack(), FollowTrainReservation(), GetBridgeEnd(), AIRoad::GetDriveThroughBackTile(), GetOtherAqueductEnd(), GetOtherTunnelEnd(), AITunnel::GetOtherTunnelEnd(), Station::GetPlatformLength(), AIRail::GetRailDepotFrontTile(), AIRoad::GetRoadDepotFrontTile(), AIRoad::GetRoadStationFrontTile(), GetTrainForReservation(), GrowTownWithBridge(), CYapfCostRailT< Types >::IsAnyStationTileReserved(), IsNeighborRoadTile(), IsTunnelInWayDir(), IsWaterCrossingTunnel(), MakeDock(), RoadStop::MakeDriveThrough(), MakeLock(), NPFRoadVehicleChooseTrack(), NPFSaveTargetData(), NPFShipChooseTrack(), OPFShipChooseTrack(), RoadStop::Entry::Rebuild(), RemoveDock(), RemoveLock(), RemoveRoad(), CYapfReserveTrack< Types >::ReserveRailStationPlatform(), SetRailStationPlatformReservation(), TileAddByDiagDir(), TrainApproachingCrossing(), TrainApproachingCrossingTile(), TrainCheckIfLineEnds(), CYapfReserveTrack< Types >::UnreserveSingleTrack(), and UpdateSignalsInBuffer().
static TileIndexDiff TileOffsByDir | ( | Direction | dir | ) | [inline, static] |
Convert a Direction to a TileIndexDiff.
dir | The direction to convert from |
Definition at line 368 of file map_func.h.
References _tileoffs_by_dir, IsValidDirection(), and ToTileIndexDiff().
Referenced by CircularTileSearch(), FindStationsNearby(), IsWateredTile(), and MarkCanalsAndRiversAroundDirty().
static TileIndex TileVirtXY | ( | uint | x, | |
uint | y | |||
) | [inline, static] |
Get a tile from the virtual XY-coordinate.
x | The virtual x coordinate of the tile. | |
y | The virtual y coordinate of the tile. |
Definition at line 207 of file map_func.h.
References MapLogX().
Referenced by AfterLoadGame(), AircraftController(), CalcRaildirsDrawstyle(), CheckTrainCollision(), DisasterTick_Aircraft(), DrawStationCoverageAreaText(), DrawTileSelection(), FindNearestHangar(), AISign::GetLocation(), GetNewVehiclePos(), GetTileHeightBelowAircraft(), HandleAutoSignalPlacement(), InitializeDisasterVehicle(), BuildRoadToolbarWindow::OnKeyPress(), BuildRailToolbarWindow::OnKeyPress(), RemoveRoad(), ShowExtraViewPortWindowForTileUnderCursor(), TrainInWormholeTileEnum(), UpdateStatusAfterSwap(), VpHandlePlaceSizingDrag(), VpSelectTilesWithMethod(), and YapfTrainCheckReverse().
static uint TileX | ( | TileIndex | tile | ) | [inline, static] |
Get the X component of a tile.
tile | the tile to get the X component of |
Definition at line 218 of file map_func.h.
References MapMaxX().
Referenced by AIRoad::_BuildRoadInternal(), AIRoad::_BuildRoadStationInternal(), TileArea::Add(), AyStar::AddStartNode(), AddTileIndexDiffCWrap(), AfterLoadGame(), AircraftController(), AircraftGetEntryPoint(), AlignTileToGrid(), AIRoad::AreRoadTilesConnected(), AIBridge::BuildBridge(), AIRail::BuildRail(), AIRail::BuildRailDepot(), AIRoad::BuildRoadDepot(), AIRail::BuildSignal(), AIMarine::BuildWaterDepot(), CalcClosestStationTile(), CalcHeightdiff(), CanExpandRailStation(), CcBuildIndustry(), CheckCanTerraformSurroundingTiles(), CheckIfCanLevelIndustryPlatform(), CircularTileSearch(), TileArea::ClampToMap(), CmdBuildAircraft(), CmdBuildBridge(), CmdBuildLongRoad(), CmdBuildObject(), CmdBuildRailVehicle(), CmdBuildRailWagon(), CmdBuildRoadVehicle(), CmdBuildShip(), CmdBuildTunnel(), CmdClearArea(), CmdConvertRail(), CmdPlaceSign(), CmdRemoveLongRoad(), CopyPaste::CopyArea(), DiagdirBetweenTiles(), DiagonalTileIterator::DiagonalTileIterator(), Disaster_Small_Ufo_Init(), Disaster_Zeppeliner_Init(), DisasterTick_Aircraft(), DisasterTick_Big_Ufo(), DisasterTick_Ufo(), DistanceFromEdge(), DistanceFromEdgeDir(), DistanceManhattan(), DistanceMax(), DistanceMaxPlusManhattan(), DistanceSquare(), DoCommandP(), DrawTileSelection(), SmallMapWindow::DrawTowns(), FindIndustryToDeliver(), FindStationsNearby(), GetAcceptanceAroundTiles(), GetClosestWaterDistance(), GetDriveableTrackdirBits(), GetMinimalAirportDistanceToTile(), AIRoad::GetNeighbourRoadCount(), GetOtherAqueductEnd(), GetPCPElevation(), GetProductionAroundTiles(), GetRelativePosition(), AIRail::GetSignalType(), GetTileMaxZ(), GetTileSlope(), AIMap::GetTileX(), GetTileZ(), GetTLG(), GetTLState(), GetTunnelBridgeLength(), GrayscaleToMapHeights(), GrowTownWithBridge(), GUIPlaceProcDragXY(), HouseGetVariable(), Town::InitializeLayout(), InitializeWindowViewport(), CopyPaste::internal_PasteArea(), TileArea::Intersects(), IsTileAlignedToGrid(), IsTunnelInWay(), MarkTileDirtyByTile(), NPFDistanceTrack(), NPFHash(), ObjectGetVariable(), LandInfoWindow::OnInit(), CopyPaste::PasteArea(), CopyPaste::PasteLandscape(), CYapfDestinationTileRoadT< Types >::PfCalcEstimate(), CYapfDestinationTileOrStationRailT< Types >::PfCalcEstimate(), CYapfDestinationTileT< Types >::PfCalcEstimate(), AIRail::RemoveRail(), AIRoad::RemoveRoad(), AIRoad::RemoveRoadFull(), AIRail::RemoveSignal(), ScrollMainWindowToTile(), ScrollWindowToTile(), SetTileType(), SetWaterClassDependingOnSurroundings(), ShowBuildBridgeWindow(), SimulateDrag(), SwapDirection(), TerraformAddDirtyTileAround(), TerraformTileHeight(), TgenSetTileHeight(), TileAddWrap(), TileArea::TileArea(), TileIndexToTileIndexDiffC(), TileStr(), Waypoint::UpdateVirtCoord(), Town::UpdateVirtCoord(), Station::UpdateVirtCoord(), VehicleFromPos(), VpSelectTilesWithMethod(), VpSetPresizeRange(), and VpStartPlaceSizing().
static TileIndex TileXY | ( | uint | x, | |
uint | y | |||
) | [inline, static] |
Returns the TileIndex of a coordinate.
x | The x coordinate of the tile | |
y | The y coordinate of the tile |
Definition at line 176 of file map_func.h.
References MapLogX().
Referenced by _GenerateWorld(), TileArea::Add(), AddTileIndexDiffCWrap(), AfterLoadGame(), AITileList_StationType::AITileList_StationType(), AlignTileToGrid(), CalcClosestStationTile(), CanExpandRailStation(), CheckSubsidised(), CircularTileSearch(), CopyPaste::CopyArea(), DEF_CONSOLE_CMD(), Disaster_Small_Ufo_Init(), SmallMapWindow::DrawSmallMapColumn(), FixSlopes(), FlatEmptyWorld(), GenerateLandscape(), GenerateTerrainPerlin(), GenerateWorld(), GetAcceptanceAroundTiles(), GetClosestWaterDistance(), AIVehicle::GetLocation(), GetProductionAroundTiles(), AIMap::GetTileIndex(), GrayscaleToMapHeights(), HeightmapCallback(), CopyPaste::internal_PasteArea(), DiagonalTileIterator::operator++(), CopyPaste::PasteLandscape(), Station::RecomputeIndustriesNear(), StationRect::ScanForStationTiles(), SetSelectionTilesDirty(), TerraformTileHeight(), TileArea::TileArea(), TileHeightOutsideMap(), and UpdateStationAcceptance().
static uint TileY | ( | TileIndex | tile | ) | [inline, static] |
Get the Y component of a tile.
tile | the tile to get the Y component of |
Definition at line 228 of file map_func.h.
References MapLogX().
Referenced by AIRoad::_BuildRoadInternal(), AIRoad::_BuildRoadStationInternal(), TileArea::Add(), AyStar::AddStartNode(), AddTileIndexDiffCWrap(), AfterLoadGame(), AircraftController(), AircraftGetEntryPoint(), AlignTileToGrid(), AIRoad::AreRoadTilesConnected(), AIBridge::BuildBridge(), AIRail::BuildRail(), AIRail::BuildRailDepot(), AIRoad::BuildRoadDepot(), AIRail::BuildSignal(), AIMarine::BuildWaterDepot(), CalcClosestStationTile(), CanExpandRailStation(), CcBuildIndustry(), CheckCanTerraformSurroundingTiles(), CheckIfCanLevelIndustryPlatform(), CircularTileSearch(), TileArea::ClampToMap(), CmdBuildAircraft(), CmdBuildBridge(), CmdBuildLongRoad(), CmdBuildObject(), CmdBuildRailVehicle(), CmdBuildRailWagon(), CmdBuildRoadVehicle(), CmdBuildShip(), CmdBuildTunnel(), CmdClearArea(), CmdConvertRail(), CmdPlaceSign(), CmdRemoveLongRoad(), CopyPaste::CopyArea(), DiagdirBetweenTiles(), DiagonalTileIterator::DiagonalTileIterator(), Disaster_Helicopter_Init(), DisasterTick_Aircraft(), DisasterTick_Big_Ufo(), DisasterTick_Ufo(), DistanceFromEdge(), DistanceFromEdgeDir(), DistanceManhattan(), DistanceMax(), DistanceMaxPlusManhattan(), DistanceSquare(), DoCommandP(), DrawTileSelection(), SmallMapWindow::DrawTowns(), FindIndustryToDeliver(), FindStationsNearby(), GetAcceptanceAroundTiles(), GetClosestWaterDistance(), GetDriveableTrackdirBits(), GetMinimalAirportDistanceToTile(), AIRoad::GetNeighbourRoadCount(), GetOtherAqueductEnd(), GetPCPElevation(), GetProductionAroundTiles(), GetRelativePosition(), AIRail::GetSignalType(), GetTileMaxZ(), GetTileSlope(), AIMap::GetTileY(), GetTileZ(), GetTLG(), GetTLState(), GetTunnelBridgeLength(), GrayscaleToMapHeights(), GrowTownWithBridge(), GUIPlaceProcDragXY(), HouseGetVariable(), Town::InitializeLayout(), InitializeWindowViewport(), CopyPaste::internal_PasteArea(), TileArea::Intersects(), IsTileAlignedToGrid(), IsTunnelInWay(), MarkTileDirtyByTile(), NPFDistanceTrack(), NPFHash(), ObjectGetVariable(), LandInfoWindow::OnInit(), CopyPaste::PasteArea(), CopyPaste::PasteLandscape(), CYapfDestinationTileRoadT< Types >::PfCalcEstimate(), CYapfDestinationTileOrStationRailT< Types >::PfCalcEstimate(), CYapfDestinationTileT< Types >::PfCalcEstimate(), AIRail::RemoveRail(), AIRoad::RemoveRoad(), AIRoad::RemoveRoadFull(), AIRail::RemoveSignal(), ScrollMainWindowToTile(), ScrollWindowToTile(), SetTileType(), SetWaterClassDependingOnSurroundings(), ShowBuildBridgeWindow(), SimulateDrag(), SwapDirection(), TerraformAddDirtyTileAround(), TerraformTileHeight(), TgenSetTileHeight(), TileAddWrap(), TileArea::TileArea(), TileIndexToTileIndexDiffC(), TileStr(), Waypoint::UpdateVirtCoord(), Town::UpdateVirtCoord(), Station::UpdateVirtCoord(), VehicleFromPos(), VpSelectTilesWithMethod(), VpSetPresizeRange(), and VpStartPlaceSizing().
static TileIndexDiff ToTileIndexDiff | ( | TileIndexDiffC | tidc | ) | [inline, static] |
Return the offset between to tiles from a TileIndexDiffC struct.
This function works like TileDiffXY(int, int) and returns the difference between two tiles.
tidc | The coordinate of the offset as TileIndexDiffC |
Definition at line 243 of file map_func.h.
References MapLogX(), TileIndexDiffC::x, and TileIndexDiffC::y.
Referenced by CalcHeightdiff(), CmdBuildAirport(), CmdBuildDock(), CmdRailTrackHelper(), CmdSignalTrackHelper(), DoCreateNewIndustry(), Ship::GetOrderStationLocation(), Airport::GetRotatedTileFromOffset(), GetTrafficLightConsist(), GrowTown(), TerraformTileHeight(), TileOffsByDiagDir(), and TileOffsByDir().
Pointer to the tile-array.
This variable points to the tile-array which contains the tiles of the map.
Definition at line 31 of file map.cpp.
Referenced by AddClearCounter(), AddClearDensity(), AddTreeCount(), AddTreeCounter(), AddTreeGrowth(), AfterLoadGame(), ClearSingleBridgeMiddle(), ClearSnow(), ClrBitTunnelBridgeExit(), ClrBitTunnelBridgeSignal(), CmdRemoveSingleSignal(), DecHouseProcessingTime(), FixOldVehicles(), GetBridgeAxis(), GetBridgeType(), GetCleanHouseType(), GetCleanIndustryGfx(), GetClearCounter(), GetClearDensity(), GetCrossingRoadAxis(), GetCustomStationSpecIndex(), GetDepotIndex(), GetDisallowedRoadDirections(), GetFenceSE(), GetFenceSW(), GetFieldType(), GetHouseAge(), GetHouseBuildingStage(), GetHouseConstructionTick(), GetHouseProcessingTime(), GetHouseRandomBits(), GetHouseTriggers(), GetIndustryAnimationLoop(), GetIndustryConstructionCounter(), GetIndustryConstructionStage(), GetIndustryIndex(), GetIndustryIndexOfField(), GetIndustryRandomBits(), GetIndustryTriggers(), GetLiftPosition(), GetLockDirection(), GetObjectIndex(), GetObjectRandomBits(), GetObjectType(), GetOtherShipDepotTile(), GetPresentSignals(), GetRailDepotDirection(), GetRailReservationTrackBits(), GetRailTileType(), GetRailType(), GetRawClearGround(), GetRoadBits(), GetRoadDepotDirection(), GetRoadOwner(), GetRoadside(), GetRoadTileType(), GetSection(), GetShipDepotAxis(), GetShipDepotDirection(), GetSignalStates(), GetStationGfx(), GetStationIndex(), GetStationTileRandomBits(), GetStationType(), GetTileOwner(), GetTileType(), GetTownIndex(), GetTrackBits(), GetTreeCount(), GetTreeCounter(), GetTreeDensity(), GetTreeGround(), GetTreeGrowth(), GetTreeType(), GetTropicZone(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), GetWaterClass(), GetWaterTileRandomBits(), GetWaterTileType(), HasCrossingReservation(), HasDepotReservation(), HasStationReservation(), HasTunnelBridgeReservation(), HasWormholeSignals(), IncHouseConstructionTick(), IncrementHouseAge(), IsBridge(), IsBridgeAbove(), IsCompanyHQ(), IsCrossingBarred(), IsCustomStationSpecIndex(), IsHouseCompleted(), IsIndustryCompleted(), IsLock(), IsShipDepot(), IsSnowTile(), IsTunnel(), IsTunnelBridgeEntrance(), IsTunnelBridgeExit(), IsTunnelBridgeWithSignGreen(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeHouseTile(), MakeIndustry(), MakeLockTile(), MakeObject(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeSnow(), MakeStation(), MakeTree(), MakeVoid(), MakeWater(), MoveBuoysToWaypoints(), MoveWaypointsToBaseStations(), ResetHouseAge(), ResetIndustryConstructionStage(), SetBitTunnelBridgeExit(), SetBitTunnelBridgeSignal(), SetBridgeMiddle(), SetClearCounter(), SetClearDensity(), SetClearGroundDensity(), SetCrossingBarred(), SetCrossingReservation(), SetCustomStationSpecIndex(), SetDepotReservation(), SetDisallowedRoadDirections(), SetFenceSE(), SetFenceSW(), SetFieldType(), SetHasSignals(), SetHouseCompleted(), SetHouseProcessingTime(), SetHouseRandomBits(), SetHouseTriggers(), SetHouseType(), SetIndustryAnimationLoop(), SetIndustryCompleted(), SetIndustryConstructionCounter(), SetIndustryConstructionStage(), SetIndustryGfx(), SetIndustryIndexOfField(), SetIndustryRandomBits(), SetIndustryTriggers(), SetLiftPosition(), SetPresentSignals(), SetRailStationReservation(), SetRailType(), SetRoadBits(), SetRoadOwner(), SetRoadside(), SetSignalStates(), SetStationGfx(), SetStationTileRandomBits(), SetTileHeight(), SetTileOwner(), SetTileType(), SetTownIndex(), SetTrackBits(), SetTrackReservation(), SetTreeCounter(), SetTreeGroundDensity(), SetTreeGrowth(), SetTropicZone(), SetTunnelBridgeReservation(), SetWaterClass(), SetWaterClassDependingOnSurroundings(), TileHeight(), and CrashLog::WriteSavegame().
Pointer to the tile-array saving extended heightlevel data.
Definition at line 33 of file map.cpp.
Referenced by AfterLoadGame(), Load_MAPH(), SetTileHeight(), and TileHeight().
Pointer to the extended tile-array.
This variable points to the extended tile-array which contains the tiles of the map.
Definition at line 32 of file map.cpp.
Referenced by AfterLoadGame(), GetAnimationFrame(), GetLiftDestination(), GetRoadOwner(), GetRoadTypes(), HaltLift(), HasTrafficLights(), HasTunnelBridgeSnowOrDesert(), IncreaseRoadWorksCounter(), IsOnSnow(), LiftHasDestination(), MakeBridgeRamp(), MakeClear(), MakeField(), MakeIndustry(), MakeLockTile(), MakeObject(), MakeRailTunnel(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadTunnel(), MakeShipDepot(), MakeShore(), MakeStation(), MakeTree(), MakeVoid(), MakeWater(), SetAnimationFrame(), SetLiftDestination(), SetRoadOwner(), SetRoadTypes(), SetTunnelBridgeSnowOrDesert(), TerminateRoadWorks(), and ToggleSnow().