diff options
author | rubidium <rubidium@openttd.org> | 2006-12-30 11:57:52 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2006-12-30 11:57:52 +0000 |
commit | 5f88e816416ee78b3b693253c0ff298c36459a8b (patch) | |
tree | 208ddbfdccba148fd9aa969b5124fe9c495ba540 /industry_cmd.c | |
parent | c7b1fd6fc2dd73e9b9bf150b5bb81e340fa75958 (diff) | |
download | openttd-5f88e816416ee78b3b693253c0ff298c36459a8b.tar.xz |
(svn r7642) -Codechange: unify all the different locations where the animation state is stored into a single location.
Diffstat (limited to 'industry_cmd.c')
-rw-r--r-- | industry_cmd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/industry_cmd.c b/industry_cmd.c index a200ccf4e..38e2c516b 100644 --- a/industry_cmd.c +++ b/industry_cmd.c @@ -203,6 +203,7 @@ static IndustryDrawTileProc * const _industry_draw_tile_procs[5] = { static void DrawTile_Industry(TileInfo *ti) { + const IndustryGfx gfx = GetIndustryGfx(ti->tile); const Industry *ind; const DrawBuildingsTileStruct *dits; byte z; @@ -213,7 +214,9 @@ static void DrawTile_Industry(TileInfo *ti) ormod = GENERAL_SPRITE_COLOR(ind->random_color); /* Retrieve pointer to the draw industry tile struct */ - dits = &_industry_draw_tile_data[GetIndustryGfx(ti->tile) << 2 | GetIndustryConstructionStage(ti->tile)]; + dits = &_industry_draw_tile_data[gfx << 2 | (_industry_section_draw_animation_state[gfx] ? + GetIndustryAnimationState(ti->tile) & 3 : + GetIndustryConstructionStage(ti->tile))]; image = dits->ground; if (image & PALETTE_MODIFIER_COLOR && (image & PALETTE_SPRITE_MASK) == 0) @@ -496,7 +499,7 @@ static void AnimateTile_Industry(TileIndex tile) if (state < 0x20 || state >= 0x180) { m = GetIndustryAnimationState(tile); if (!(m & 0x40)) { - SetIndustryAnimationState(tile, m |= 0x40); + SetIndustryAnimationState(tile, m | 0x40); SndPlayTileFx(SND_0B_MINING_MACHINERY, tile); } if (state & 7) |