//
// CCAnimatedSprite::initWithType from 0x1002fd2e0 to 0x1002fd414 (308 bytes)
//
// 3 xrefs:
// > AnimatedShopKeeper::init @ 0x10014e640
// > GJRobotSprite::init @ 0x10023f444
// > CCAnimatedSprite::createWithType @ 0x1002fd290
//
// 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
//
bool __fastcall CCAnimatedSprite::initWithType(CCAnimatedSprite *a1, const char *a2, cocos2d::CCTexture2D *a3, bool a4)
{
cocos2d::CCTexture2D *v5; // x22
ObjectManager *v8; // x0
cocos2d::CCDictionary *Definition; // x22
cocos2d::CCString *v10; // x0
char *CString; // x0
cocos2d::CCTextureCache *v12; // x0
std::string *v13; // x1
_BOOL4 v14; // w23
void *__p[2]; // [xsp+0h] [xbp-60h] BYREF
char v17; // [xsp+17h] [xbp-49h]
std::string v18; // [xsp+18h] [xbp-48h] BYREF
v5 = a3;
if ( !a3 )
{
v8 = ObjectManager::instance();
Definition = ObjectManager::getDefinition(v8, a2);
sub_100009900(__p, "spriteSheet");
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(Definition, __p);
CString = (char *)cocos2d::CCString::getCString(v10);
sub_100009900(&v18, CString);
if ( v17 < 0 )
operator delete(__p[0]);
std::string::append(&v18, ".png");
v12 = cocos2d::CCTextureCache::sharedTextureCache();
if ( (v18.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v13 = &v18;
else
v13 = (std::string *)v18.__r_.__value_.__r.__words[0];
v5 = cocos2d::CCTextureCache::addImage(v12, (const char *)v13, 0);
if ( SHIBYTE(v18.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v18.__r_.__value_.__l.__data_);
}
sub_100022990((float *)&v18, 0.0, 0.0, 0.0, 0.0);
v14 = cocos2d::CCSprite::initWithTexture_1(a1, v5, (const cocos2d::CCRect *)&v18);
if ( v14 )
{
a1->m_bDontDraw = 1;
std::string::assign((std::string *)&a1->m_unkString1, "");
CCAnimatedSprite::loadType(a1, a2, v5, a4);
}
return v14;
}