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

Function RemoveAnimationCallback

engine/gameobject/src/gameobject/comp_anim.cpp:702–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700 }
701
702 static void RemoveAnimationCallback(AnimWorld* world, Animation* anim)
703 {
704 uint16_t previous = anim->m_PreviousListener;
705 uint16_t next = anim->m_NextListener;
706
707 if (INVALID_INDEX != previous)
708 {
709 uint16_t anim_index_prev = world->m_AnimMap[previous];
710 world->m_Animations[anim_index_prev].m_NextListener = next;
711 }
712 if (INVALID_INDEX != next)
713 {
714 uint16_t anim_index_next = world->m_AnimMap[next];
715 world->m_Animations[anim_index_next].m_PreviousListener = previous;
716 }
717 if (INVALID_INDEX == previous)
718 {
719 if (INVALID_INDEX == next)
720 {
721 uint16_t* p = world->m_ListenerInstanceToIndex.Get((uintptr_t)anim->m_Userdata1);
722 if (p != 0)
723 world->m_ListenerInstanceToIndex.Erase((uintptr_t)anim->m_Userdata1);
724 }
725 else
726 {
727 world->m_ListenerInstanceToIndex.Put((uintptr_t)anim->m_Userdata1, next);
728 }
729 }
730
731 anim->m_PreviousListener = INVALID_INDEX;
732 anim->m_NextListener = INVALID_INDEX;
733 anim->m_AnimationStopped = 0x0;
734 anim->m_Userdata1 = 0x0;
735 anim->m_Userdata2 = 0x0;
736
737 }
738
739 void CancelAnimationCallbacks(HCollection collection, void* userdata1)
740 {

Callers 2

CompAnimUpdateFunction · 0.85
CancelAnimationsFunction · 0.85

Calls 3

GetMethod · 0.45
EraseMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected