//
// cocos2d::CCAnimationCache::addAnimationsWithDictionary from 0x10046dbf0 to 0x10046ddef (511 bytes)
//
// 1 xrefs:
// > cocos2d::CCAnimationCache::addAnimationsWithFile @ 0x10046de4f
//
// 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::addAnimationsWithDictionary(
cocos2d::CCAnimationCache *a1,
cocos2d::CCDictionary *a2,
const char *a3)
{
cocos2d::CCDictionary *v4; // rbx
cocos2d::CCAnimationCache *v5; // rdi
__int64 v6; // r12
cocos2d::CCString *v7; // rax
int v8; // r15d
__int64 v9; // r12
unsigned int *v10; // rax
cocos2d::CCString **v11; // r15
unsigned __int64 v12; // rbx
cocos2d::CCString *v13; // r12
cocos2d::CCFileUtils *v14; // r13
const char *CString; // rax
const char *v16; // r12
cocos2d::CCSpriteFrameCache *v17; // r12
const char *v18; // rax
cocos2d::CCString *v19; // r14
cocos2d::CCDictionary *v20; // [rsp+0h] [rbp-50h]
int v21; // [rsp+Ch] [rbp-44h]
char v22; // [rsp+10h] [rbp-40h] BYREF
char v23[15]; // [rsp+11h] [rbp-3Fh] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v22 = 20;
strcpy(v23, "animations");
v4 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey_1((__int64)a2, &v22);
if ( (v22 & 1) != 0 )
operator delete(__p);
if ( v4 )
{
v22 = 20;
strcpy(v23, "properties");
v5 = (cocos2d::CCAnimationCache *)a2;
v6 = cocos2d::CCDictionary::objectForKey_1((__int64)a2, &v22);
if ( (v22 & 1) != 0 )
{
v5 = (cocos2d::CCAnimationCache *)__p;
operator delete(__p);
}
if ( !v6 )
{
LABEL_21:
cocos2d::CCAnimationCache::parseVersion1(v5, v4);
return;
}
v22 = 12;
strcpy(v23, "format");
v7 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v6, (__int64)&v22);
v8 = cocos2d::CCString::intValue(v7);
if ( (v22 & 1) != 0 )
operator delete(__p);
v21 = v8;
v22 = 24;
strcpy(v23, "spritesheets");
v5 = (cocos2d::CCAnimationCache *)v6;
v9 = cocos2d::CCDictionary::objectForKey_1(v6, &v22);
v20 = v4;
if ( (v22 & 1) != 0 )
{
v5 = (cocos2d::CCAnimationCache *)__p;
operator delete(__p);
}
if ( v9 )
{
v10 = *(unsigned int **)(v9 + 56);
if ( *v10 )
{
v11 = *((cocos2d::CCString ***)v10 + 2);
v12 = (unsigned __int64)&v11[*v10 - 1];
if ( a3 )
{
do
{
v13 = *v11;
if ( !*v11 )
break;
v14 = cocos2d::CCFileUtils::sharedFileUtils();
CString = cocos2d::CCString::getCString(v13);
v16 = (const char *)((__int64 (__fastcall *)(cocos2d::CCFileUtils *, const char *, const char *))v14->getFileData)(
v14,
CString,
a3);
v5 = (cocos2d::CCAnimationCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_2((cocos2d::CCSpriteFrameCache *)v5, v16);
++v11;
}
while ( (unsigned __int64)v11 <= v12 );
}
else
{
do
{
v19 = *v11;
if ( !*v11 )
break;
v17 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v18 = cocos2d::CCString::getCString(v19);
v5 = (cocos2d::CCAnimationCache *)v17;
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile_2(v17, v18);
++v11;
}
while ( (unsigned __int64)v11 <= v12 );
}
}
}
if ( v21 != 2 )
{
v4 = v20;
if ( v21 != 1 )
return;
goto LABEL_21;
}
cocos2d::CCAnimationCache::parseVersion2(v5, v20);
}
}