Industry: Determine which tiles in industry layouts are not animated

Do not set these as animated tiles for new industries
This commit is contained in:
Jonathan G Rennison
2022-06-01 00:30:21 +01:00
parent 220390ed3e
commit 42e20d3d99
12 changed files with 208 additions and 3 deletions

View File

@@ -1948,6 +1948,9 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
/* Plant the tiles */
uint64 anim_inhibit_mask = indspec->layout_anim_masks[layout_index];
uint gfx_idx = 0;
for (const IndustryTileLayoutTile &it : layout) {
TileIndex cur_tile = tile + ToTileIndexDiff(it.ti);
@@ -1968,7 +1971,11 @@ static void DoCreateNewIndustry(Industry *i, TileIndex tile, IndustryType type,
/* it->gfx is stored in the map. But the translated ID cur_gfx is the interesting one */
IndustryGfx cur_gfx = GetTranslatedIndustryTileID(it.gfx);
const IndustryTileSpec *its = GetIndustryTileSpec(cur_gfx);
if (its->animation.status != ANIM_STATUS_NO_ANIMATION) AddAnimatedTile(cur_tile);
if (its->animation.status != ANIM_STATUS_NO_ANIMATION) {
if (gfx_idx >= 64 || !HasBit(anim_inhibit_mask, gfx_idx)) AddAnimatedTile(cur_tile);
}
gfx_idx++;
}
}