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

Function GetFoundation_Industry

src/industry_cmd.cpp:394–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394static Foundation GetFoundation_Industry(TileIndex tile, Slope tileh)
395{
396 IndustryGfx gfx = GetIndustryGfx(tile);
397
398 /* For NewGRF industry tiles we might not be drawing a foundation. We need to
399 * account for this, as other structures should
400 * draw the wall of the foundation in this case.
401 */
402 if (gfx >= NEW_INDUSTRYTILEOFFSET) {
403 const IndustryTileSpec *indts = GetIndustryTileSpec(gfx);
404 if (indts->callback_mask.Test(IndustryTileCallbackMask::DrawFoundations)) {
405 uint32_t callback_res = GetIndustryTileCallback(CBID_INDTILE_DRAW_FOUNDATIONS, 0, 0, gfx, Industry::GetByTile(tile), tile);
406 if (callback_res != CALLBACK_FAILED && !ConvertBooleanCallback(indts->grf_prop.grffile, CBID_INDTILE_DRAW_FOUNDATIONS, callback_res)) return FOUNDATION_NONE;
407 }
408 }
409 return FlatteningFoundation(tileh);
410}
411
412static void AddAcceptedCargo_Industry(TileIndex tile, CargoArray &acceptance, CargoTypes &always_accepted)
413{

Callers

nothing calls this directly

Calls 6

GetIndustryGfxFunction · 0.85
GetIndustryTileSpecFunction · 0.85
GetIndustryTileCallbackFunction · 0.85
ConvertBooleanCallbackFunction · 0.85
FlatteningFoundationFunction · 0.85
TestMethod · 0.80

Tested by

no test coverage detected