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