//
// CCPartAnimSprite::tweenToFrame from 0x1400463d0 to 0x1400466fe (814 bytes)
//
// 2 xrefs:
// > CCAnimatedSprite::tweenToAnimation @ 0x140040f8e
// > ??> @ 0x1406c47d0
//
// 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
//
// Hidden C++ exception states: #wind=1
void CCPartAnimSprite::tweenToFrame(CCPartAnimSprite *a1, cocos2d::CCSpriteFrame *a2, float a3)
{
float v3; // xmm3_4
const char *CString; // rax
size_t v6; // r8
void **v7; // rbx
CCAnimateFrameCache *v8; // rax
cocos2d::CCArray *v9; // rax
cocos2d::CCArray *v10; // r8
cocos2d::CCArray *m_spriteParts; // rcx
cocos2d::ccArray *data; // rcx
__int64 num; // rdx
cocos2d::CCObject **arr; // rcx
cocos2d::CCObject **i; // rdx
cocos2d::ccArray *v16; // rax
__int64 v17; // r13
__int64 j; // r12
cocos2d::CCObject *v19; // rbp
struct cocos2d::CCObject *v20; // r14
float v21; // xmm7_4
float v22; // xmm6_4
struct cocos2d::CCMoveTo *v23; // rsi
struct cocos2d::CCScaleTo *v24; // rdi
struct cocos2d::CCRotateTo *v25; // rbx
cocos2d::ccColor3B *v26; // r8
cocos2d::ccColor3B *v27; // r8
cocos2d::ccColor3B *v28; // r8
__int64 FrameName; // rax
int m_eObjType; // ebx
__int64 v31; // rdx
cocos2d::CCArray *v32; // rax
cocos2d::ccArray *v33; // rbx
__int64 v34; // rax
cocos2d::CCObject **v35; // rbx
cocos2d::CCObject **k; // rdi
cocos2d::CCObject *v37; // rcx
void *v38; // rcx
cocos2d::ccArray *v39; // [rsp+20h] [rbp-E8h]
float v40; // [rsp+20h] [rbp-E8h]
float v41; // [rsp+20h] [rbp-E8h]
char v42[32]; // [rsp+30h] [rbp-D8h] BYREF
void *Block[2]; // [rsp+50h] [rbp-B8h] BYREF
__int128 v44; // [rsp+60h] [rbp-A8h]
if ( a1->m_spriteFrame )
{
CString = cocos2d::CCString::getCString((cocos2d::CCString *)a2);
*(_OWORD *)Block = 0;
v44 = 0;
v6 = -1;
do
++v6;
while ( CString[v6] );
sub_14003A930(Block, CString, v6);
v7 = Block;
if ( *((_QWORD *)&v44 + 1) > 0xFu )
v7 = (void **)Block[0];
v8 = CCAnimateFrameCache::sharedSpriteFrameCache();
v9 = CCAnimateFrameCache::spriteFrameByName(v8, (const char *)v7);
v10 = v9;
if ( v9 )
{
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; ++arr )
{
if ( !*arr )
break;
LOBYTE((*arr)[11].m_uID) = 0;
}
}
}
v16 = v9->data;
LODWORD(v39) = (_DWORD)v16;
v17 = (int)v16->num;
if ( v17 > 0 )
{
for ( j = 0; j < v17; ++j )
{
v19 = v16->arr[j];
v20 = cocos2d::CCArray::objectAtIndex(a1->m_spriteParts, v19[1].m_uIndexInArray);
cocos2d::CCNode::stopAllActions((cocos2d::CCNode *)v20);
v21 = *(float *)&v19[1].m_uID;
if ( *(float *)&v19[1].m_nTag != 0.0 )
v21 = -v21;
v22 = *(float *)&v19[1].m_nLuaID;
if ( *(float *)&v19[1].m_uReference != 0.0 )
v22 = -v22;
v23 = cocos2d::CCMoveTo::create(a3, (const struct cocos2d::CCPoint *)&v19[1]);
v24 = cocos2d::CCScaleTo::create(a3, v21, v22);
v25 = cocos2d::CCRotateTo::create(a3, *(float *)&v19[1].m_uAutoReleaseCount);
cocos2d::CCNode::runAction((CCLightFlash *)v20, (cocos2d::CCPoint)v23, v26, v3, *(float *)&v39);
cocos2d::CCNode::runAction((CCLightFlash *)v20, (cocos2d::CCPoint)v24, v27, v3, v40);
cocos2d::CCNode::runAction((CCLightFlash *)v20, (cocos2d::CCPoint)v25, v28, v3, v41);
if ( LOBYTE(v19[1].m_uUnknown) )
{
((void (__fastcall *)(struct cocos2d::CCObject *, _QWORD))v20->__vftable[13].getTag)(
v20,
*(_QWORD *)&v19[1].m_unknown2);
FrameName = cocos2d::CCSpriteFrame::getFrameName(*(_QWORD *)&v19[1].m_unknown2, v42);
CCSpritePart::frameChanged(v20, FrameName);
}
m_eObjType = v19[1].m_eObjType;
if ( ((unsigned int (__fastcall *)(struct cocos2d::CCObject *))v20->__vftable[1].acceptVisitor)(v20) != m_eObjType )
a1->reorderChild(a1, (cocos2d::CCNode *)v20, m_eObjType);
LOBYTE(v20[11].m_uID) = 1;
LOBYTE(v31) = 1;
((void (__fastcall *)(struct cocos2d::CCObject *, __int64))v20->__vftable[4].update)(v20, v31);
v16 = v39;
}
}
v32 = a1->m_spriteParts;
if ( v32 )
{
v33 = v32->data;
v34 = v33->num;
if ( (_DWORD)v34 )
{
v35 = v33->arr;
for ( k = &v35[v34 - 1]; v35 <= k; ++v35 )
{
v37 = *v35;
if ( !*v35 )
break;
if ( !LOBYTE(v37[11].m_uID) )
((void (__fastcall *)(cocos2d::CCObject *, _QWORD, cocos2d::CCArray *))v37->__vftable[4].update)(
v37,
0,
v10);
}
}
}
}
a1->m_hasChanged = 1;
if ( *((_QWORD *)&v44 + 1) > 0xFu )
{
v38 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v44 + 1) + 1LL) >= 0x1000 )
{
v38 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v38 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v38);
}
}
else
{
a1->setDisplayFrame(a1, a2);
}
}