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

Function MakeHouseTile

src/town_map.h:375–390  ·  view source on GitHub ↗

* Make the tile a house. * @param t tile index * @param tid Town index * @param counter of construction step * @param stage of construction (used for drawing) * @param type of house. Index into house specs array * @param random_bits required for newgrf houses * @param house_protected Whether the house is protected from the town upgrading it. * @pre IsTileType(t, MP_CLEAR) */

Source from the content-addressed store, hash-verified

373 * @pre IsTileType(t, MP_CLEAR)
374 */
375inline void MakeHouseTile(Tile t, TownID tid, uint8_t counter, uint8_t stage, HouseID type, uint8_t random_bits, bool house_protected)
376{
377 assert(IsTileType(t, MP_CLEAR));
378
379 SetTileType(t, MP_HOUSE);
380 t.m1() = random_bits;
381 t.m2() = tid.base();
382 t.m3() = 0;
383 SetHouseType(t, type);
384 SetHouseCompleted(t, stage == TOWN_HOUSE_COMPLETED);
385 t.m5() = IsHouseCompleted(t) ? 0 : (stage << 3 | counter);
386 SetHouseProtected(t, house_protected);
387 SetAnimationFrame(t, 0);
388 SetHouseProcessingTime(t, HouseSpec::Get(type)->processing_time);
389 SB(t.m8(), 12, 4, 0);
390}
391
392#endif /* TOWN_MAP_H */

Callers 1

ClearMakeHouseTileFunction · 0.85

Calls 10

IsTileTypeFunction · 0.85
SetTileTypeFunction · 0.85
SetHouseTypeFunction · 0.85
SetHouseCompletedFunction · 0.85
IsHouseCompletedFunction · 0.85
SetHouseProtectedFunction · 0.85
SetAnimationFrameFunction · 0.85
SetHouseProcessingTimeFunction · 0.85
SBFunction · 0.85
baseMethod · 0.45

Tested by

no test coverage detected