* Get the foundation for a house. This is a tile callback routine. * @param tile The tile to find a foundation for. * @param tileh The slope of the tile. */
| 313 | * @param tileh The slope of the tile. |
| 314 | */ |
| 315 | static Foundation GetFoundation_Town(TileIndex tile, Slope tileh) |
| 316 | { |
| 317 | HouseID hid = GetHouseType(tile); |
| 318 | |
| 319 | /* For NewGRF house tiles we might not be drawing a foundation. We need to |
| 320 | * account for this, as other structures should |
| 321 | * draw the wall of the foundation in this case. |
| 322 | */ |
| 323 | if (hid >= NEW_HOUSE_OFFSET) { |
| 324 | const HouseSpec *hs = HouseSpec::Get(hid); |
| 325 | if (hs->callback_mask.Test(HouseCallbackMask::DrawFoundations)) { |
| 326 | uint32_t callback_res = GetHouseCallback(CBID_HOUSE_DRAW_FOUNDATIONS, 0, 0, hid, Town::GetByTile(tile), tile); |
| 327 | if (callback_res != CALLBACK_FAILED && !ConvertBooleanCallback(hs->grf_prop.grffile, CBID_HOUSE_DRAW_FOUNDATIONS, callback_res)) return FOUNDATION_NONE; |
| 328 | } |
| 329 | } |
| 330 | return FlatteningFoundation(tileh); |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * Animate a tile for a town. |
nothing calls this directly
no test coverage detected