//
// AnimatedGameObject::init from 0x887cd8 to 0x887eb0 (472 bytes)
//
// 2 xrefs:
// > AnimatedGameObject::create @ 0x8883d0
// > ??> @ 0xca930
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:56:00 +0000
//
__int64 __fastcall AnimatedGameObject::init(AnimatedGameObject *this, int a2)
{
unsigned int v4; // w22
char *v5; // x0
__int64 v6; // x0
cocos2d::CCTexture2D *v7; // x0
unsigned __int8 v8; // w0
const cocos2d::CCSize *v9; // x0
__int64 v10; // x23
void (__fastcall *v11)(__int64, _BYTE *); // x21
float v13[2]; // [xsp+58h] [xbp+58h] BYREF
_BYTE v14[8]; // [xsp+60h] [xbp+60h] BYREF
*((_DWORD *)this + 257) = a2;
*((_DWORD *)this + 312) = 2;
if ( a2 == 1327 )
{
v5 = "GJBeast02";
}
else if ( a2 <= 1327 )
{
if ( a2 == 918 )
{
v5 = "GJBeast01";
*((_BYTE *)this + 1520) = 1;
}
else
{
if ( a2 != 919 )
return 0;
v5 = "BlackSludge";
}
}
else
{
switch ( a2 )
{
case 1584:
v5 = "GJBeast04";
*((_BYTE *)this + 1520) = 1;
break;
case 2012:
v5 = "GJBeast05";
*((_BYTE *)this + 1520) = 1;
break;
case 1328:
v5 = "GJBeast03";
break;
default:
return 0;
}
}
v6 = CCAnimatedSprite::createWithType((CCAnimatedSprite *)v5, nullptr, nullptr);
*((_QWORD *)this + 183) = v6;
SpriteAnimationManager::stopAnimations(*(SpriteAnimationManager **)(v6 + 648));
*(_QWORD *)(*((_QWORD *)this + 183) + 712LL) = (char *)this + 1448;
v7 = (cocos2d::CCTexture2D *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 183) + 1072LL))(*((_QWORD *)this + 183));
v8 = GameObject::initWithTexture(this, v7);
v4 = v8;
if ( v8 )
{
AnimatedGameObject::setupAnimatedSize(this, a2);
(*(void (__fastcall **)(AnimatedGameObject *, _QWORD))(*(_QWORD *)this + 456LL))(this, *((_QWORD *)this + 183));
v9 = (const cocos2d::CCSize *)(*(__int64 (__fastcall **)(AnimatedGameObject *))(*(_QWORD *)this + 328LL))(this);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v13, v9);
v10 = *((_QWORD *)this + 183);
v11 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v10 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v14, v13[0] * 0.5, v13[1] * 0.5);
v11(v10, v14);
*((_BYTE *)this + 313) = 0;
*((_BYTE *)this + 887) = 1;
AnimatedGameObject::setupChildSprites(this);
}
return v4;
}