//
// AnimatedGameObject::init from 0x756af0 to 0x756cc8 (472 bytes)
//
// 2 xrefs:
// > AnimatedGameObject::create @ 0x7571f8
// > ??> @ 0x997e0
//
// 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 AnimatedGameObject::init(AnimatedGameObject *a1, int a2)
{
bool v4; // w22
const char *v5; // x0
CCAnimatedSprite *v6; // x0
cocos2d::CCTexture2D *v7; // x0
const cocos2d::CCSize *v8; // x0
CCAnimatedSprite *m_animatedSprite; // x23
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x21
cocos2d::CCSize v12; // [xsp+58h] [xbp+58h] BYREF
cocos2d::CCPoint v13; // [xsp+60h] [xbp+60h] BYREF
a1->m_objectID = a2;
a1->m_classType = Animated;
if ( a2 == 1327 )
{
v5 = "GJBeast02";
}
else if ( a2 <= 1327 )
{
if ( a2 == 918 )
{
v5 = "GJBeast01";
a1->m_notGrounded = 1;
}
else
{
if ( a2 != 919 )
return 0;
v5 = "BlackSludge";
}
}
else
{
switch ( a2 )
{
case 1584:
v5 = "GJBeast04";
a1->m_notGrounded = 1;
break;
case 2012:
v5 = "GJBeast05";
a1->m_notGrounded = 1;
break;
case 1328:
v5 = "GJBeast03";
break;
default:
return 0;
}
}
v6 = CCAnimatedSprite::createWithType(v5, nullptr, 0);
a1->m_animatedSprite = v6;
SpriteAnimationManager::stopAnimations(v6->m_animationManager);
a1->m_animatedSprite->m_delegate = &a1->AnimatedSpriteDelegate;
v7 = a1->m_animatedSprite->getTexture(a1->m_animatedSprite);
v4 = GameObject::initWithTexture(a1, v7);
if ( v4 )
{
AnimatedGameObject::setupAnimatedSize(a1, a2);
a1->addChild(a1, a1->m_animatedSprite);
v8 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize(&v12, v8);
m_animatedSprite = a1->m_animatedSprite;
setPosition = m_animatedSprite->setPosition;
cocos2d::CCPoint::CCPoint(&v13, v12.width * 0.5, v12.height * 0.5);
setPosition(m_animatedSprite, &v13);
a1->m_bUnkBool2 = 0;
a1->m_unk367 = 1;
AnimatedGameObject::setupChildSprites(a1);
}
return v4;
}