MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / AnimateToyFactory

Function AnimateToyFactory

src/industry_cmd.cpp:613–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611}
612
613static void AnimateToyFactory(TileIndex tile)
614{
615 uint8_t m = GetAnimationFrame(tile) + 1;
616
617 switch (m) {
618 case 1: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2C_TOY_FACTORY_1, tile); break;
619 case 23: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2B_TOY_FACTORY_2, tile); break;
620 case 28: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2A_TOY_FACTORY_3, tile); break;
621 default:
622 if (m >= 50) {
623 int n = GetIndustryAnimationLoop(tile) + 1;
624 m = 0;
625 if (n >= 8) {
626 n = 0;
627 DeleteAnimatedTile(tile);
628 }
629 SetIndustryAnimationLoop(tile, n);
630 }
631 }
632
633 SetAnimationFrame(tile, m);
634 MarkTileDirtyByTile(tile);
635}
636
637static void AnimatePlasticFountain(TileIndex tile, IndustryGfx gfx)
638{

Callers 1

AnimateTile_IndustryFunction · 0.85

Calls 7

GetAnimationFrameFunction · 0.85
SndPlayTileFxFunction · 0.85
GetIndustryAnimationLoopFunction · 0.85
DeleteAnimatedTileFunction · 0.85
SetIndustryAnimationLoopFunction · 0.85
SetAnimationFrameFunction · 0.85
MarkTileDirtyByTileFunction · 0.70

Tested by

no test coverage detected