//
// cocos2d::CCAnimationCache::parseVersion1 from 0x5e59d0 to 0x5e5b22 (338 bytes)
//
// 1 xrefs:
// > cocos2d::CCAnimationCache::addAnimationsWithDictionary @ 0x5e5e3c
//
// 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
//
void cocos2d::CCAnimationCache::parseVersion1(cocos2d::CCAnimationCache *a1, cocos2d::CCDictionary *a2)
{
cocos2d::CCDictElement *m_pElements; // r4
cocos2d::CCDictElement *next; // r5
int m_pObject; // r7
cocos2d::CCArray *v6; // r8
int v7; // r2
int v8; // r3
cocos2d::CCString *v9; // r0
cocos2d::CCArray *v10; // r0
unsigned int v11; // r1
cocos2d::CCArray *v12; // r7
cocos2d::ccArray *data; // r2
cocos2d::CCAnimation *v14; // r8
cocos2d::CCAnimationCache *v15; // r0
cocos2d::CCObject **arr; // r10
cocos2d::CCString *v17; // r0
cocos2d::CCString *v18; // t1
cocos2d::CCDictElement *v19; // r3
const char *CString; // r0
cocos2d::CCSpriteFrame *v21; // r1
cocos2d::CCAnimationFrame *v22; // r9
cocos2d::CCObject *v23; // r2
cocos2d::CCSpriteFrameCache *v24; // [sp+0h] [bp-2Ch]
cocos2d::CCObject **v25; // [sp+4h] [bp-28h]
cocos2d::CCSpriteFrame *v26; // [sp+14h] [bp-18h]
const char *v27; // [sp+20h] [bp-Ch] BYREF
v24 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( a2 )
{
m_pElements = a2->m_pElements;
if ( m_pElements )
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
else
next = nullptr;
while ( m_pElements )
{
m_pObject = (int)m_pElements->m_pObject;
sub_776584((int)&v27, "frames");
v6 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(m_pObject, &v27);
sub_774008(&v27);
sub_776584((int)&v27, "delay");
v9 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(m_pObject, &v27, v7, v8);
cocos2d::CCString::floatValue(v9);
sub_774008(&v27);
if ( v6 )
{
v10 = (cocos2d::CCArray *)cocos2d::CCArray::count(v6);
v12 = cocos2d::CCArray::createWithCapacity(v10, v11);
cocos2d::CCObject::retain(v12);
data = v6->data;
if ( data->num )
{
arr = data->arr;
v25 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v25 )
{
v18 = (cocos2d::CCString *)*arr++;
v17 = v18;
if ( !v18 )
break;
CString = cocos2d::CCString::getCString(v17);
v21 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v24, CString);
if ( v21 )
{
v26 = v21;
v22 = (cocos2d::CCAnimationFrame *)operator new(0x40u);
cocos2d::CCAnimationFrame::CCAnimationFrame(v22);
cocos2d::CCAnimationFrame::initWithSpriteFrame(v22, v26, 1.0, nullptr);
cocos2d::CCArray::addObject(v12, (cocos2d::_ccArray *)v22, v23);
cocos2d::CCObject::release(v22);
}
}
}
if ( cocos2d::CCArray::count(v12) )
{
cocos2d::CCArray::count(v12);
cocos2d::CCArray::count(v6);
v14 = cocos2d::CCAnimation::create();
v15 = cocos2d::CCAnimationCache::sharedAnimationCache();
cocos2d::CCAnimationCache::addAnimation(v15, v14, (const char *)m_pElements);
cocos2d::CCObject::release(v12);
}
}
if ( next )
v19 = (cocos2d::CCDictElement *)next->hh.next;
else
v19 = nullptr;
m_pElements = next;
next = v19;
}
}
}