//
// CCPartAnimSprite::setDisplayFrame from 0x140046130 to 0x14004639d (621 bytes)
//
// 5 xrefs:
// > ??> @ 0x14052fe90
// > ??> @ 0x140662b68
// > ??> @ 0x140662ba8
// > ??> @ 0x140662bb8
// > ??> @ 0x1406c4788
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void CCPartAnimSprite::setDisplayFrame(CCPartAnimSprite *a1, cocos2d::CCSpriteFrame *a2)
{
cocos2d::CCSpriteFrame *m_spriteFrame; // rcx
const char *CString; // rbx
CCAnimateFrameCache *v6; // rax
cocos2d::CCArray *v7; // r8
cocos2d::CCArray *m_spriteParts; // rcx
cocos2d::ccArray *data; // rcx
__int64 num; // rdx
cocos2d::CCObject **arr; // rcx
cocos2d::CCObject **i; // rdx
cocos2d::CCObject *v13; // rax
cocos2d::ccArray *v14; // r15
__int64 v15; // r14
__int64 j; // rbp
cocos2d::CCObject *v17; // rdi
struct cocos2d::CCObject *v18; // rbx
__int64 FrameName; // rax
int m_eObjType; // edi
__int64 v21; // rdx
cocos2d::CCObject_vtbl *v22; // rax
cocos2d::CCArray *v23; // rax
cocos2d::ccArray *v24; // rbx
__int64 v25; // rax
cocos2d::CCObject **v26; // rbx
cocos2d::CCObject **k; // rdi
cocos2d::CCObject *v28; // rcx
char v29[32]; // [rsp+20h] [rbp-58h] BYREF
if ( a2 )
{
m_spriteFrame = a1->m_spriteFrame;
if ( a2 != m_spriteFrame )
{
if ( m_spriteFrame )
cocos2d::CCObject::release(m_spriteFrame);
a1->m_spriteFrame = a2;
cocos2d::CCObject::retain(a2);
CString = cocos2d::CCString::getCString((cocos2d::CCString *)a2);
v6 = CCAnimateFrameCache::sharedSpriteFrameCache();
v7 = CCAnimateFrameCache::spriteFrameByName(v6, CString);
if ( v7 )
{
m_spriteParts = a1->m_spriteParts;
if ( m_spriteParts )
{
data = m_spriteParts->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = &arr[num - 1]; arr <= i; LOBYTE(v13[11].m_uID) = 0 )
{
v13 = *arr;
if ( !*arr )
break;
++arr;
}
}
}
v14 = v7->data;
v15 = (int)v14->num;
if ( v15 > 0 )
{
for ( j = 0; j < v15; ++j )
{
v17 = v14->arr[j];
v18 = cocos2d::CCArray::objectAtIndex(a1->m_spriteParts, v17[1].m_uIndexInArray);
cocos2d::CCNode::stopAllActions((cocos2d::CCNode *)v18);
v18->__vftable[2].encodeWithCoder(v18, (DS_Dictionary *)&v17[1]);
v18->__vftable[1].canEncode(v18);
((void (__fastcall *)(struct cocos2d::CCObject *))v18->__vftable[1].setTag)(v18);
v18->__vftable[4].canEncode(v18);
if ( LOBYTE(v17[1].m_uUnknown) )
{
((void (__fastcall *)(struct cocos2d::CCObject *, _QWORD))v18->__vftable[13].getTag)(
v18,
*(_QWORD *)&v17[1].m_unknown2);
FrameName = cocos2d::CCSpriteFrame::getFrameName(*(_QWORD *)&v17[1].m_unknown2, v29);
CCSpritePart::frameChanged(v18, FrameName);
}
m_eObjType = v17[1].m_eObjType;
if ( ((unsigned int (__fastcall *)(struct cocos2d::CCObject *))v18->__vftable[1].acceptVisitor)(v18) != m_eObjType )
a1->reorderChild(a1, (cocos2d::CCNode *)v18, m_eObjType);
v22 = v18->__vftable;
LOBYTE(v21) = 1;
LOBYTE(v18[11].m_uID) = 1;
((void (__fastcall *)(struct cocos2d::CCObject *, __int64))v22[4].update)(v18, v21);
}
}
v23 = a1->m_spriteParts;
if ( v23 )
{
v24 = v23->data;
v25 = v24->num;
if ( (_DWORD)v25 )
{
v26 = v24->arr;
for ( k = &v26[v25 - 1]; v26 <= k; ++v26 )
{
v28 = *v26;
if ( !*v26 )
break;
if ( !LOBYTE(v28[11].m_uID) )
((void (__fastcall *)(cocos2d::CCObject *, _QWORD))v28->__vftable[4].update)(v28, 0);
}
}
}
}
a1->m_hasChanged = 1;
}
}
}