(svn r17558) -Feature [NewGRF]: callbacks for houses to disable drawing foundations and to disable slope changes, like industry tile callbacks 30 and 3C.

This commit is contained in:
rubidium
2009-09-16 19:10:50 +00:00
parent 24e9ee8ab4
commit 430ce19418
4 changed files with 46 additions and 3 deletions

View File

@@ -426,7 +426,16 @@ void DrawNewHouseTile(TileInfo *ti, HouseID house_id)
const SpriteGroup *group;
ResolverObject object;
if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED);
if (ti->tileh != SLOPE_FLAT) {
bool draw_old_one = true;
if (HasBit(hs->callback_mask, CBM_HOUSE_DRAW_FOUNDATIONS)) {
/* Called to determine the type (if any) of foundation to draw for the house tile */
uint32 callback_res = GetHouseCallback(CBID_HOUSE_DRAW_FOUNDATIONS, 0, 0, house_id, Town::GetByTile(ti->tile), ti->tile);
draw_old_one = (callback_res != 0);
}
if (draw_old_one) DrawFoundation(ti, FOUNDATION_LEVELED);
}
NewHouseResolver(&object, house_id, ti->tile, Town::GetByTile(ti->tile));