//
// cocos2d::CCAnimation::initWithSpriteFrames from 0xb132dc to 0xb133dc (256 bytes)
//
// 3 xrefs:
// > cocos2d::CCAnimation::init @ 0xb133e4
// > cocos2d::CCAnimation::createWithSpriteFrames @ 0xb13550
// > ??> @ 0x882f0
//
// 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; // x0
cocos2d::CCArray *v6; // x20
cocos2d::CCArray *m_pFrames; // x2
cocos2d::ccArray *data; // x1
cocos2d::CCObject **arr; // x21
__int64 v10; // x0
char *v11; // x22
cocos2d::CCSpriteFrame *i; // x1
cocos2d::CCAnimationFrame *v13; // x20
cocos2d::CCObject *v14; // x2
cocos2d::CCSpriteFrame *v16; // [xsp+48h] [xbp+48h]
a1->m_fDelayPerUnit = a3;
a1->m_uLoops = (unsigned int)&dword_0 + 1;
v5 = cocos2d::CCArray::create((cocos2d::CCArray *)((char *)&dword_0 + 1));
v6 = v5;
m_pFrames = a1->m_pFrames;
if ( v5 != m_pFrames )
{
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 = 8LL * data->num - 8;
v11 = (char *)arr + v10;
if ( arr <= (cocos2d::CCObject **)((char *)arr + v10) )
{
for ( i = (cocos2d::CCSpriteFrame *)*arr; *arr; i = (cocos2d::CCSpriteFrame *)*arr )
{
v16 = i;
++arr;
v13 = (cocos2d::CCAnimationFrame *)operator new(0x50u);
cocos2d::CCAnimationFrame::CCAnimationFrame(v13);
cocos2d::CCAnimationFrame::initWithSpriteFrame(v13, v16, 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;
if ( v11 < (char *)arr )
break;
}
}
}
}
return 1;
}