MCPcopy Create free account
hub / github.com/defold/defold / CancelAnimationCallbacks

Function CancelAnimationCallbacks

engine/gameobject/src/gameobject/comp_anim.cpp:739–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737 }
738
739 void CancelAnimationCallbacks(HCollection collection, void* userdata1)
740 {
741 AnimWorld* const world = GetWorld(collection);
742 uint16_t* head_ptr = world->m_ListenerInstanceToIndex.Get((uintptr_t)userdata1);
743 if (0x0 != head_ptr)
744 {
745 uint16_t index = *head_ptr;
746 while (INVALID_INDEX != index)
747 {
748 uint16_t anim_index = world->m_AnimMap[index];
749 Animation* const anim = &world->m_Animations[anim_index];
750
751 index = anim->m_NextListener;
752
753 anim->m_PreviousListener = INVALID_INDEX;
754 anim->m_NextListener = INVALID_INDEX;
755 anim->m_AnimationStopped = 0x0;
756 anim->m_Userdata1 = 0x0;
757 anim->m_Userdata2 = 0x0;
758 }
759 world->m_ListenerInstanceToIndex.Erase((uintptr_t)userdata1);
760 }
761 }
762}

Callers 1

DeleteScriptInstanceFunction · 0.85

Calls 3

GetWorldFunction · 0.70
GetMethod · 0.45
EraseMethod · 0.45

Tested by

no test coverage detected