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