//
// CCPartAnimSprite::initWithAnimDesc from 0x3c7a28 to 0x3c7d3e (790 bytes)
//
// 1 xrefs:
// > CCPartAnimSprite::createWithAnimDesc @ 0x3c7dbc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:46:35 +0000
//
cocos2d::CCArray *__fastcall CCPartAnimSprite::initWithAnimDesc(
cocos2d::CCArray **this,
const char *a2,
cocos2d::CCTexture2D *a3,
int a4)
{
cocos2d::CCArray *v6; // r0
cocos2d::CCObject *v7; // r0
cocos2d::CCDictionary *v8; // r0
cocos2d::CCObject *v9; // r0
CCAnimateFrameCache *v10; // r0
CCAnimateFrameCache *v11; // r0
int v12; // r2
int v13; // r3
cocos2d::CCObject *v14; // r0
cocos2d::CCObject *v15; // r6
cocos2d::CCDictionary *v16; // r9
unsigned int i; // r7
int v18; // r6
size_t v19; // r0
int v20; // r8
cocos2d::CCString *v21; // r0
const char *CString; // r10
size_t v23; // r0
cocos2d::CCString *v24; // r0
int v25; // r10
_BOOL4 v26; // r11
cocos2d::CCTexture2D *v27; // r1
int v28; // r2
CCSpritePart *v29; // r0
unsigned __int8 *v30; // r5
int v31; // r11
cocos2d::CCString *v32; // r11
int v33; // r8
const char *v34; // r11
size_t v35; // r0
cocos2d::CCArray *v37; // [sp+0h] [bp-2A4h]
int v40[3]; // [sp+30h] [bp-274h] BYREF
int v41[2]; // [sp+3Ch] [bp-268h] BYREF
CCSpritePart *v42; // [sp+44h] [bp-260h]
int v43[3]; // [sp+48h] [bp-25Ch] BYREF
int v44[3]; // [sp+54h] [bp-250h] BYREF
int v45[3]; // [sp+60h] [bp-244h] BYREF
int v46[3]; // [sp+6Ch] [bp-238h] BYREF
int v47[3]; // [sp+78h] [bp-22Ch] BYREF
int v48[3]; // [sp+84h] [bp-220h] BYREF
int v49[3]; // [sp+90h] [bp-214h] BYREF
int v50; // [sp+9Ch] [bp-208h] BYREF
unsigned int v51; // [sp+A0h] [bp-204h]
void *v52; // [sp+A4h] [bp-200h]
_BYTE v53[500]; // [sp+A8h] [bp-1FCh] BYREF
v6 = (cocos2d::CCArray *)cocos2d::CCSprite::initWithTexture(
(cocos2d::CCSprite *)this,
a3,
(const cocos2d::CCRect *)&unk_D2A544);
v37 = v6;
if ( v6 )
{
v7 = (cocos2d::CCObject *)cocos2d::CCArray::create(v6);
*(this + 132) = v7;
v8 = (cocos2d::CCDictionary *)cocos2d::CCObject::retain(v7);
v9 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v8);
*(this + 127) = v9;
v10 = (CCAnimateFrameCache *)cocos2d::CCObject::retain(v9);
v11 = (CCAnimateFrameCache *)CCAnimateFrameCache::sharedSpriteFrameCache(v10);
v14 = CCAnimateFrameCache::addSpriteFramesWithFile(v11, a2, v12, v13);
*((_BYTE *)this + 516) = 1;
v50 = 0;
v51 = 0;
v52 = nullptr;
v15 = v14;
std::string::__init(&v50, "usedTextures", 0xCu);
v16 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(v15, &v50);
std::string::~string((int)&v50);
for ( i = 0; i < cocos2d::CCDictionary::count(v16); ++i )
{
v50 = 0;
v51 = 500;
v52 = v53;
qmemcpy((void *)fmt::BasicWriter::GrowBuffer((unsigned int *)&v50, 8), "texture_", 8);
fmt::BasicWriter::FormatInt,char>>(
(unsigned int *)&v50,
i);
v18 = v50;
if ( v50 + 1 > v51 )
fmt::internal::Array::grow((int)&v50, v50 + 1);
*((_BYTE *)v52 + v18) = 0;
memset(v40, 0, sizeof(v40));
v19 = strlen((const char *)v52);
std::string::__init(v40, v52, v19);
v20 = cocos2d::CCDictionary::objectForKey(v16, v40);
std::string::~string((int)v40);
memset(v43, 0, sizeof(v43));
std::string::__init(v43, "texture", 7u);
v21 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v20, v43);
CString = (const char *)cocos2d::CCString::getCString(v21);
v41[0] = 0;
v41[1] = 0;
v42 = nullptr;
v23 = strlen(CString);
std::string::__init(v41, CString, v23);
std::string::~string((int)v43);
memset(v44, 0, sizeof(v44));
std::string::__init(v44, "tag", 3u);
v24 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v20, v44);
v25 = cocos2d::CCString::intValue(v24);
std::string::~string((int)v44);
memset(v45, 0, sizeof(v45));
std::string::__init(v45, "0", 1u);
v26 = sub_3C6FE4((unsigned __int8 *)v41, (unsigned __int8 *)v45);
std::string::~string((int)v45);
if ( a4 || v26 )
{
v30 = (unsigned __int8 *)CCSpritePart::create(a3, v27);
if ( !v26 && a4 )
{
std::string::basic_string(v46, (int)v41);
std::string::operator=(v30 + 520, (unsigned __int8 *)v46);
std::string::~string((int)v46);
}
}
else
{
if ( (v41[0] & 1) != 0 )
v29 = v42;
else
v29 = (CCSpritePart *)((char *)v41 + 1);
v30 = (unsigned __int8 *)CCSpritePart::createWithSpriteFrameName(
v29,
(const char *)v27,
v28,
LOBYTE(v41[0]) << 31);
}
(*(void (__fastcall **)(unsigned __int8 *, int))(*(_DWORD *)v30 + 36))(v30, v25);
memset(v47, 0, sizeof(v47));
std::string::__init(v47, "customID", 8u);
v31 = cocos2d::CCDictionary::objectForKey(v20, v47);
std::string::~string((int)v47);
if ( v31 )
{
memset(v48, 0, sizeof(v48));
std::string::__init(v48, "customID", 8u);
v32 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v20, v48);
std::string::~string((int)v48);
v33 = (int)*(this + 127);
v34 = (const char *)cocos2d::CCString::getCString(v32);
memset(v49, 0, sizeof(v49));
v35 = strlen(v34);
std::string::__init(v49, v34, v35);
cocos2d::CCDictionary::setObject(v33, (cocos2d::CCObject *)v30);
std::string::~string((int)v49);
}
cocos2d::CCArray::addObject(*(this + 132), (cocos2d::CCObject *)v30);
(*((void (__fastcall **)(cocos2d::CCArray **, unsigned __int8 *, _DWORD, int))*this + 59))(this, v30, 0, v25);
(*(void (__fastcall **)(unsigned __int8 *, _DWORD))(*(_DWORD *)v30 + 172))(v30, 0);
std::string::~string((int)v41);
if ( v52 != v53 )
{
if ( v52 )
operator delete[](v52);
}
}
}
return v37;
}