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

Function SetTreeGroundDensity

src/tree_map.h:144–150  ·  view source on GitHub ↗

* Set the density and ground type of a tile with trees. * * This functions saves the ground type and the density which belongs to it * for a given tile. * * @param t The tile to set the density and ground type * @param g The ground type to save * @param d The density to save with * @pre Tile must be of type MP_TREES */

Source from the content-addressed store, hash-verified

142 * @pre Tile must be of type MP_TREES
143 */
144inline void SetTreeGroundDensity(Tile t, TreeGround g, uint d)
145{
146 assert(IsTileType(t, MP_TREES)); // XXX incomplete
147 SB(t.m2(), 4, 2, d);
148 SB(t.m2(), 6, 3, g);
149 SetWaterClass(t, g == TREE_GROUND_SHORE ? WaterClass::Sea : WaterClass::Invalid);
150}
151
152/**
153 * Returns the number of trees on a tile.

Callers 6

DoFloodTileFunction · 0.85
DoDryUpFunction · 0.85
PlaceTreeFunction · 0.85
TileLoopTreesDesertFunction · 0.85
TileLoopTreesAlpsFunction · 0.85
TileLoop_TreesFunction · 0.85

Calls 3

IsTileTypeFunction · 0.85
SBFunction · 0.85
SetWaterClassFunction · 0.85

Tested by

no test coverage detected