//
// cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary from 0x1003bbff8 to 0x1003bc794 (1948 bytes)
//
// 1 xrefs:
// > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x1003bca64
//
// 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::CCSpriteFrameCache::addSpriteFramesWithDictionary(
cocos2d::CCSpriteFrameCache *a1,
cocos2d::CCDictionary *a2,
cocos2d::CCTexture2D *a3)
{
__int64 v6; // x21
__int64 v7; // x22
cocos2d::CCString *v8; // x0
__int64 v9; // x25
__int64 v10; // x1
__int64 v11; // x23
cocos2d::CCString *v12; // x0
const char *v13; // x0
cocos2d::CCString *v14; // x0
bool v15; // w24
cocos2d::CCString *v16; // x0
float v17; // s8
cocos2d::CCString *v18; // x0
float v19; // s9
cocos2d::CCString *v20; // x0
float v21; // s10
cocos2d::CCString *v22; // x0
float v23; // s11
cocos2d::CCString *v24; // x0
float v25; // s12
cocos2d::CCString *v26; // x0
float v27; // s13
cocos2d::CCString *v28; // x0
int v29; // w24
cocos2d::CCString *v30; // x0
int v31; // w23
unsigned int v32; // w28
char *v33; // x23
__n128 v34; // q0
__n128 v35; // q1
cocos2d::CCString *v36; // x0
const char *CString; // x0
cocos2d::CCString *v38; // x0
const char *v39; // x0
cocos2d::CCString *v40; // x0
const char *v41; // x0
cocos2d::CCString *v42; // x0
const char *v43; // x0
cocos2d::CCString *v44; // x0
bool v45; // w24
cocos2d::CCObject *v46; // x23
cocos2d::CCString *v47; // x0
const char *v48; // x0
cocos2d::CCString *v49; // x0
const char *v50; // x0
cocos2d::CCSize v51; // [xsp+8h] [xbp-D8h] BYREF
cocos2d::CCPoint v52; // [xsp+10h] [xbp-D0h] BYREF
cocos2d::CCRect v53; // [xsp+18h] [xbp-C8h] BYREF
cocos2d::CCPoint v54; // [xsp+28h] [xbp-B8h] BYREF
cocos2d::CCRect v55; // [xsp+30h] [xbp-B0h] BYREF
char v56; // [xsp+47h] [xbp-99h]
void *__p[2]; // [xsp+48h] [xbp-98h] BYREF
char v58; // [xsp+5Fh] [xbp-81h]
sub_100009900(__p, "metadata");
v6 = cocos2d::CCDictionary::objectForKey_1(a2, __p);
if ( v58 < 0 )
operator delete(__p[0]);
sub_100009900(__p, "frames");
v7 = cocos2d::CCDictionary::objectForKey_1(a2, __p);
if ( v58 < 0 )
{
operator delete(__p[0]);
if ( !v6 )
goto LABEL_8;
}
else if ( !v6 )
{
goto LABEL_8;
}
sub_100009900(__p, "format");
v8 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v6, __p);
LODWORD(v6) = cocos2d::CCString::intValue(v8);
if ( v58 < 0 )
{
operator delete(__p[0]);
if ( !v7 )
return;
goto LABEL_9;
}
LABEL_8:
if ( !v7 )
return;
LABEL_9:
v9 = *(_QWORD *)(v7 + 56);
while ( v9 )
{
while ( 1 )
{
v10 = v9;
v9 = *(_QWORD *)(v9 + 288);
v11 = *(_QWORD *)(v10 + 264);
sub_100009900(__p, (char *)v10);
if ( !cocos2d::CCDictionary::objectForKey_1(a1[1].__vftable, __p) )
{
if ( (_DWORD)v6 )
{
if ( (unsigned int)v6 > 2 )
{
if ( (_DWORD)v6 == 3 )
{
sub_100009900(&v55, "spriteSize");
v36 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
CString = cocos2d::CCString::getCString(v36);
cocos2d::CCSizeFromString(CString);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "spriteOffset");
v38 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v39 = cocos2d::CCString::getCString(v38);
cocos2d::CCPointFromString(v39);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "spriteSourceSize");
v40 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v41 = cocos2d::CCString::getCString(v40);
cocos2d::CCSizeFromString(v41);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "textureRect");
v42 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v43 = cocos2d::CCString::getCString(v42);
cocos2d::CCRectFromString(v43);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "textureRotated");
v44 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v45 = cocos2d::CCString::boolValue(v44);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "aliases");
cocos2d::CCDictionary::objectForKey_1(v11, &v55);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
v46 = (cocos2d::CCObject *)operator new(0x50u);
sub_100268B28((__int64)v46, (__int128 *)__p);
cocos2d::CCObject::release(v46);
v33 = (char *)operator new(0xB8u);
*((_QWORD *)v33 + 22) = 0;
*((_OWORD *)v33 + 9) = 0u;
*((_OWORD *)v33 + 10) = 0u;
*((_OWORD *)v33 + 7) = 0u;
*((_OWORD *)v33 + 8) = 0u;
*((_OWORD *)v33 + 5) = 0u;
*((_OWORD *)v33 + 6) = 0u;
*((_OWORD *)v33 + 3) = 0u;
*((_OWORD *)v33 + 4) = 0u;
*((_OWORD *)v33 + 1) = 0u;
*((_OWORD *)v33 + 2) = 0u;
*(_OWORD *)v33 = 0u;
cocos2d::CCObject::CCObject((__int64)v33);
*(_QWORD *)v33 = off_1007CE950;
sub_1000229B0((_QWORD *)v33 + 7);
sub_100022AF4((_QWORD *)v33 + 8);
sub_100022B90((_QWORD *)v33 + 9);
sub_100022B90(v33 + 92);
sub_1000229B0(v33 + 108);
sub_100022AF4(v33 + 116);
*(_OWORD *)(v33 + 168) = 0u;
*(_OWORD *)(v33 + 152) = 0u;
*(_OWORD *)(v33 + 136) = 0u;
sub_100022990((float *)&v55.origin, v53.origin.x, v53.origin.y, v54.x, v54.y);
cocos2d::CCSpriteFrame::initWithTexture((cocos2d::CCSpriteFrame *)v33, a3, &v55, v45, &v52, &v51);
}
else
{
v33 = nullptr;
}
}
else
{
sub_100009900(&v55, "frame");
v12 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v13 = cocos2d::CCString::getCString(v12);
cocos2d::CCRectFromString(v13);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
if ( (_DWORD)v6 == 2 )
{
sub_100009900(&v55, "rotated");
v14 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v15 = cocos2d::CCString::boolValue(v14);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
}
else
{
v15 = 0;
}
sub_100009900(&v55, "offset");
v47 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v48 = cocos2d::CCString::getCString(v47);
cocos2d::CCPointFromString(v48);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "sourceSize");
v49 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v50 = cocos2d::CCString::getCString(v49);
cocos2d::CCSizeFromString(v50);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
v33 = (char *)operator new(0xB8u);
*((_QWORD *)v33 + 22) = 0;
*((_OWORD *)v33 + 9) = 0u;
*((_OWORD *)v33 + 10) = 0u;
*((_OWORD *)v33 + 7) = 0u;
*((_OWORD *)v33 + 8) = 0u;
*((_OWORD *)v33 + 5) = 0u;
*((_OWORD *)v33 + 6) = 0u;
*((_OWORD *)v33 + 3) = 0u;
*((_OWORD *)v33 + 4) = 0u;
*((_OWORD *)v33 + 1) = 0u;
*((_OWORD *)v33 + 2) = 0u;
*(_OWORD *)v33 = 0u;
cocos2d::CCObject::CCObject((__int64)v33);
*(_QWORD *)v33 = off_1007CE950;
sub_1000229B0((_QWORD *)v33 + 7);
sub_100022AF4((_QWORD *)v33 + 8);
sub_100022B90((_QWORD *)v33 + 9);
sub_100022B90(v33 + 92);
sub_1000229B0(v33 + 108);
sub_100022AF4(v33 + 116);
*(_OWORD *)(v33 + 168) = 0u;
*(_OWORD *)(v33 + 152) = 0u;
*(_OWORD *)(v33 + 136) = 0u;
cocos2d::CCSpriteFrame::initWithTexture(
(cocos2d::CCSpriteFrame *)v33,
a3,
&v53,
v15,
&v54,
(const cocos2d::CCSize *)&v52);
}
}
else
{
sub_100009900(&v55, "x");
v16 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v17 = cocos2d::CCString::floatValue(v16);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "y");
v18 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v19 = cocos2d::CCString::floatValue(v18);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "width");
v20 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v21 = cocos2d::CCString::floatValue(v20);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "height");
v22 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v23 = cocos2d::CCString::floatValue(v22);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "offsetX");
v24 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v25 = cocos2d::CCString::floatValue(v24);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "offsetY");
v26 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v27 = cocos2d::CCString::floatValue(v26);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "originalWidth");
v28 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v29 = cocos2d::CCString::intValue(v28);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
sub_100009900(&v55, "originalHeight");
v30 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v11, &v55);
v31 = cocos2d::CCString::intValue(v30);
if ( v56 < 0 )
operator delete(*(void **)&v55.origin);
if ( v29 < 0 )
v29 = -v29;
if ( v31 >= 0 )
v32 = v31;
else
v32 = -v31;
v33 = (char *)operator new(0xB8u);
*((_QWORD *)v33 + 22) = 0;
*((_OWORD *)v33 + 9) = 0u;
*((_OWORD *)v33 + 10) = 0u;
*((_OWORD *)v33 + 7) = 0u;
*((_OWORD *)v33 + 8) = 0u;
*((_OWORD *)v33 + 5) = 0u;
*((_OWORD *)v33 + 6) = 0u;
*((_OWORD *)v33 + 3) = 0u;
*((_OWORD *)v33 + 4) = 0u;
*((_OWORD *)v33 + 1) = 0u;
*((_OWORD *)v33 + 2) = 0u;
*(_OWORD *)v33 = 0u;
cocos2d::CCObject::CCObject((__int64)v33);
*(_QWORD *)v33 = off_1007CE950;
sub_1000229B0((_QWORD *)v33 + 7);
sub_100022AF4((_QWORD *)v33 + 8);
sub_100022B90((_QWORD *)v33 + 9);
sub_100022B90(v33 + 92);
sub_1000229B0(v33 + 108);
sub_100022AF4(v33 + 116);
*(_OWORD *)(v33 + 168) = 0u;
*(_OWORD *)(v33 + 152) = 0u;
*(_OWORD *)(v33 + 136) = 0u;
sub_100022990((float *)&v55.origin, v17, v19, v21, v23);
v34.n128_f32[0] = v25;
v35.n128_f32[0] = v27;
sub_100022980(v34, v35, &v53);
sub_100022988((float *)&v54, (float)(unsigned int)v29, (float)v32);
cocos2d::CCSpriteFrame::initWithTexture(
(cocos2d::CCSpriteFrame *)v33,
a3,
&v55,
0,
&v53.origin,
(const cocos2d::CCSize *)&v54);
}
cocos2d::CCDictionary::setObject_1(a1[1].__vftable, v33, __p);
cocos2d::CCObject::release((cocos2d::CCObject *)v33);
}
if ( v58 < 0 )
break;
if ( !v9 )
return;
}
operator delete(__p[0]);
}
}