//
// CCPartAnimSprite::setDisplayFrame from 0x693198 to 0x693300 (360 bytes)
//
// 2 xrefs:
// > ??> @ 0x45bf8
// > ??> @ 0x1417648
//
// This function is hookable on this platform (idp: arm, 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 12:50:36 +0000
//
__int64 __fastcall CCPartAnimSprite::setDisplayFrame(__int64 this, cocos2d::CCSpriteFrame *a2)
{
cocos2d::CCSpriteFrame *v2; // x2
__int64 v3; // x20
CCAnimateFrameCache *v5; // x0
CCAnimateFrameCache *v6; // x21
const char *CString; // x0
__int64 v8; // x22
__int64 v9; // x0
unsigned int *v10; // x1
__int64 *v11; // x19
__int64 v12; // x0
char *v13; // x21
__int64 v14; // x0
__int64 v15; // x22
int v16; // w21
__int64 v17; // x19
__int64 v18; // x1
__int64 v19; // x0
unsigned int v20; // w21
_BYTE **v21; // x19
_BYTE **v22; // x21
_BYTE *v23; // x0
if ( a2 )
{
v2 = *(cocos2d::CCSpriteFrame **)(this + 608);
if ( a2 != v2 )
{
v3 = this;
if ( v2 )
cocos2d::CCObject::release(*(cocos2d::CCObject **)(this + 608));
*(_QWORD *)(v3 + 608) = a2;
v5 = (CCAnimateFrameCache *)cocos2d::CCObject::retain(a2);
v6 = (CCAnimateFrameCache *)CCAnimateFrameCache::sharedSpriteFrameCache(v5);
CString = (const char *)cocos2d::CCString::getCString(a2);
v8 = CCAnimateFrameCache::spriteFrameByName(v6, CString);
if ( !v8 )
goto LABEL_20;
v9 = *(_QWORD *)(v3 + 632);
if ( v9 && (v10 = *(unsigned int **)(v9 + 56), *v10) )
{
v11 = *((__int64 **)v10 + 2);
v12 = 8LL * *v10 - 8;
v13 = (char *)v11 + v12;
if ( v11 <= (__int64 *)((char *)v11 + v12) && (v14 = *v11) != 0 )
{
do
{
++v11;
CCSpritePart::markAsNotBeingUsed(v14);
if ( v13 < (char *)v11 )
break;
v14 = *v11;
}
while ( *v11 );
v15 = *(_QWORD *)(v8 + 56);
v16 = *(_DWORD *)v15;
if ( *(int *)v15 <= 0 )
{
LABEL_15:
v19 = *(_QWORD *)(v3 + 632);
if ( v19 )
{
v10 = *(unsigned int **)(v19 + 56);
v20 = *v10;
if ( *v10 )
{
LABEL_17:
v21 = *((_BYTE ***)v10 + 2);
v22 = &v21[v20 - 1];
while ( v22 >= v21 )
{
v23 = *v21;
if ( !*v21 )
break;
++v21;
CCSpritePart::hideInactive(v23);
}
}
}
LABEL_20:
this = 1;
*(_BYTE *)(v3 + 616) = 1;
return this;
}
}
else
{
v15 = *(_QWORD *)(v8 + 56);
v16 = *(_DWORD *)v15;
if ( *(int *)v15 <= 0 )
{
v20 = *v10;
goto LABEL_17;
}
}
}
else
{
v15 = *(_QWORD *)(v8 + 56);
v16 = *(_DWORD *)v15;
if ( *(int *)v15 <= 0 )
goto LABEL_20;
}
v17 = 0;
do
{
v18 = *(_QWORD *)(*(_QWORD *)(v15 + 16) + 8 * v17++);
CCPartAnimSprite::transformSprite((cocos2d::CCArray **)v3, v18);
}
while ( v16 > (int)v17 );
goto LABEL_15;
}
}
return this;
}