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

Function GetFoundation_Town

src/town_cmd.cpp:315–331  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

313 * @param tileh The slope of the tile.
314 */
315static 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.

Callers

nothing calls this directly

Calls 5

GetHouseTypeFunction · 0.85
GetHouseCallbackFunction · 0.85
ConvertBooleanCallbackFunction · 0.85
FlatteningFoundationFunction · 0.85
TestMethod · 0.80

Tested by

no test coverage detected