MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / createMapAnimations

Method createMapAnimations

src/OpenLoco/src/World/Industry.cpp:647–683  ·  view source on GitHub ↗

0x00459D43

Source from the content-addressed store, hash-verified

645
646 // 0x00459D43
647 void Industry::createMapAnimations()
648 {
649 for (size_t i = 0; i < numTiles; i++)
650 {
651 auto& tilePos = tiles[i];
652 auto baseZ = (tilePos.z & ~Location::null) / 4;
653 auto tile = TileManager::get(tilePos);
654
655 for (auto& el : tile)
656 {
657 auto* industryEl = el.as<IndustryElement>();
658 if (industryEl == nullptr)
659 {
660 continue;
661 }
662
663 if (industryEl->baseZ() != baseZ)
664 {
665 continue;
666 }
667
668 auto tileIndustry = industryEl->industry();
669 if (tileIndustry != nullptr)
670 {
671 const auto* industryObject = tileIndustry->getObject();
672 if (industryObject != nullptr)
673 {
674 auto animOffsets = getBuildingTileOffsets(industryObject->buildingSizeFlags & (1U << industryEl->buildingType()));
675 for (auto animOffset : animOffsets)
676 {
677 AnimationManager::createAnimation(3, animOffset.pos + tilePos, baseZ);
678 }
679 }
680 }
681 }
682 }
683 }
684
685 // 0x004574F7
686 void Industry::updateProducedCargoStats()

Callers 1

createAllMapAnimationsFunction · 0.80

Calls 7

getBuildingTileOffsetsFunction · 0.85
createAnimationFunction · 0.85
baseZMethod · 0.80
industryMethod · 0.80
getFunction · 0.70
getObjectMethod · 0.45
buildingTypeMethod · 0.45

Tested by

no test coverage detected