//
// cocos2d::CCAnimation::initWithSpriteFrames from 0x18008a050 to 0x18008a1bc (364 bytes)
//
// 3 xrefs:
// > cocos2d::CCAnimation::createWithSpriteFrames @ 0x180089e0f
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b5a24
//
// 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
char __fastcall cocos2d::CCAnimation::initWithSpriteFrames(
cocos2d::CCAnimation *this,
struct cocos2d::CCArray *a2,
float a3)
{
cocos2d::CCArray *v5; // rax
cocos2d::CCArray *v6; // rbx
cocos2d::CCArray *m_pFrames; // rcx
cocos2d::ccArray *data; // rsi
__int64 num; // rax
cocos2d::CCObject **arr; // rsi
cocos2d::CCObject **i; // r14
cocos2d::CCObject *v12; // rdi
cocos2d::CCObject *v13; // rax
cocos2d::CCObject *v14; // rbx
cocos2d::CCObject *v15; // rcx
cocos2d::CCObject *v16; // rcx
this->m_uLoops = 1;
this->m_fDelayPerUnit = a3;
v5 = cocos2d::CCArray::create();
v6 = v5;
if ( this->m_pFrames != v5 )
{
if ( v5 )
cocos2d::CCObject::retain(v5);
m_pFrames = this->m_pFrames;
if ( m_pFrames )
cocos2d::CCObject::release(m_pFrames);
this->m_pFrames = v6;
}
if ( a2 )
{
data = a2->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
v12 = *arr;
if ( !*arr )
break;
v13 = (cocos2d::CCObject *)operator new(0x50u);
v14 = v13;
if ( v13 )
{
cocos2d::CCObject::CCObject(v13);
v14->__vftable = (cocos2d::CCObject_vtbl *)&cocos2d::CCAnimationFrame::`vftable';
v14[1].__vftable = nullptr;
v14[1].m_uID = 0;
*(_QWORD *)&v14[1].m_nTag = 0;
v14->m_eObjType = LevelEditorLayerObjectType|0x8;
}
else
{
v14 = nullptr;
}
if ( (cocos2d::CCObject *)v14[1].__vftable != v12 )
{
cocos2d::CCObject::retain(v12);
v15 = (cocos2d::CCObject *)v14[1].__vftable;
if ( v15 )
cocos2d::CCObject::release(v15);
v14[1].__vftable = (cocos2d::CCObject_vtbl *)v12;
}
v14[1].m_uID = 1065353216;
v16 = *(cocos2d::CCObject **)&v14[1].m_nTag;
if ( v16 )
{
cocos2d::CCObject::release(v16);
*(_QWORD *)&v14[1].m_nTag = 0;
}
cocos2d::CCArray::addObject(this->m_pFrames, v14);
cocos2d::CCObject::release(v14);
this->m_fTotalDelayUnits = this->m_fTotalDelayUnits + 1.0;
}
}
}
return 1;
}