//
// CCAnimatedSprite::loadType from 0x3c3834 to 0x3c3b94 (864 bytes)
//
// 1 xrefs:
// > CCAnimatedSprite::initWithType @ 0x3c3c7c
//
// 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:32 +0000
//
int __fastcall CCAnimatedSprite::loadType(
CCAnimatedSprite *this,
const char *a2,
cocos2d::CCTexture2D *a3,
cocos2d::CCTexture2D *a4)
{
size_t v7; // r0
_BOOL4 v8; // r7
int result; // r0
ObjectManager *v10; // r0
ObjectManager *v11; // r0
int Definition; // r9
cocos2d::CCString *v13; // r6
const char *CString; // r0
const char *v15; // r6
size_t v16; // r0
cocos2d::CCTextureCache *v17; // r0
cocos2d::CCTextureCache *v18; // r0
char *v19; // r1
cocos2d::CCString *v20; // r7
cocos2d::CCString *v21; // r10
cocos2d::CCString *v22; // r0
char *v23; // r0
const cocos2d::CCRect *v24; // r2
int v25; // r0
int v26; // r11
void (__fastcall *v27)(int, _BYTE *); // r10
float v28; // s16
int v29; // r0
cocos2d::CCString *v30; // r0
CCPartAnimSprite *v31; // r9
bool v32; // r3
int v33; // r0
int v34; // r6
void (__fastcall *v35)(int, _BYTE *); // r9
float v36; // s16
int v37; // r0
size_t v38; // r0
int v39; // r0
int v40; // r0
int v41; // r5
bool v42; // nf
size_t v43; // r0
int v44; // [sp+Ch] [bp-30h]
int v46; // [sp+18h] [bp-24h] BYREF
int v47; // [sp+1Ch] [bp-20h]
char *v48; // [sp+20h] [bp-1Ch]
_BYTE v49[16]; // [sp+24h] [bp-18h] BYREF
v46 = 0;
v47 = 0;
v48 = nullptr;
v7 = strlen(a2);
std::string::__init(&v46, a2, v7);
v8 = sub_3C3480((unsigned __int8 *)this + 508, (unsigned __int8 *)&v46);
result = std::string::~string((int)&v46);
if ( !v8 )
{
v10 = (ObjectManager *)CCAnimatedSprite::cleanupSprite(this);
v11 = (ObjectManager *)ObjectManager::instance(v10);
Definition = ObjectManager::getDefinition(v11, a2);
if ( !a3 )
{
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "spriteSheet", 0xBu);
v13 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(Definition, &v46);
std::string::~string((int)&v46);
CString = (const char *)cocos2d::CCString::getCString(v13);
v46 = 0;
v47 = 0;
v48 = nullptr;
v15 = CString;
v16 = strlen(CString);
std::string::__init(&v46, v15, v16);
v17 = (cocos2d::CCTextureCache *)std::string::append(&v46, ".png");
v18 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v17);
if ( (v46 & 1) != 0 )
v19 = v48;
else
v19 = (char *)&v46 + 1;
a3 = (cocos2d::CCTexture2D *)cocos2d::CCTextureCache::addImage(v18, v19, 0);
std::string::~string((int)&v46);
}
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "useFBF", 6u);
v20 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(Definition, &v46);
std::string::~string((int)&v46);
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "usePA", 5u);
v21 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(Definition, &v46);
std::string::~string((int)&v46);
if ( v20 )
v20 = (cocos2d::CCString *)cocos2d::CCString::boolValue(v20);
if ( v21 )
v44 = cocos2d::CCString::boolValue(v21);
else
v44 = 0;
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "defaultAnimation", 0x10u);
v22 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(Definition, &v46);
v23 = (char *)cocos2d::CCString::getCString(v22);
std::string::assign((int *)this + 138, v23);
std::string::~string((int)&v46);
if ( v20 )
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v49, 0.0, 0.0, 0.0, 0.0);
v25 = cocos2d::CCSprite::createWithTexture(a3, (cocos2d::CCTexture2D *)v49, v24);
*((_DWORD *)this + 135) = v25;
v26 = v25;
v27 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v25 + 92);
v28 = *(float *)(*(int (__fastcall **)(CCAnimatedSprite *))(*(_DWORD *)this + 164))(this);
v29 = (*(int (__fastcall **)(CCAnimatedSprite *))(*(_DWORD *)this + 164))(this);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, v28 * 0.5, *(float *)(v29 + 4) * 0.5);
v27(v26, v49);
(*(void (__fastcall **)(CCAnimatedSprite *, _DWORD))(*(_DWORD *)this + 228))(this, *((_DWORD *)this + 135));
*((_DWORD *)this + 134) = *((_DWORD *)this + 135);
}
if ( v44 )
{
v46 = 0;
v47 = 0;
v48 = nullptr;
std::string::__init(&v46, "animDesc", 8u);
v30 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(Definition, &v46);
v31 = (CCPartAnimSprite *)cocos2d::CCString::getCString(v30);
std::string::~string((int)&v46);
v33 = CCPartAnimSprite::createWithAnimDesc(v31, (const char *)a3, a4, v32);
*((_DWORD *)this + 136) = v33;
v34 = v33;
v35 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v33 + 92);
v36 = *(float *)(*(int (__fastcall **)(CCAnimatedSprite *))(*(_DWORD *)this + 164))(this);
v37 = (*(int (__fastcall **)(CCAnimatedSprite *))(*(_DWORD *)this + 164))(this);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v49, v36 * 0.5, *(float *)(v37 + 4) * 0.5);
v35(v34, v49);
(*(void (__fastcall **)(CCAnimatedSprite *, _DWORD))(*(_DWORD *)this + 228))(this, *((_DWORD *)this + 136));
*((_DWORD *)this + 134) = *((_DWORD *)this + 136);
}
*((_DWORD *)this + 137) = 0;
v46 = 0;
v47 = 0;
v48 = nullptr;
v38 = strlen(a2);
std::string::__init(&v46, a2, v38);
*((_DWORD *)this + 133) = SpriteAnimationManager::createWithOwner(this, &v46);
std::string::~string((int)&v46);
cocos2d::CCObject::retain(*((cocos2d::CCObject **)this + 133));
v39 = *((_DWORD *)this + 136);
if ( v39 )
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v39 + 172))(v39, 0);
v40 = *((_DWORD *)this + 135);
if ( v40 )
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v40 + 172))(v40, 0);
(*(void (__fastcall **)(CCAnimatedSprite *, int))(*(_DWORD *)this + 172))(this, 1);
v41 = *((_DWORD *)this + 133);
v42 = (*((_BYTE *)this + 552) & 1) != 0;
if ( (*((_BYTE *)this + 552) & 1) == 0 )
this = (CCAnimatedSprite *)((char *)this + 553);
v46 = 0;
if ( v42 )
this = *((CCAnimatedSprite **)this + 140);
v47 = 0;
v48 = nullptr;
v43 = strlen((const char *)this);
std::string::__init(&v46, this, v43);
SpriteAnimationManager::runAnimation(v41, &v46);
return std::string::~string((int)&v46);
}
return result;
}