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

Function TriggerHouseAnimation_TileLoop

src/newgrf_house.cpp:612–622  ·  view source on GitHub ↗

* Call the tile loop animation trigger for houses, if enabled. * @param tile House tile * @param sync Whether to call the synchronized or the unsynchronized trigger. * @param random_bits Shared random bits for the synchronized trigger. */

Source from the content-addressed store, hash-verified

610 * @param random_bits Shared random bits for the synchronized trigger.
611 */
612static void TriggerHouseAnimation_TileLoop(TileIndex tile, bool sync, uint16_t random_bits)
613{
614 const HouseSpec *hs = HouseSpec::Get(GetHouseType(tile));
615
616 /* Check whether the matching trigger is enabled */
617 if (hs->callback_mask.Test(HouseCallbackMask::AnimationTriggerTileLoop) &&
618 hs->extra_flags.Test(HouseExtraFlag::SynchronisedCallback1B) == sync) {
619 uint32_t param = sync ? (GB(Random(), 0, 16) | random_bits << 16) : Random();
620 HouseAnimationBase::ChangeAnimationFrame(CBID_HOUSE_ANIMATION_TRIGGER_TILE_LOOP, hs, Town::GetByTile(tile), tile, param, 0);
621 }
622}
623
624bool NewHouseTileLoop(TileIndex tile)
625{

Callers 1

NewHouseTileLoopFunction · 0.85

Calls 4

GetHouseTypeFunction · 0.85
GBFunction · 0.85
TestMethod · 0.80
RandomFunction · 0.50

Tested by

no test coverage detected