//
// cocos2d::CCAnimationCache::parseVersion2 from 0x10046d7c0 to 0x10046dba0 (992 bytes)
//
// 1 xrefs:
// > cocos2d::CCAnimationCache::addAnimationsWithDictionary @ 0x10046dddb
//
// 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 __fastcall cocos2d::CCAnimationCache::parseVersion2(cocos2d::CCAnimationCache *a1, cocos2d::CCDictionary *a2)
{
cocos2d::CCDictElement *m_pElements; // r15
cocos2d::CCDictElement *next; // r13
__int64 m_pObject; // rdi
cocos2d::CCString *v5; // rax
__int64 v6; // rbx
unsigned int v7; // eax
unsigned int *v8; // rax
__int64 *v9; // r13
cocos2d::CCAnimationFrame *v10; // r14
__int64 v11; // r15
cocos2d::CCString *v12; // rax
const char *CString; // rbx
cocos2d::CCSpriteFrame *v14; // rax
cocos2d::CCSpriteFrame *v15; // rbx
cocos2d::CCString *v16; // rax
cocos2d::CCDictionary *v17; // r15
cocos2d::CCString *v18; // rax
cocos2d::CCAnimation *v19; // r13
unsigned int v20; // edx
cocos2d::CCAnimationCache *v21; // rdi
_QWORD *v22; // r14
void *v23; // r15
__int64 *v24; // [rsp+8h] [rbp-88h]
cocos2d::CCSpriteFrameCache *v25; // [rsp+10h] [rbp-80h]
cocos2d::CCString *v26; // [rsp+18h] [rbp-78h]
const char *v27; // [rsp+20h] [rbp-70h]
cocos2d::CCDictElement *v28; // [rsp+28h] [rbp-68h]
cocos2d::CCArray *v29; // [rsp+30h] [rbp-60h]
float v30; // [rsp+44h] [rbp-4Ch]
float v31; // [rsp+44h] [rbp-4Ch]
void *v32[3]; // [rsp+48h] [rbp-48h] BYREF
bool v33; // [rsp+67h] [rbp-29h]
v25 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( a2 )
{
m_pElements = a2->m_pElements;
if ( m_pElements )
{
do
{
m_pObject = (__int64)m_pElements->m_pObject;
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
strcpy((char *)v32, "\nloops");
v26 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(m_pObject, (__int64)v32);
if ( ((__int64)v32[0] & 1) != 0 )
operator delete(v32[2]);
strcpy((char *)v32, "(restoreOriginalFrame");
v5 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(m_pObject, (__int64)v32);
v33 = cocos2d::CCString::boolValue(v5);
if ( ((__int64)v32[0] & 1) != 0 )
operator delete(v32[2]);
LOBYTE(v32[0]) = 12;
strcpy((char *)v32 + 1, "frames");
v6 = cocos2d::CCDictionary::objectForKey_1(m_pObject, (char *)v32);
if ( ((__int64)v32[0] & 1) != 0 )
operator delete(v32[2]);
if ( v6 )
{
v28 = next;
v27 = (const char *)m_pElements;
v7 = sub_100720070(v6);
v29 = (cocos2d::CCArray *)sub_10071FD00(v7);
cocos2d::CCObject::retain(v29);
v8 = *(unsigned int **)(v6 + 56);
if ( *v8 )
{
v9 = *((__int64 **)v8 + 2);
v24 = &v9[*v8 - 1];
do
{
v11 = *v9;
if ( !*v9 )
break;
LOBYTE(v32[0]) = 22;
strcpy((char *)v32 + 1, "spriteframe");
v12 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, (__int64)v32);
CString = cocos2d::CCString::getCString(v12);
if ( ((__int64)v32[0] & 1) != 0 )
operator delete(v32[2]);
v14 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v25, CString);
if ( v14 )
{
v15 = v14;
LOBYTE(v32[0]) = 20;
strcpy((char *)v32 + 1, "delayUnits");
v16 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, (__int64)v32);
v30 = cocos2d::CCString::floatValue(v16);
if ( ((__int64)v32[0] & 1) != 0 )
operator delete(v32[2]);
LOBYTE(v32[0]) = 24;
strcpy((char *)v32 + 1, "notification");
v17 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey_1(v11, (char *)v32);
if ( ((__int64)v32[0] & 1) != 0 )
operator delete(v32[2]);
v10 = (cocos2d::CCAnimationFrame *)operator new(0x50u);
cocos2d::CCAnimationFrame::CCAnimationFrame((__int64)v10);
cocos2d::CCAnimationFrame::initWithSpriteFrame(v10, v15, v30, v17);
sub_10071FCD0(v29, v10);
cocos2d::CCObject::release(v10);
}
++v9;
}
while ( v9 <= v24 );
}
LOBYTE(v32[0]) = 24;
strcpy((char *)v32 + 1, "delayPerUnit");
v18 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(m_pObject, (__int64)v32);
v31 = cocos2d::CCString::floatValue(v18);
if ( ((__int64)v32[0] & 1) != 0 )
operator delete(v32[2]);
v19 = (cocos2d::CCAnimation *)operator new(0x58u);
sub_100296840((__int64)v19);
if ( cocos2d::CCString::length(v26) )
v20 = cocos2d::CCString::intValue(v26);
else
v20 = 1;
cocos2d::CCAnimation::initWithAnimationFrames(v19, v29, v31, v20);
cocos2d::CCObject::release(v29);
v19->m_bRestoreOriginalFrame = v33;
v21 = (cocos2d::CCAnimationCache *)qword_1009A4FA8;
if ( !qword_1009A4FA8 )
{
v22 = operator new(0x40u);
cocos2d::CCObject::CCObject(v22);
*v22 = off_100939850;
v22[7] = 0;
qword_1009A4FA8 = (__int64)v22;
v23 = operator new(0x48u);
cocos2d::CCDictionary::CCDictionary((__int64)v23);
v22[7] = v23;
v21 = (cocos2d::CCAnimationCache *)qword_1009A4FA8;
}
cocos2d::CCAnimationCache::addAnimation(v21, v19, v27);
cocos2d::CCObject::release(v19);
next = v28;
}
m_pElements = next;
}
while ( next );
}
}
}