(svn r20627) -Codechange: unify the animation code of station, airport, house and industry tiles

This commit is contained in:
rubidium
2010-08-26 17:01:17 +00:00
parent 09b1a0800e
commit 7107eef4de
7 changed files with 196 additions and 319 deletions

View File

@@ -411,18 +411,12 @@ static void MakeSingleHouseBigger(TileIndex tile)
IncHouseConstructionTick(tile);
if (GetHouseConstructionTick(tile) != 0) return;
const HouseSpec *hs = HouseSpec::Get(GetHouseType(tile));
/* Check and/or */
if (HasBit(hs->callback_mask, CBM_HOUSE_CONSTRUCTION_STATE_CHANGE)) {
uint16 callback_res = GetHouseCallback(CBID_HOUSE_CONSTRUCTION_STATE_CHANGE, 0, 0, GetHouseType(tile), Town::GetByTile(tile), tile);
if (callback_res != CALLBACK_FAILED) ChangeHouseAnimationFrame(hs->grf_prop.grffile, tile, callback_res);
}
AnimateNewHouseConstruction(tile);
if (IsHouseCompleted(tile)) {
/* Now that construction is complete, we can add the population of the
* building to the town. */
ChangePopulation(Town::GetByTile(tile), hs->population);
ChangePopulation(Town::GetByTile(tile), HouseSpec::Get(GetHouseType(tile))->population);
ResetHouseAge(tile);
}
MarkTileDirtyByTile(tile);