//
// AnimatedGameObject::setupChildSprites from 0x1001b67b0 to 0x1001b7032 (2178 bytes)
//
// 1 xrefs:
// > AnimatedGameObject::init @ 0x1001b65d4
//
// 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
//
void __fastcall AnimatedGameObject::setupChildSprites(AnimatedGameObject *a1)
{
int m_objectID; // eax
cocos2d::CCSprite *v3; // rax
cocos2d::CCArray *v4; // r14
__int64 v5; // r15
cocos2d::CCSprite *v6; // r12
__int64 v7; // rax
cocos2d::CCSprite *v8; // rax
AnimatedGameObject_vtbl *v9; // rax
__int64 v10; // rcx
cocos2d::CCSprite *v11; // rax
cocos2d::CCArray *v12; // r14
CCSpritePlus *v13; // r15
const char *v14; // rdi
cocos2d::CCSprite *v15; // rax
cocos2d::CCSprite *v16; // r12
__int64 v17; // rax
cocos2d::CCSprite *v18; // rax
cocos2d::CCArray *v19; // r14
cocos2d::CCSprite *v20; // rax
__int64 v21; // r15
cocos2d::CCSprite *v22; // rax
cocos2d::CCNode *v23; // r12
__int64 v24; // rax
CCSpritePlus *v25; // r15
cocos2d::CCSprite *v26; // rax
cocos2d::CCNode *v27; // r12
__int64 v28; // rax
CCSpritePlus *v29; // r15
cocos2d::CCSprite *v30; // rax
cocos2d::CCNode *v31; // r12
__int64 v32; // rax
unsigned int v33; // ebx
cocos2d::CCSprite *v34; // rax
cocos2d::CCArray *m_spriteParts; // r14
unsigned int v36; // r15d
__int64 v37; // rax
cocos2d::CCSprite *m_colorSprite; // r12
CCSpritePlus *v39; // r13
const char *v40; // rdi
cocos2d::CCSprite *v41; // r12
__int64 v42; // rax
_BYTE v43[8]; // [rsp+0h] [rbp-50h] BYREF
void *v44[3]; // [rsp+8h] [rbp-48h] BYREF
float v45[12]; // [rsp+20h] [rbp-30h] BYREF
m_objectID = a1->m_objectID;
if ( m_objectID <= 1327 )
{
if ( m_objectID == 918 )
{
v34 = cocos2d::CCSprite::create_2();
a1->m_childSprite = v34;
((void (__fastcall *)(CCAnimatedSprite *, cocos2d::CCSprite *, __int64))a1->m_animatedSprite->addChild_0)(
a1->m_animatedSprite,
v34,
0xFFFFFFFFLL);
m_spriteParts = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( (unsigned int)sub_100720070(m_spriteParts) )
{
v36 = 0;
do
{
v39 = (CCSpritePlus *)sub_1007200C0(m_spriteParts, v36);
v40 = "GJBeast01_02_glow_001.png";
if ( v36 == 1 )
v40 = "GJBeast01_01_glow_001.png";
v41 = cocos2d::CCSprite::createWithSpriteFrameName(v40);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_childSprite->addChild_0)(
a1->m_childSprite,
v41,
0xFFFFFFFFLL);
CCSpritePlus::addFollower(v39, v41);
((void (__fastcall *)(CCSpritePlus *))v39->getRotation)(v39);
((void (__fastcall *)(cocos2d::CCSprite *))v41->setRotation)(v41);
((void (__fastcall *)(CCSpritePlus *))v39->getScaleX)(v39);
((void (__fastcall *)(cocos2d::CCSprite *))v41->setScaleX)(v41);
((void (__fastcall *)(CCSpritePlus *))v39->getScaleY)(v39);
((void (__fastcall *)(cocos2d::CCSprite *))v41->setScaleY)(v41);
v42 = ((__int64 (__fastcall *)(CCSpritePlus *))v39->getPosition)(v39);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v41->setPosition)(v41, v42);
if ( v36 == 1 )
{
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
strcpy((char *)v44, "(GJBeast01_03_001.png");
GameObject::addCustomColorChild(a1, v44);
if ( ((__int64)v44[0] & 1) != 0 )
operator delete(v44[2]);
GameObject::setDefaultSecondaryColorMode(a1, 1011);
((void (__fastcall *)(CCSpritePlus *, cocos2d::CCSprite *, __int64))v39->addChild_0)(
v39,
a1->m_colorSprite,
1);
v37 = ((__int64 (__fastcall *)(CCSpritePlus *))v39->getContentSize)(v39);
sub_10028CFC0(v45, v37);
m_colorSprite = a1->m_colorSprite;
sub_10028CBE0(v43, v45[0] * 0.5, v45[1] * 0.5);
((void (__fastcall *)(cocos2d::CCSprite *, _BYTE *))m_colorSprite->setPosition)(m_colorSprite, v43);
}
++v36;
}
while ( v36 < (unsigned int)sub_100720070(m_spriteParts) );
}
return;
}
if ( m_objectID != 1327 )
return;
v11 = cocos2d::CCSprite::create_2();
a1->m_childSprite = v11;
((void (__fastcall *)(CCAnimatedSprite *, cocos2d::CCSprite *, __int64))a1->m_animatedSprite->addChild_0)(
a1->m_animatedSprite,
v11,
0xFFFFFFFFLL);
v12 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( (unsigned int)sub_100720070(v12) < 2 )
return;
v13 = (CCSpritePlus *)sub_1007200C0(v12, 1);
v14 = "GJBeast02_01_glow_001.png";
LABEL_13:
v16 = cocos2d::CCSprite::createWithSpriteFrameName(v14);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_childSprite->addChild_0)(
a1->m_childSprite,
v16,
0xFFFFFFFFLL);
CCSpritePlus::addFollower(v13, v16);
v13->m_propagateScaleChanges = 1;
((void (__fastcall *)(CCSpritePlus *))v13->getRotation)(v13);
((void (__fastcall *)(cocos2d::CCSprite *))v16->setRotation)(v16);
((void (__fastcall *)(CCSpritePlus *))v13->getScaleX)(v13);
((void (__fastcall *)(cocos2d::CCSprite *))v16->setScaleX)(v16);
((void (__fastcall *)(CCSpritePlus *))v13->getScaleY)(v13);
((void (__fastcall *)(cocos2d::CCSprite *))v16->setScaleY)(v16);
v17 = ((__int64 (__fastcall *)(CCSpritePlus *))v13->getPosition)(v13);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v16->setPosition)(v16, v17);
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
v9 = (AnimatedGameObject_vtbl *)sub_1007200C0(v12, 0);
v10 = 888;
goto LABEL_14;
}
switch ( m_objectID )
{
case 1328:
v15 = cocos2d::CCSprite::create_2();
a1->m_childSprite = v15;
((void (__fastcall *)(CCAnimatedSprite *, cocos2d::CCSprite *, __int64))a1->m_animatedSprite->addChild_0)(
a1->m_animatedSprite,
v15,
0xFFFFFFFFLL);
v12 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( (unsigned int)sub_100720070(v12) < 2 )
return;
v13 = (CCSpritePlus *)sub_1007200C0(v12, 1);
v14 = "GJBeast03_01_glow_001.png";
goto LABEL_13;
case 1584:
v18 = cocos2d::CCSprite::create_2();
a1->m_childSprite = v18;
((void (__fastcall *)(CCAnimatedSprite *, cocos2d::CCSprite *, __int64))a1->m_animatedSprite->addChild_0)(
a1->m_animatedSprite,
v18,
0xFFFFFFFFLL);
v19 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
v20 = (cocos2d::CCSprite *)sub_1007200C0(v19, 0);
a1->m_colorSprite = v20;
cocos2d::CCObject::retain(v20);
GameObject::createSpriteColor(a1, 2);
GameObject::setDefaultSecondaryColorMode(a1, 1011);
if ( (unsigned int)sub_100720070(v19) >= 2 )
{
v21 = sub_1007200C0(v19, 1);
v22 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast04_04_glow_001.png");
if ( v22 )
{
v23 = v22;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_childSprite->addChild_0)(
a1->m_childSprite,
v22,
0xFFFFFFFFLL);
CCSpritePlus::addFollower((CCSpritePlus *)v21, v23);
*(_BYTE *)(v21 + 617) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v21 + 352LL))(v21);
((void (__fastcall *)(cocos2d::CCNode *))v23->setRotation)(v23);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v21 + 136LL))(v21);
((void (__fastcall *)(cocos2d::CCNode *))v23->setScaleX)(v23);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v21 + 152LL))(v21);
((void (__fastcall *)(cocos2d::CCNode *))v23->setScaleY)(v23);
v24 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL))(v21);
((void (__fastcall *)(cocos2d::CCNode *, __int64))v23->setPosition)(v23, v24);
*(_QWORD *)(v21 + 648) = &a1->SpritePartDelegate;
}
if ( (unsigned int)sub_100720070(v19) >= 3 )
{
v25 = (CCSpritePlus *)sub_1007200C0(v19, 2);
v26 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast04_02_glow_001.png");
if ( v26 )
{
v27 = v26;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_childSprite->addChild_0)(
a1->m_childSprite,
v26,
0xFFFFFFFFLL);
CCSpritePlus::addFollower(v25, v27);
v25->m_propagateScaleChanges = 1;
((void (__fastcall *)(CCSpritePlus *))v25->getRotation)(v25);
((void (__fastcall *)(cocos2d::CCNode *))v27->setRotation)(v27);
((void (__fastcall *)(CCSpritePlus *))v25->getScaleX)(v25);
((void (__fastcall *)(cocos2d::CCNode *))v27->setScaleX)(v27);
((void (__fastcall *)(CCSpritePlus *))v25->getScaleY)(v25);
((void (__fastcall *)(cocos2d::CCNode *))v27->setScaleY)(v27);
v28 = ((__int64 (__fastcall *)(CCSpritePlus *))v25->getPosition)(v25);
((void (__fastcall *)(cocos2d::CCNode *, __int64))v27->setPosition)(v27, v28);
}
if ( (unsigned int)sub_100720070(v19) >= 4 )
{
v29 = (CCSpritePlus *)sub_1007200C0(v19, 3);
v30 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast04_01_glow_001.png");
if ( v30 )
{
v31 = v30;
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_childSprite->addChild_0)(
a1->m_childSprite,
v30,
0xFFFFFFFFLL);
CCSpritePlus::addFollower(v29, v31);
v29->m_propagateScaleChanges = 1;
((void (__fastcall *)(CCSpritePlus *))v29->getRotation)(v29);
((void (__fastcall *)(cocos2d::CCNode *))v31->setRotation)(v31);
((void (__fastcall *)(CCSpritePlus *))v29->getScaleX)(v29);
((void (__fastcall *)(cocos2d::CCNode *))v31->setScaleX)(v31);
((void (__fastcall *)(CCSpritePlus *))v29->getScaleY)(v29);
((void (__fastcall *)(cocos2d::CCNode *))v31->setScaleY)(v31);
v32 = ((__int64 (__fastcall *)(CCSpritePlus *))v29->getPosition)(v29);
((void (__fastcall *)(cocos2d::CCNode *, __int64))v31->setPosition)(v31, v32);
}
if ( (unsigned int)sub_100720070(v19) >= 5 )
{
v33 = 4;
do
sub_1007200C0(v19, v33++);
while ( v33 < (unsigned int)sub_100720070(v19) );
}
}
}
}
break;
case 2012:
v3 = cocos2d::CCSprite::create_2();
a1->m_childSprite = v3;
((void (__fastcall *)(CCAnimatedSprite *, cocos2d::CCSprite *, __int64))a1->m_animatedSprite->addChild_0)(
a1->m_animatedSprite,
v3,
0xFFFFFFFFLL);
v4 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( (unsigned int)sub_100720070(v4) >= 2 )
{
v5 = sub_1007200C0(v4, 0);
v6 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast05_02_glow_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))a1->m_childSprite->addChild_0)(
a1->m_childSprite,
v6,
0xFFFFFFFFLL);
CCSpritePlus::addFollower((CCSpritePlus *)v5, v6);
*(_BYTE *)(v5 + 617) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 352LL))(v5);
((void (__fastcall *)(cocos2d::CCSprite *))v6->setRotation)(v6);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 136LL))(v5);
((void (__fastcall *)(cocos2d::CCSprite *))v6->setScaleX)(v6);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 152LL))(v5);
((void (__fastcall *)(cocos2d::CCSprite *))v6->setScaleY)(v6);
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v5 + 192LL))(v5);
((void (__fastcall *)(cocos2d::CCSprite *, __int64))v6->setPosition)(v6, v7);
*(_QWORD *)(v5 + 648) = &a1->SpritePartDelegate;
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
v8 = (cocos2d::CCSprite *)sub_1007200C0(v4, 1);
a1->m_colorSprite = v8;
cocos2d::CCObject::retain(v8);
v9 = (AnimatedGameObject_vtbl *)sub_1007200C0(v4, 2);
v10 = 1480;
LABEL_14:
*(AnimatedGameObject_vtbl **)((char *)&a1->EnhancedGameObject::GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v10) = v9;
cocos2d::CCObject::retain((cocos2d::CCObject *)v9);
GameObject::createSpriteColor(a1, 2);
GameObject::setDefaultSecondaryColorMode(a1, 1011);
}
break;
}
}