OpenTTD Source
1.11.0-beta2
|
Go to the documentation of this file.
86 return GB(
_m[t].m5, 0, 2);
110 SB(
_m[t].m5, 0, 2, d);
123 return GB(
_m[t].m5, 5, 3);
147 SB(
_m[t].m5, 5, 3, c);
161 _m[t].
m5 = 0 << 5 | type << 2 | density;
174 return GB(
_m[t].m3, 0, 4);
186 SB(
_m[t].m3, 0, 4, f);
198 return(IndustryID)
_m[t].
m2;
225 default: NOT_REACHED();
244 default: NOT_REACHED();
266 _m[t].
m4 = 0 << 5 | 0 << 2;
286 _m[t].
m3 = field_type;
287 _m[t].
m4 = 0 << 5 | 0 << 2;
289 SB(
_me[t].m6, 2, 4, 0);
@ MP_CLEAR
A tile without any structures, i.e. grass, rocks, farm fields etc.
uint32 TileIndex
The index/ID of a Tile.
static void AddClearDensity(TileIndex t, int d)
Increment the density of a non-field clear tile.
static uint GetClearCounter(TileIndex t)
Get the counter used to advance to the next clear density/field type.
static uint GB(const T x, const uint8 s, const uint8 n)
Fetch n bits from x, started at bit s.
static void SetFieldType(TileIndex t, uint f)
Set the field type (production stage) of the field.
static void SetTileType(TileIndex tile, TileType type)
Set the type of a tile.
static void ClearSnow(TileIndex t)
Clear the snow from a tile and return it to its previous type.
static void MakeClear(TileIndex t, ClearGround g, uint density)
Make a clear tile.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
TileExtended * _me
Extended Tiles of the map.
static bool IsClearGround(TileIndex t, ClearGround ct)
Set the type of clear tile.
static T ClrBit(T &x, const uint8 y)
Clears a bit in a variable.
uint16 m2
Primarily used for indices to towns, industries and stations.
static uint GetFieldType(TileIndex t)
Get the field type (production stage) of the field.
byte m1
Primarily used for ownership information.
static void SetFence(TileIndex t, DiagDirection side, uint h)
Sets the type of fence (and whether there is one) for the given border.
static ClearGround GetClearGround(TileIndex t)
Get the type of clear tile.
static ClearGround GetRawClearGround(TileIndex t)
Get the type of clear tile but never return CLEAR_SNOW.
static uint GetClearDensity(TileIndex t)
Get the density of a non-field clear tile.
static void SetClearCounter(TileIndex t, uint c)
Sets the counter used to advance to the next clear density/field type.
static uint GetFence(TileIndex t, DiagDirection side)
Is there a fence at the given border?
static T SB(T &x, const uint8 s, const uint8 n, const U d)
Set n bits in x starting at bit s to d.
static void AddClearCounter(TileIndex t, int c)
Increments the counter used to advance to the next clear density/field type.
static bool IsSnowTile(TileIndex t)
Test if a tile is covered with snow.
static void SetIndustryIndexOfField(TileIndex t, IndustryID i)
Set the industry (farm) that made the field.
DiagDirection
Enumeration for diagonal directions.
static IndustryID GetIndustryIndexOfField(TileIndex t)
Get the industry (farm) that made the field.
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a given tiletype.
static void MakeSnow(TileIndex t, uint density=0)
Make a snow tile.
@ OWNER_NONE
The tile has no ownership.
static T SetBit(T &x, const uint8 y)
Set a bit in a variable.
byte m7
Primarily used for newgrf support.
static void MakeField(TileIndex t, uint field_type, IndustryID industry)
Make a (farm) field tile.
static void SetTileOwner(TileIndex tile, Owner owner)
Sets the owner of a tile.
@ DIAGDIR_NE
Northeast, upper right on your monitor.
uint16 m8
General purpose.
Tile * _m
Tiles of the map.
static void SetClearDensity(TileIndex t, uint d)
Set the density of a non-field clear tile.
static void SetClearGroundDensity(TileIndex t, ClearGround type, uint density)
Sets ground type and density in one go, also sets the counter to 0.