//
// cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary from 0x5e9060 to 0x5e951c (1212 bytes)
//
// 2 xrefs:
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x5e9592
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x5e9af2
//
// 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::CCSpriteFrameCache::addSpriteFramesWithDictionary(
cocos2d::CCSpriteFrameCache *a1,
cocos2d::CCDictionary *a2,
cocos2d::CCTexture2D *a3)
{
int v4; // r6
int v5; // r7
int v6; // r2
int v7; // r3
cocos2d::CCString *v8; // r0
int v9; // r9
int v10; // r1
int v11; // r10
int v12; // r5
cocos2d::CCSpriteFrame *v13; // r6
int v14; // r2
int v15; // r3
cocos2d::CCString *v16; // r0
int v17; // r2
int v18; // r3
cocos2d::CCString *v19; // r0
int v20; // r2
int v21; // r3
cocos2d::CCString *v22; // r0
float v23; // r11
int v24; // r2
int v25; // r3
cocos2d::CCString *v26; // r0
int v27; // r2
int v28; // r3
cocos2d::CCString *v29; // r0
int v30; // r2
int v31; // r3
cocos2d::CCString *v32; // r0
int v33; // r2
int v34; // r3
cocos2d::CCString *v35; // r0
int v36; // r8
int v37; // r2
int v38; // r3
cocos2d::CCString *v39; // r0
int v40; // r5
int v41; // r2
int v42; // r3
cocos2d::CCString *v43; // r0
const char *v44; // r0
int v45; // r2
int v46; // r3
cocos2d::CCString *v47; // r0
bool v48; // r4
int v49; // r2
int v50; // r3
cocos2d::CCString *v51; // r0
const char *v52; // r0
int v53; // r2
int v54; // r3
cocos2d::CCString *v55; // r0
const char *v56; // r0
int v57; // r2
int v58; // r3
cocos2d::CCString *v59; // r0
const char *CString; // r0
int v61; // r2
int v62; // r3
cocos2d::CCString *v63; // r0
const char *v64; // r0
int v65; // r2
int v66; // r3
cocos2d::CCString *v67; // r0
const char *v68; // r0
int v69; // r2
int v70; // r3
cocos2d::CCString *v71; // r0
const char *v72; // r0
int v73; // r2
int v74; // r3
cocos2d::CCString *v75; // r0
cocos2d::CCObject *v76; // r5
int v77; // r3
float v80; // [sp+10h] [bp-7Ch]
bool v81; // [sp+10h] [bp-7Ch]
float v82; // [sp+14h] [bp-78h]
float v83; // [sp+18h] [bp-74h]
float v84; // [sp+38h] [bp-54h]
float v85; // [sp+3Ch] [bp-50h]
const char *v86; // [sp+48h] [bp-44h] BYREF
cocos2d::CCSize v87; // [sp+4Ch] [bp-40h] BYREF
cocos2d::CCPoint v88; // [sp+54h] [bp-38h] BYREF
cocos2d::CCPoint v89; // [sp+5Ch] [bp-30h] BYREF
cocos2d::CCRect v90; // [sp+64h] [bp-28h] BYREF
cocos2d::CCRect v91; // [sp+74h] [bp-18h] BYREF
sub_776584((int)&v91, "metadata");
v4 = cocos2d::CCDictionary::objectForKey((int)a2, (const char **)&v91);
sub_774008(&v91);
sub_776584((int)&v91, "frames");
v5 = cocos2d::CCDictionary::objectForKey((int)a2, (const char **)&v91);
sub_774008(&v91);
if ( v4 )
{
sub_776584((int)&v91, "format");
v8 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v4, (const char **)&v91, v6, v7);
v9 = cocos2d::CCString::intValue(v8);
sub_774008(&v91);
}
else
{
v9 = 0;
}
if ( v5 )
{
v10 = *(_DWORD *)(v5 + 52);
if ( v10 )
v11 = *(_DWORD *)(v10 + 272);
else
v11 = 0;
while ( v10 )
{
v12 = *(_DWORD *)(v10 + 260);
sub_776584((int)&v86, (char *)v10);
v13 = (cocos2d::CCSpriteFrame *)cocos2d::CCDictionary::objectForKey((int)a1[1].__vftable, &v86);
if ( !v13 )
{
if ( v9 )
{
if ( (unsigned int)(v9 - 1) > 1 )
{
if ( v9 == 3 )
{
sub_776584((int)&v91, "spriteSize");
v59 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v57, v58);
CString = cocos2d::CCString::getCString(v59);
cocos2d::CCSizeFromString(&v87, CString);
sub_774008(&v91);
sub_776584((int)&v91, "spriteOffset");
v63 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v61, v62);
v64 = cocos2d::CCString::getCString(v63);
cocos2d::CCPointFromString(&v88, v64);
sub_774008(&v91);
sub_776584((int)&v91, "spriteSourceSize");
v67 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v65, v66);
v68 = cocos2d::CCString::getCString(v67);
cocos2d::CCSizeFromString((cocos2d::CCSize *)&v89, v68);
sub_774008(&v91);
sub_776584((int)&v91, "textureRect");
v71 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v69, v70);
v72 = cocos2d::CCString::getCString(v71);
cocos2d::CCRectFromString(&v90, v72);
sub_774008(&v91);
sub_776584((int)&v91, "textureRotated");
v75 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v73, v74);
v81 = cocos2d::CCString::boolValue(v75);
sub_774008(&v91);
sub_776584((int)&v91, "aliases");
cocos2d::CCDictionary::objectForKey(v12, (const char **)&v91);
sub_774008(&v91);
v76 = (cocos2d::CCObject *)operator new(0x38u);
cocos2d::CCString::CCString(v76);
cocos2d::CCObject::release(v76);
v13 = (cocos2d::CCSpriteFrame *)operator new(0x84u);
memset(v13, 0, sizeof(cocos2d::CCSpriteFrame));
cocos2d::CCSpriteFrame::CCSpriteFrame(v13);
cocos2d::CCRect::CCRect(&v91, v90.origin.x, v90.origin.y, v87.width, v87.height);
cocos2d::CCSpriteFrame::initWithTexture(v13, a3, &v91, v81, &v88, (const cocos2d::CCSize *)&v89);
}
}
else
{
sub_776584((int)&v90, "frame");
v43 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v90, v41, v42);
v44 = cocos2d::CCString::getCString(v43);
cocos2d::CCRectFromString(&v91, v44);
sub_774008(&v90);
if ( v9 == 2 )
{
sub_776584((int)&v90, "rotated");
v47 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v90, v45, v46);
v48 = cocos2d::CCString::boolValue(v47);
sub_774008(&v90);
}
else
{
v48 = 0;
}
sub_776584((int)&v90, "offset");
v51 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v90, v49, v50);
v52 = cocos2d::CCString::getCString(v51);
cocos2d::CCPointFromString(&v89, v52);
sub_774008(&v90);
sub_776584((int)&v88, "sourceSize");
v55 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v88, v53, v54);
v56 = cocos2d::CCString::getCString(v55);
cocos2d::CCSizeFromString((cocos2d::CCSize *)&v90, v56);
sub_774008(&v88);
v13 = (cocos2d::CCSpriteFrame *)operator new(0x84u);
memset(v13, 0, sizeof(cocos2d::CCSpriteFrame));
cocos2d::CCSpriteFrame::CCSpriteFrame(v13);
cocos2d::CCSpriteFrame::initWithTexture(v13, a3, &v91, v48, &v89, (const cocos2d::CCSize *)&v90);
}
}
else
{
sub_776584((int)&v91, "x");
v16 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v14, v15);
v80 = cocos2d::CCString::floatValue(v16);
sub_774008(&v91);
sub_776584((int)&v91, "y");
v19 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v17, v18);
v85 = cocos2d::CCString::floatValue(v19);
sub_774008(&v91);
sub_776584((int)&v91, "width");
v22 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v20, v21);
v23 = cocos2d::CCString::floatValue(v22);
sub_774008(&v91);
sub_776584((int)&v91, "height");
v26 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v24, v25);
v84 = cocos2d::CCString::floatValue(v26);
sub_774008(&v91);
sub_776584((int)&v91, "offsetX");
v29 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v27, v28);
v82 = cocos2d::CCString::floatValue(v29);
sub_774008(&v91);
sub_776584((int)&v91, "offsetY");
v32 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v30, v31);
v83 = cocos2d::CCString::floatValue(v32);
sub_774008(&v91);
sub_776584((int)&v91, "originalWidth");
v35 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v33, v34);
v36 = cocos2d::CCString::intValue(v35);
sub_774008(&v91);
sub_776584((int)&v91, "originalHeight");
v39 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v12, (const char **)&v91, v37, v38);
v40 = cocos2d::CCString::intValue(v39);
sub_774008(&v91);
v13 = (cocos2d::CCSpriteFrame *)operator new(0x84u);
memset(v13, 0, sizeof(cocos2d::CCSpriteFrame));
cocos2d::CCSpriteFrame::CCSpriteFrame(v13);
cocos2d::CCRect::CCRect(&v91, v80, v85, v23, v84);
cocos2d::CCPoint::CCPoint(&v89, v82, v83);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v90, (float)(int)abs32(v36), (float)(int)abs32(v40));
cocos2d::CCSpriteFrame::initWithTexture(v13, a3, &v91, 0, &v89, (const cocos2d::CCSize *)&v90);
}
cocos2d::CCDictionary::setObject((int)a1[1].__vftable, v13, &v86);
cocos2d::CCObject::release(v13);
}
sub_774008(&v86);
if ( v11 )
v77 = *(_DWORD *)(v11 + 272);
else
v77 = 0;
v10 = v11;
v11 = v77;
}
}
}