* 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) */
| 373 | * @pre IsTileType(t, MP_CLEAR) |
| 374 | */ |
| 375 | inline 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 */ |
no test coverage detected