//
// cocos2d::CCAnimation::initWithSpriteFrames from 0x5e55b4 to 0x5e5648 (148 bytes)
//
// 2 xrefs:
// > cocos2d::CCAnimation::init @ 0x5e564c
// > cocos2d::CCAnimation::createWithSpriteFrames @ 0x5e570e
//
// 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
//
bool cocos2d::CCAnimation::initWithSpriteFrames(cocos2d::CCAnimation *a1, cocos2d::CCArray *a2, float a3)
{
cocos2d::CCArray *v5; // r0
cocos2d::CCArray *v6; // r5
cocos2d::CCArray *m_pFrames; // r0
cocos2d::ccArray *data; // r2
cocos2d::CCObject **arr; // r6
cocos2d::CCObject **v10; // r5
cocos2d::CCSpriteFrame *v11; // r8
cocos2d::CCSpriteFrame *v12; // t1
cocos2d::CCAnimationFrame *v13; // r7
cocos2d::CCObject *v14; // r2
a1->m_uLoops = 1;
a1->m_fDelayPerUnit = a3;
v5 = cocos2d::CCArray::create((cocos2d::CCArray *)a1);
v6 = v5;
if ( a1->m_pFrames != v5 )
{
if ( v5 )
cocos2d::CCObject::retain(v5);
m_pFrames = a1->m_pFrames;
if ( m_pFrames )
cocos2d::CCObject::release(m_pFrames);
a1->m_pFrames = v6;
}
if ( a2 )
{
data = a2->data;
if ( data->num )
{
arr = data->arr;
v10 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v10 )
{
v12 = (cocos2d::CCSpriteFrame *)*arr++;
v11 = v12;
if ( !v12 )
break;
v13 = (cocos2d::CCAnimationFrame *)operator new(0x40u);
cocos2d::CCAnimationFrame::CCAnimationFrame(v13);
cocos2d::CCAnimationFrame::initWithSpriteFrame(v13, v11, 1.0, nullptr);
cocos2d::CCArray::addObject(a1->m_pFrames, (cocos2d::_ccArray *)v13, v14);
cocos2d::CCObject::release(v13);
a1->m_fTotalDelayUnits = a1->m_fTotalDelayUnits + 1.0;
}
}
}
return 1;
}