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

Function MakeTree

src/tree_map.h:244–256  ·  view source on GitHub ↗

* Make a tree-tile. * * This functions change the tile to a tile with trees and all information which belongs to it. * * @param t The tile to make a tree-tile from * @param type The type of the tree * @param count the number of trees * @param growth the growth stage * @param ground the ground type * @param density the density (not the number of trees) */

Source from the content-addressed store, hash-verified

242 * @param density the density (not the number of trees)
243 */
244inline void MakeTree(Tile t, TreeType type, uint count, TreeGrowthStage growth, TreeGround ground, uint density)
245{
246 SetTileType(t, MP_TREES);
247 SetTileOwner(t, OWNER_NONE);
248 SetWaterClass(t, ground == TREE_GROUND_SHORE ? WaterClass::Sea : WaterClass::Invalid);
249 t.m2() = ground << 6 | density << 4 | 0;
250 t.m3() = type;
251 t.m4() = 0 << 5 | 0 << 2;
252 t.m5() = count << 6 | to_underlying(growth);
253 SB(t.m6(), 2, 6, 0);
254 t.m7() = 0;
255 t.m8() = 0;
256}
257
258#endif /* TREE_MAP_H */

Callers 1

PlantTreesOnTileFunction · 0.85

Calls 5

SetTileTypeFunction · 0.85
SetTileOwnerFunction · 0.85
SetWaterClassFunction · 0.85
to_underlyingFunction · 0.85
SBFunction · 0.85

Tested by

no test coverage detected