OpenTTD Source 20241224-master-gf74b0cf984
|
Map accessors for 'clear' tiles. More...
Go to the source code of this file.
Enumerations | |
enum | ClearGround { CLEAR_GRASS = 0 , CLEAR_ROUGH = 1 , CLEAR_ROCKS = 2 , CLEAR_FIELDS = 3 , CLEAR_SNOW = 4 , CLEAR_DESERT = 5 } |
Ground types. More... | |
Functions | |
bool | IsSnowTile (Tile t) |
Test if a tile is covered with snow. | |
ClearGround | GetRawClearGround (Tile t) |
Get the type of clear tile but never return CLEAR_SNOW. | |
ClearGround | GetClearGround (Tile t) |
Get the type of clear tile. | |
bool | IsClearGround (Tile t, ClearGround ct) |
Set the type of clear tile. | |
uint | GetClearDensity (Tile t) |
Get the density of a non-field clear tile. | |
void | AddClearDensity (Tile t, int d) |
Increment the density of a non-field clear tile. | |
void | SetClearDensity (Tile t, uint d) |
Set the density of a non-field clear tile. | |
uint | GetClearCounter (Tile t) |
Get the counter used to advance to the next clear density/field type. | |
void | AddClearCounter (Tile t, int c) |
Increments the counter used to advance to the next clear density/field type. | |
void | SetClearCounter (Tile t, uint c) |
Sets the counter used to advance to the next clear density/field type. | |
void | SetClearGroundDensity (Tile t, ClearGround type, uint density) |
Sets ground type and density in one go, also sets the counter to 0. | |
uint | GetFieldType (Tile t) |
Get the field type (production stage) of the field. | |
void | SetFieldType (Tile t, uint f) |
Set the field type (production stage) of the field. | |
IndustryID | GetIndustryIndexOfField (Tile t) |
Get the industry (farm) that made the field. | |
void | SetIndustryIndexOfField (Tile t, IndustryID i) |
Set the industry (farm) that made the field. | |
uint | GetFence (Tile t, DiagDirection side) |
Is there a fence at the given border? | |
void | SetFence (Tile t, DiagDirection side, uint h) |
Sets the type of fence (and whether there is one) for the given border. | |
void | MakeClear (Tile t, ClearGround g, uint density) |
Make a clear tile. | |
void | MakeField (Tile t, uint field_type, IndustryID industry) |
Make a (farm) field tile. | |
void | MakeSnow (Tile t, uint density=0) |
Make a snow tile. | |
void | ClearSnow (Tile t) |
Clear the snow from a tile and return it to its previous type. | |
Map accessors for 'clear' tiles.
Definition in file clear_map.h.
enum ClearGround |
Ground types.
Valid densities in comments after the enum.
Enumerator | |
---|---|
CLEAR_GRASS | 0-3 |
CLEAR_ROUGH | 3 |
CLEAR_ROCKS | 3 |
CLEAR_FIELDS | 3 |
CLEAR_SNOW | 0-3 |
CLEAR_DESERT | 1,3 |
Definition at line 19 of file clear_map.h.
|
inline |
Increments the counter used to advance to the next clear density/field type.
t | the tile to increment the counter of |
c | the amount to increment the counter with |
Definition at line 132 of file clear_map.h.
References IsTileType(), Tile::m5(), and MP_CLEAR.
|
inline |
Increment the density of a non-field clear tile.
t | the tile to increment the density of |
d | the amount to increment the density with |
Definition at line 95 of file clear_map.h.
References IsTileType(), Tile::m5(), and MP_CLEAR.
Referenced by TileLoopClearAlps().
|
inline |
Clear the snow from a tile and return it to its previous type.
t | the tile to clear of snow |
Definition at line 316 of file clear_map.h.
References CLEAR_SNOW, ClrBit(), GetClearGround(), Tile::m3(), and SetClearDensity().
Referenced by TileLoopClearAlps().
|
inline |
Get the counter used to advance to the next clear density/field type.
t | the tile to get the counter of |
Definition at line 120 of file clear_map.h.
References GB(), IsTileType(), Tile::m5(), and MP_CLEAR.
|
inline |
Get the density of a non-field clear tile.
t | the tile to get the density of |
Definition at line 83 of file clear_map.h.
References GB(), IsTileType(), Tile::m5(), and MP_CLEAR.
Referenced by AfterLoadGame(), GetSmallMapVegetationPixels(), GetTerrainType(), PlantTreesOnTile(), and TileLoopClearAlps().
|
inline |
Get the type of clear tile.
t | the tile to get the clear ground type of |
Definition at line 59 of file clear_map.h.
References CLEAR_SNOW, GetRawClearGround(), and IsSnowTile().
Referenced by ClearSnow(), GetFieldType(), GetIndustryIndexOfField(), GetSmallMapVegetationPixels(), IsClearGround(), MakeSnow(), PlantTreesOnTile(), SetFieldType(), and SetIndustryIndexOfField().
|
inline |
Is there a fence at the given border?
t | the tile to check for fences |
side | the border to check |
Definition at line 221 of file clear_map.h.
References CLEAR_FIELDS, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_SE, DIAGDIR_SW, GB(), IsClearGround(), Tile::m3(), Tile::m4(), and Tile::m6().
Referenced by SetupFarmFieldFence().
|
inline |
Get the field type (production stage) of the field.
t | the field to get the type of |
Definition at line 171 of file clear_map.h.
References CLEAR_FIELDS, GB(), GetClearGround(), and Tile::m3().
|
inline |
Get the industry (farm) that made the field.
t | the field to get creating industry of |
Definition at line 195 of file clear_map.h.
References CLEAR_FIELDS, GetClearGround(), and Tile::m2().
|
inline |
Get the type of clear tile but never return CLEAR_SNOW.
t | the tile to get the clear ground type of |
Definition at line 47 of file clear_map.h.
References GB(), IsTileType(), Tile::m5(), and MP_CLEAR.
Referenced by AfterLoadGame(), CanPlantTreesOnTile(), CmdPlantTree(), GetClearGround(), MakeSnow(), and PlantTreesOnTile().
|
inline |
Set the type of clear tile.
t | the tile to set the clear ground type of |
ct | the ground type |
Definition at line 71 of file clear_map.h.
References GetClearGround().
Referenced by AfterLoadGame(), CanPlantTreesOnTile(), GetFence(), GetSmallMapVegetationPixels(), IsSuitableForFarmField(), SetFence(), and SetupFarmFieldFence().
|
inline |
Test if a tile is covered with snow.
t | the tile to check |
Definition at line 35 of file clear_map.h.
References HasBit(), IsTileType(), Tile::m3(), and MP_CLEAR.
Referenced by GetClearGround(), GetTerrainType(), and TileLoopClearAlps().
|
inline |
Make a clear tile.
t | the tile to make a clear tile |
g | the type of ground |
density | the density of the grass/snow/desert etc |
Definition at line 259 of file clear_map.h.
References Tile::m1(), Tile::m2(), Tile::m3(), Tile::m4(), Tile::m6(), Tile::m7(), Tile::m8(), MP_CLEAR, OWNER_NONE, SetClearGroundDensity(), SetTileOwner(), and SetTileType().
Referenced by AfterLoadGame(), DoDryUp(), FixOwnerOfRailTrack(), GenerateRockyArea(), GrayscaleToMapHeights(), and TgenSetTileHeight().
|
inline |
Make a (farm) field tile.
t | the tile to make a farm field |
field_type | the 'growth' level of the field |
industry | the industry this tile belongs to |
Definition at line 280 of file clear_map.h.
References CLEAR_FIELDS, Tile::m1(), Tile::m2(), Tile::m3(), Tile::m4(), Tile::m6(), Tile::m7(), Tile::m8(), MP_CLEAR, OWNER_NONE, SB(), SetClearGroundDensity(), SetTileOwner(), and SetTileType().
|
inline |
Make a snow tile.
t | the tile to make snowy |
density | The density of snowiness. |
Definition at line 300 of file clear_map.h.
References CLEAR_FIELDS, CLEAR_GRASS, CLEAR_SNOW, GetClearGround(), GetRawClearGround(), Tile::m3(), SetBit(), SetClearDensity(), and SetClearGroundDensity().
Referenced by TileLoopClearAlps().
|
inline |
Sets the counter used to advance to the next clear density/field type.
t | the tile to set the counter of |
c | the amount to set the counter to |
Definition at line 144 of file clear_map.h.
References IsTileType(), Tile::m5(), MP_CLEAR, and SB().
|
inline |
Set the density of a non-field clear tile.
t | the tile to set the density of |
d | the new density |
Definition at line 107 of file clear_map.h.
References IsTileType(), Tile::m5(), MP_CLEAR, and SB().
Referenced by ClearSnow(), and MakeSnow().
|
inline |
Sets ground type and density in one go, also sets the counter to 0.
t | the tile to set the ground type and density for |
type | the new ground type of the tile |
density | the density of the ground tile |
Definition at line 158 of file clear_map.h.
References IsTileType(), Tile::m5(), and MP_CLEAR.
Referenced by AfterLoadGame(), MakeClear(), MakeField(), and MakeSnow().
|
inline |
Sets the type of fence (and whether there is one) for the given border.
t | the tile to check for fences |
side | the border to check |
h | 0 if there is no fence, otherwise the fence type |
Definition at line 240 of file clear_map.h.
References CLEAR_FIELDS, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_SE, DIAGDIR_SW, IsClearGround(), Tile::m3(), Tile::m4(), Tile::m6(), and SB().
Referenced by AfterLoadGame(), and SetupFarmFieldFence().
|
inline |
Set the field type (production stage) of the field.
t | the field to get the type of |
f | the field type |
Definition at line 183 of file clear_map.h.
References CLEAR_FIELDS, GetClearGround(), Tile::m3(), and SB().
|
inline |
Set the industry (farm) that made the field.
t | the field to get creating industry of |
i | the industry that made the field |
Definition at line 207 of file clear_map.h.
References CLEAR_FIELDS, GetClearGround(), and Tile::m2().