OpenTTD Source
20240917-master-g9ab0a47812
|
Go to the documentation of this file.
51 return t.
m4() | (
GB(t.
m3(), 6, 1) << 8);
74 t.
m4() =
GB(house_id, 0, 8);
75 SB(t.
m3(), 6, 1,
GB(house_id, 8, 1));
97 SB(t.
m7(), 1, 3, dest);
107 return GB(t.
m7(), 1, 3);
128 return GB(t.
m6(), 2, 6);
138 SB(t.
m6(), 2, 6, pos);
160 SB(t.
m3(), 7, 1, !!status);
292 SB(t.
m3(), 0, 5, triggers);
305 return GB(t.
m3(), 0, 5);
317 return GB(t.
m6(), 2, 6);
329 SB(t.
m6(), 2, 6, time);
358 t.
m1() = random_bits;
uint8_t GetHouseRandomBits(Tile t)
Get the random bits for this house.
@ MP_CLEAR
A tile without any structures, i.e. grass, rocks, farm fields etc.
@ MP_HOUSE
A house by a town.
void ResetHouseAge(Tile t)
Sets the age of the house to zero.
constexpr T SetBit(T &x, const uint8_t y)
Set a bit in a variable.
debug_inline uint8_t & m5()
General purpose.
HouseID GetCleanHouseType(Tile t)
Get the type of this house, which is an index into the house spec array without doing any NewGRF rela...
debug_inline uint8_t & m3()
General purpose.
void SetHouseRandomBits(Tile t, uint8_t random)
Set the random bits for this house.
uint8_t GetHouseBuildingStage(Tile t)
House Construction Scheme.
constexpr static debug_inline uint GB(const T x, const uint8_t s, const uint8_t n)
Fetch n bits from x, started at bit s.
void IncHouseConstructionTick(Tile t)
Sets the increment stage of a house It is working with the whole counter + stage 5 bits,...
Wrapper class to abstract away the way the tiles are stored.
void SetLiftDestination(Tile t, uint8_t dest)
Set the new destination of the lift for this animated house, and activate the LiftHasDestination bit.
Templated helper to make a type-safe 'typedef' representing a single POD value.
debug_inline uint8_t & m4()
General purpose.
void SetHouseType(Tile t, HouseID house_id)
Set the house type.
@ MP_ROAD
A tile with road (or tram tracks)
bool LiftHasDestination(Tile t)
Check if the lift of this animated house has a destination.
debug_inline uint8_t & m7()
Primarily used for newgrf support.
TimerGameCalendar::Year GetHouseAge(Tile t)
Get the age of the house.
uint8_t GetHouseProcessingTime(Tile t)
Get the amount of time remaining before the tile loop processes this tile.
debug_inline uint16_t & m2()
Primarily used for indices to towns, industries and stations.
constexpr T AB(T &x, const uint8_t s, const uint8_t n, const U i)
Add i to n bits of x starting at bit s.
void SetHouseProcessingTime(Tile t, uint8_t time)
Set the amount of time remaining before the tile loop processes this tile.
void HaltLift(Tile t)
Stop the lift of this animated house from moving.
debug_inline uint8_t & m6()
General purpose.
HouseID GetHouseType(Tile t)
Get the type of this house, which is an index into the house spec array.
static const uint8_t TOWN_HOUSE_COMPLETED
Simple value that indicates the house has reached the final stage of construction.
void IncrementHouseAge(Tile t)
Increments the age of the house.
void SetHouseCompleted(Tile t, bool status)
Mark this house as been completed.
static HouseSpec * Get(size_t house_id)
Get the spec for a house ID.
void SetHouseTriggers(Tile t, uint8_t triggers)
Set the activated triggers bits for this house.
void SetTileType(Tile tile, TileType type)
Set the type of a tile.
bool IsHouseCompleted(Tile t)
Get the completion of this house.
uint16_t HouseID
OpenTTD ID of house types.
void SetTownIndex(Tile t, TownID index)
Set the town index for a road or house tile.
void SetLiftPosition(Tile t, uint8_t pos)
Set the position of the lift on this animated house.
uint8_t GetLiftPosition(Tile t)
Get the position of the lift on this animated house.
constexpr T SB(T &x, const uint8_t s, const uint8_t n, const U d)
Set n bits in x starting at bit s to d.
uint8_t GetHouseTriggers(Tile t)
Get the already activated triggers bits for this house.
static debug_inline bool IsTileType(Tile tile, TileType type)
Checks if a tile is a given tiletype.
void SetAnimationFrame(Tile t, uint8_t frame)
Set a new animation frame.
void DecHouseProcessingTime(Tile t)
Decrease the amount of time remaining before the tile loop processes this tile.
uint8_t GetLiftDestination(Tile t)
Get the current destination for this lift.
void MakeHouseTile(Tile t, TownID tid, uint8_t counter, uint8_t stage, HouseID type, uint8_t random_bits)
Make the tile a house.
static debug_inline bool IsRoadDepot(Tile t)
Return whether a tile is a road depot.
HouseID GetTranslatedHouseID(HouseID hid)
Do HouseID translation for NewGRFs.
uint8_t GetHouseConstructionTick(Tile t)
Gets the construction stage of a house.
debug_inline uint8_t & m1()
Primarily used for ownership information.
TownID GetTownIndex(Tile t)
Get the index of which town this house/street is attached to.
constexpr debug_inline bool HasBit(const T x, const uint8_t y)
Checks if a bit in a value is set.