OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
113 uint x =
TileX(tile);
114 uint y =
TileY(tile);
138 SB(
_m[tile].type, 4, 4, type);
204 SB(
_m[tile].m1, 0, 5, owner);
229 SB(
_m[tile].type, 0, 2, type);
@ MP_HOUSE
A house by a town.
uint32 TileIndex
The index/ID of a Tile.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
static void SetTileType(TileIndex tile, TileType type)
Set the type of a tile.
static uint TilePixelHeight(TileIndex tile)
Returns the height of a tile in pixels.
TileExtended * _me
Extended Tiles of the map.
@ MP_INDUSTRY
Part of an industry.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
static const uint MAX_TILE_HEIGHT
Maximum allowed tile height.
Owner
Enum for all companies/owners.
int GetTileMaxZ(TileIndex tile)
Get top height of the tile inside the map.
static uint TileX(TileIndex tile)
Get the X component of a tile.
static byte GetAnimationFrame(TileIndex t)
Get the current animation frame.
static uint MapSize()
Get the size of the map.
static void SetTropicZone(TileIndex tile, TropicZone type)
Set the tropic zone.
static uint TileHeight(TileIndex tile)
Returns the height of a tile.
@ MP_OBJECT
Contains objects such as transmitters and owned land.
static T SB(T &x, const uint8 s, const uint8 n, const U d)
Set n bits in x starting at bit s to d.
Slope GetTileSlope(TileIndex tile, int *h=nullptr)
Return the slope of a given tile inside the map.
static uint TilePixelHeightOutsideMap(int x, int y)
Returns the height of a tile in pixels, also for tiles outside the map (virtual "black" tiles).
static uint TileHeightOutsideMap(int x, int y)
Returns the height of a tile, also for tiles outside the map (virtual "black" tiles).
GameSettings _settings_game
Game settings of a running game or the scenario editor.
static TropicZone GetTropicZone(TileIndex tile)
Get the tropic zone.
static bool IsValidTile(TileIndex tile)
Checks if a tile is valid.
bool freeform_edges
allow terraforming the tiles at the map edges
static bool IsTileOwner(TileIndex tile, Owner owner)
Checks if a tile belongs to the given owner.
static uint TileHash(uint x, uint y)
Calculate a hash value from a tile position.
Slope
Enumeration for the slope-type.
static void SetTileHeight(TileIndex tile, uint height)
Sets the height of a tile.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a given tiletype.
static Owner GetTileOwner(TileIndex tile)
Returns the owner of a tile.
Slope GetTilePixelSlopeOutsideMap(int x, int y, int *h)
Return the slope of a given tile, also for tiles outside the map (virtual "black" tiles).
static T Clamp(const T a, const T min, const T max)
Clamp a value between an interval.
TropicZone
Additional infos of a tile on a tropic game.
static uint MapMaxY()
Gets the maximum Y coordinate within the map, including MP_VOID.
@ MP_VOID
Invisible tiles at the SW and SE border.
static int GetTilePixelZ(TileIndex tile)
Get bottom height of the tile.
static TileIndex TileXY(uint x, uint y)
Returns the TileIndex of a coordinate.
TileType
The different types of tiles.
@ MP_STATION
A tile of a station.
static uint TileHash2Bit(uint x, uint y)
Get the last two bits of the TileHash from a tile position.
static int GetTileMaxPixelZ(TileIndex tile)
Get top height of the tile.
static uint MapMaxX()
Gets the maximum X coordinate within the map, including MP_VOID.
static const uint TILE_HEIGHT
Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
byte m7
Primarily used for newgrf support.
static void SetTileOwner(TileIndex tile, Owner owner)
Sets the owner of a tile.
ConstructionSettings construction
construction of things in-game
static TileType GetTileType(TileIndex tile)
Get the tiletype of a given tile.
@ TROPICZONE_NORMAL
Normal tropiczone.
static Slope GetTilePixelSlope(TileIndex tile, int *h)
Return the slope of a given tile.
static void SetAnimationFrame(TileIndex t, byte frame)
Set a new animation frame.
bool IsTileFlat(TileIndex tile, int *h=nullptr)
Check if a given tile is flat.
byte height
The height of the northern corner.
static bool IsInnerTile(TileIndex tile)
Check if a tile is within the map (not a border)
Tile * _m
Tiles of the map.
int GetTileZ(TileIndex tile)
Get bottom height of the tile.