MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetTreeDensity

Function GetTreeDensity

src/tree_map.h:127–131  ·  view source on GitHub ↗

* Returns the 'density' of a tile with trees. * * This function returns the density of a tile which got trees. Note * that this value doesn't count the number of trees on a tile, use * #GetTreeCount instead. This function instead returns some kind of * groundtype of the tile. As the map-array is finite in size and * the information about the trees must be saved somehow other * information a

Source from the content-addressed store, hash-verified

125 * @see GetTreeCount
126 */
127inline uint GetTreeDensity(Tile t)
128{
129 assert(IsTileType(t, MP_TREES));
130 return GB(t.m2(), 4, 2);
131}
132
133/**
134 * Set the density and ground type of a tile with trees.

Callers 4

GetTerrainTypeFunction · 0.85
DrawTile_TreesFunction · 0.85
TileLoopTreesAlpsFunction · 0.85
TileLoop_TreesFunction · 0.85

Calls 2

IsTileTypeFunction · 0.85
GBFunction · 0.85

Tested by

no test coverage detected