diff options
author | rubidium <rubidium@openttd.org> | 2007-07-26 16:51:10 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-07-26 16:51:10 +0000 |
commit | d624f66c794109a22787685a3aa53d6cf35a02ba (patch) | |
tree | 4b6a986aa841f12efff161e45aacd1a023cff71d /src/town_cmd.cpp | |
parent | 5bd241eb5b151dd9a5ebda0a93aff8740713ce62 (diff) | |
download | openttd-d624f66c794109a22787685a3aa53d6cf35a02ba.tar.xz |
(svn r10698) -Codechange [FS#1082]: simplify the code related to foundations. Primarily removal of (duplicated|magic) code and introduction of few helper functions to ease foundation determination. Patch by frosch.
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 79e1fb347..6615c1b36 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -154,7 +154,7 @@ static void DrawTile_Town(TileInfo *ti) /* Retrieve pointer to the draw town tile struct */ dcts = &_town_draw_tile_data[house_id << 4 | OriginalTileRandomiser(ti->x, ti->y) << 2 | GetHouseBuildingStage(ti->tile)]; - if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, ti->tileh); + if (ti->tileh != SLOPE_FLAT) DrawFoundation(ti, FOUNDATION_LEVELED); image = dcts->ground.sprite; pal = dcts->ground.pal; @@ -188,9 +188,9 @@ static uint GetSlopeZ_Town(TileIndex tile, uint x, uint y) return GetTileMaxZ(tile); } -static Slope GetSlopeTileh_Town(TileIndex tile, Slope tileh) +static Foundation GetFoundation_Town(TileIndex tile, Slope tileh) { - return SLOPE_FLAT; + return FlatteningFoundation(tileh); } /** @@ -2350,7 +2350,7 @@ extern const TileTypeProcs _tile_type_town_procs = { ChangeTileOwner_Town, /* change_tile_owner_clear */ NULL, /* get_produced_cargo_proc */ NULL, /* vehicle_enter_tile_proc */ - GetSlopeTileh_Town, /* get_slope_tileh_proc */ + GetFoundation_Town, /* get_foundation_proc */ }; |