//
// CCPartAnimSprite::setDisplayFrame from 0x140049e50 to 0x14004a0c0 (624 bytes)
//
// 5 xrefs:
// > ??> @ 0x14070aae8
// > ??> @ 0x140885c04
// > ??> @ 0x140885c44
// > ??> @ 0x140885c54
// > ??> @ 0x14090fc80
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:25:32 +0000
//
void __fastcall CCPartAnimSprite::setDisplayFrame(__int64 a1, cocos2d::CCObject *a2)
{
cocos2d::CCObject *v4; // rcx
char *CString; // rbx
__int64 v6; // rax
__int64 v7; // r8
__int64 v8; // rcx
unsigned int *v9; // rcx
__int64 v10; // rdx
__int64 *v11; // rcx
__int64 *i; // rdx
__int64 v13; // rax
int *v14; // r15
__int64 v15; // r14
__int64 j; // rbp
__int64 v17; // rdi
struct cocos2d::CCObject *v18; // rbx
__int64 FrameName; // rax
unsigned int v20; // edi
__int64 v21; // rdx
__int64 v22; // rax
__int64 v23; // rax
unsigned int *v24; // rbx
__int64 v25; // rax
_BYTE **v26; // rbx
_BYTE **k; // rdi
_BYTE *v28; // rcx
_BYTE v29[32]; // [rsp+20h] [rbp-58h] BYREF
if ( a2 )
{
v4 = *(cocos2d::CCObject **)(a1 + 608);
if ( a2 != v4 )
{
if ( v4 )
cocos2d::CCObject::release(v4);
*(_QWORD *)(a1 + 608) = a2;
cocos2d::CCObject::retain(a2);
CString = (char *)cocos2d::CCString::getCString(a2);
v6 = CCAnimateFrameCache::sharedSpriteFrameCache();
v7 = CCAnimateFrameCache::spriteFrameByName(v6, CString);
if ( v7 )
{
v8 = *(_QWORD *)(a1 + 632);
if ( v8 )
{
v9 = *(unsigned int **)(v8 + 56);
v10 = *v9;
if ( (_DWORD)v10 )
{
v11 = *((__int64 **)v9 + 2);
for ( i = &v11[v10 - 1]; v11 <= i; *(_BYTE *)(v13 + 624) = 0 )
{
v13 = *v11;
if ( !*v11 )
break;
++v11;
}
}
}
v14 = *(int **)(v7 + 56);
v15 = *v14;
if ( v15 > 0 )
{
for ( j = 0; j < v15; ++j )
{
v17 = *(_QWORD *)(*((_QWORD *)v14 + 2) + 8 * j);
v18 = cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 632), *(_DWORD *)(v17 + 88));
cocos2d::CCNode::stopAllActions(v18);
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(*(_QWORD *)v18 + 184LL))(v18, v17 + 56);
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v18 + 120LL))(v18);
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v18 + 136LL))(v18);
(*(void (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v18 + 352LL))(v18);
if ( *(_BYTE *)(v17 + 92) )
{
(*(void (__fastcall **)(struct cocos2d::CCObject *, _QWORD))(*(_QWORD *)v18 + 1008LL))(
v18,
*(_QWORD *)(v17 + 96));
FrameName = cocos2d::CCSpriteFrame::getFrameName(*(_QWORD *)(v17 + 96), v29);
CCSpritePart::frameChanged(v18, FrameName);
}
v20 = *(_DWORD *)(v17 + 84);
if ( (*(unsigned int (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v18 + 96LL))(v18) != v20 )
(*(void (__fastcall **)(__int64, struct cocos2d::CCObject *, _QWORD))(*(_QWORD *)a1 + 584LL))(
a1,
v18,
v20);
v22 = *(_QWORD *)v18;
LOBYTE(v21) = 1;
*((_BYTE *)v18 + 624) = 1;
(*(void (__fastcall **)(struct cocos2d::CCObject *, __int64))(v22 + 336))(v18, v21);
}
}
v23 = *(_QWORD *)(a1 + 632);
if ( v23 )
{
v24 = *(unsigned int **)(v23 + 56);
v25 = *v24;
if ( (_DWORD)v25 )
{
v26 = *((_BYTE ***)v24 + 2);
for ( k = &v26[v25 - 1]; v26 <= k; ++v26 )
{
v28 = *v26;
if ( !*v26 )
break;
if ( !v28[624] )
(*(void (__fastcall **)(_BYTE *, _QWORD))(*(_QWORD *)v28 + 336LL))(v28, 0);
}
}
}
}
*(_BYTE *)(a1 + 616) = 1;
}
}
}