|
OpenTTD Source
14.0-beta3
|
Go to the documentation of this file.
116 return GB(t.
m2(), 4, 2);
152 return GB(t.
m5(), 6, 2) + 1;
184 return GB(t.
m5(), 0, 3);
235 t.
m2() = ground << 6 | density << 4 | 0;
237 t.
m4() = 0 << 5 | 0 << 2;
238 t.
m5() = count << 6 | growth;
TreeGround GetTreeGround(Tile t)
Returns the groundtype for tree tiles.
uint GetTreeCount(Tile t)
Returns the number of trees on a tile.
void AddTreeGrowth(Tile t, int a)
Add a value to the tree growth status.
@ TREE_RAINFOREST
tree on the 'green part' on a sub-tropical map
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 AddTreeCount(Tile t, int c)
Add a amount to the tree-count value of a tile with trees.
debug_inline byte & m6()
General purpose.
Wrapper class to abstract away the way the tiles are stored.
debug_inline byte & m5()
General purpose.
static const uint TREE_COUNT_TEMPERATE
number of tree types on a temperate map.
debug_inline byte & m4()
General purpose.
@ WATER_CLASS_INVALID
Used for industry tiles on land (also for oilrig if newgrf says so).
@ TREE_GROUND_ROUGH
some rough tile
debug_inline byte & m7()
Primarily used for newgrf support.
@ TREE_SUB_ARCTIC
tree on a sub_arctic landscape
uint GetTreeGrowth(Tile t)
Returns the tree growth status.
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
@ TREE_CACTUS
a cactus for the 'desert part' on a sub-tropical map
@ TREE_INVALID
An invalid tree.
void SetWaterClass(Tile t, WaterClass wc)
Set the water class at a tile.
@ TREE_TOYLAND
tree on a toyland map
void SetTreeGroundDensity(Tile t, TreeGround g, uint d)
Set the density and ground type of a tile with trees.
void SetTileOwner(Tile tile, Owner owner)
Sets the owner of a tile.
@ TREE_GROUND_GRASS
normal grass
@ MP_TREES
Tile got trees.
@ TREE_SUB_TROPICAL
tree on a sub-tropical map, non-rainforest, non-desert
static const uint TREE_COUNT_RAINFOREST
number of tree types for the 'rainforest part' of a sub-tropic map.
TreeGround
Enumeration for ground types of tiles with trees.
static const uint TREE_COUNT_TOYLAND
number of tree types on a toyland map.
static const uint TREE_COUNT_SUB_TROPICAL
number of tree types for the 'sub-tropic part' of a sub-tropic map.
@ OWNER_NONE
The tile has no ownership.
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
void SetTreeGrowth(Tile t, uint g)
Sets the tree growth status of a tile.
@ TREE_TEMPERATE
temperate tree
void MakeTree(Tile t, TreeType type, uint count, uint growth, TreeGround ground, uint density)
Make a tree-tile.
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.
@ TREE_GROUND_SNOW_DESERT
a desert or snow tile, depend on landscape
static const uint TREE_COUNT_SUB_ARCTIC
number of tree types on a sub arctic map.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
TreeType GetTreeType(Tile t)
Returns the treetype of a tile.
debug_inline byte & m3()
General purpose.
uint GetTreeDensity(Tile t)
Returns the 'density' of a tile with trees.
TreeType
List of tree types along all landscape types.
@ TREE_GROUND_ROUGH_SNOW
A snow tile that is rough underneath.