diff options
author | rubidium <rubidium@openttd.org> | 2009-09-16 19:10:50 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-09-16 19:10:50 +0000 |
commit | 430ce1941871d71a3c8cf6259001a488bdfeb9da (patch) | |
tree | 96bc0bd7facb66575cb18c456c744ecf932607cb /src/newgrf_house.cpp | |
parent | 24e9ee8ab4244b5562d3a780b153b33d1a5b64df (diff) | |
download | openttd-430ce1941871d71a3c8cf6259001a488bdfeb9da.tar.xz |
(svn r17558) -Feature [NewGRF]: callbacks for houses to disable drawing foundations and to disable slope changes, like industry tile callbacks 30 and 3C.
Diffstat (limited to 'src/newgrf_house.cpp')
-rw-r--r-- | src/newgrf_house.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp index 10dbe3272..da57d68d9 100644 --- a/src/newgrf_house.cpp +++ b/src/newgrf_house.cpp @@ -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)); |