//
// AnimatedGameObject::setupChildSprites from 0x755eb4 to 0x756644 (1936 bytes)
//
// 2 xrefs:
// > AnimatedGameObject::init @ 0x756c40
// > ??> @ 0x52e90
//
// 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 AnimatedGameObject::setupChildSprites(AnimatedGameObject *a1)
{
int m_objectID; // w0
cocos2d::CCSprite *v3; // x0
CCAnimatedSprite *v4; // x3
cocos2d::CCArray *v5; // x21
__int64 v6; // x19
cocos2d::CCSprite *v7; // x20
__int64 v8; // x1
cocos2d::CCSprite_vtbl *v9; // x2
void (__fastcall *v10)(cocos2d::CCSprite *__hidden, float); // x25
void (__fastcall *v11)(cocos2d::CCSprite *__hidden, float); // x25
void (__fastcall *v12)(cocos2d::CCSprite *__hidden, float); // x25
void (__fastcall *v13)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x25
__int64 v14; // x0
cocos2d::CCSprite *v15; // x0
CCSpritePart *v16; // x0
cocos2d::CCSprite *v17; // x0
unsigned int v18; // w21
cocos2d::CCArray *m_spriteParts; // x23
CCSpritePlus *v20; // x20
cocos2d::CCSprite *v21; // x19
void (__fastcall *setRotation)(cocos2d::CCSprite *__hidden, float); // x28
void (__fastcall *setScaleX)(cocos2d::CCSprite *__hidden, float); // x28
void (__fastcall *setScaleY)(cocos2d::CCSprite *__hidden, float); // x28
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x28
__int64 v26; // x0
const cocos2d::CCSize *v27; // x0
cocos2d::CCSprite *m_colorSprite; // x20
void (__fastcall *v29)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x19
cocos2d::CCSprite *v30; // x0
CCAnimatedSprite *m_animatedSprite; // x3
cocos2d::CCArray *v32; // x21
CCSpritePlus *v33; // x20
const char *v34; // x0
cocos2d::CCSprite *v35; // x19
CCSpritePlus_vtbl *v36; // x1
cocos2d::CCSprite_vtbl *v37; // x2
void (__fastcall *v38)(cocos2d::CCSprite *__hidden, float); // x25
void (__fastcall *v39)(cocos2d::CCSprite *__hidden, float); // x25
void (__fastcall *v40)(cocos2d::CCSprite *__hidden, float); // x25
CCSpritePlus *v41; // x0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v43)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x20
__int64 v44; // x0
cocos2d::CCSprite *v45; // x0
CCAnimatedSprite *v46; // x3
cocos2d::CCSprite *v47; // x0
unsigned int v48; // w21
cocos2d::CCArray *v49; // x23
cocos2d::CCSprite *v50; // x0
__int64 v51; // x20
cocos2d::CCSprite *v52; // x19
__int64 v53; // x1
cocos2d::CCSprite_vtbl *v54; // x2
void (__fastcall *v55)(cocos2d::CCSprite *__hidden, float); // x28
void (__fastcall *v56)(cocos2d::CCSprite *__hidden, float); // x28
void (__fastcall *v57)(cocos2d::CCSprite *__hidden, float); // x28
void (__fastcall *v58)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x28
__int64 v59; // x0
cocos2d::CCSize v60; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCPoint v61; // [xsp+80h] [xbp+80h] BYREF
m_objectID = a1->m_objectID;
switch ( m_objectID )
{
case 918:
v17 = cocos2d::CCSprite::create();
a1->m_childSprite = v17;
v18 = 0;
a1->m_animatedSprite->addChild_0(a1->m_animatedSprite, v17, -1);
m_spriteParts = a1->m_animatedSprite->m_paSprite->m_spriteParts;
while ( v18 < (unsigned int)cocos2d::CCArray::count(m_spriteParts) )
{
v20 = (CCSpritePlus *)cocos2d::CCArray::objectAtIndex(m_spriteParts, v18);
if ( v18 == 1 )
v21 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast01_01_glow_001.png");
else
v21 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast01_02_glow_001.png");
a1->m_childSprite->addChild_0(a1->m_childSprite, v21, -1);
CCSpritePlus::addFollower(v20, v21);
setRotation = v21->setRotation;
v20->getRotation(v20);
((void (__fastcall *)(cocos2d::CCSprite *))setRotation)(v21);
setScaleX = v21->setScaleX;
v20->getScaleX(v20);
((void (__fastcall *)(cocos2d::CCSprite *))setScaleX)(v21);
setScaleY = v21->setScaleY;
v20->getScaleY(v20);
((void (__fastcall *)(cocos2d::CCSprite *))setScaleY)(v21);
setPosition = v21->setPosition;
v26 = (__int64)v20->getPosition(v20);
setPosition(v21, (const cocos2d::CCPoint *)v26);
if ( v18 == 1 )
{
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
sub_D153B8((int)&v61, "GJBeast01_03_001.png");
GameObject::addCustomColorChild(a1, (const char **)&v61);
if ( (__int64 *)(*(_QWORD *)&v61 - 24LL) != &qword_124B6B0 )
sub_74B3A8((void *)(*(_QWORD *)&v61 - 24LL));
v18 = 2;
GameObject::setDefaultSecondaryColorMode(a1, 1011);
v20->addChild_0(v20, a1->m_colorSprite, 1);
v27 = v20->getContentSize(v20);
cocos2d::CCSize::CCSize(&v60, v27);
m_colorSprite = a1->m_colorSprite;
v29 = m_colorSprite->setPosition;
cocos2d::CCPoint::CCPoint(&v61, v60.width * 0.5, v60.height * 0.5);
v29(m_colorSprite, &v61);
}
else
{
++v18;
}
}
return;
case 1327:
v30 = cocos2d::CCSprite::create();
m_animatedSprite = a1->m_animatedSprite;
a1->m_childSprite = v30;
m_animatedSprite->addChild_0(m_animatedSprite, v30, -1);
v32 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( (unsigned int)cocos2d::CCArray::count(v32) <= 1 )
return;
v33 = (CCSpritePlus *)cocos2d::CCArray::objectAtIndex(v32, 1u);
v34 = "GJBeast02_01_glow_001.png";
goto LABEL_22;
case 1328:
v45 = cocos2d::CCSprite::create();
v46 = a1->m_animatedSprite;
a1->m_childSprite = v45;
v46->addChild_0(v46, v45, -1);
v32 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( (unsigned int)cocos2d::CCArray::count(v32) <= 1 )
return;
v33 = (CCSpritePlus *)cocos2d::CCArray::objectAtIndex(v32, 1u);
v34 = "GJBeast03_01_glow_001.png";
LABEL_22:
v35 = cocos2d::CCSprite::createWithSpriteFrameName(v34);
a1->m_childSprite->addChild_0(a1->m_childSprite, v35, -1);
CCSpritePlus::addFollower(v33, v35);
v36 = v33->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v37 = v35->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v33->m_propagateScaleChanges = 1;
v38 = v37->setRotation;
v36->getRotation(v33);
((void (__fastcall *)(cocos2d::CCSprite *))v38)(v35);
v39 = v35->setScaleX;
v33->getScaleX(v33);
((void (__fastcall *)(cocos2d::CCSprite *))v39)(v35);
v40 = v35->setScaleY;
v33->getScaleY(v33);
((void (__fastcall *)(cocos2d::CCSprite *))v40)(v35);
v41 = v33;
getPosition = v33->getPosition;
v43 = v35->setPosition;
v44 = (__int64)getPosition(v41);
v43(v35, (const cocos2d::CCPoint *)v44);
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
v16 = (CCSpritePart *)cocos2d::CCArray::objectAtIndex(v32, 0);
a1->m_colorSprite = v16;
goto LABEL_9;
case 1584:
v47 = cocos2d::CCSprite::create();
a1->m_childSprite = v47;
v48 = 1;
a1->m_animatedSprite->addChild_0(a1->m_animatedSprite, v47, -1);
v49 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
v50 = (cocos2d::CCSprite *)cocos2d::CCArray::objectAtIndex(v49, 0);
a1->m_colorSprite = v50;
cocos2d::CCObject::retain(v50);
GameObject::createSpriteColor(a1, 2);
GameObject::setDefaultSecondaryColorMode(a1, 1011);
while ( 1 )
{
if ( v48 >= (unsigned int)cocos2d::CCArray::count(v49) )
return;
v51 = cocos2d::CCArray::objectAtIndex(v49, v48);
switch ( v48 )
{
case 2u:
v52 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast04_02_glow_001.png");
break;
case 3u:
v52 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast04_01_glow_001.png");
break;
case 1u:
v52 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast04_04_glow_001.png");
break;
default:
goto LABEL_30;
}
if ( !v52 )
goto LABEL_30;
a1->m_childSprite->addChild_0(a1->m_childSprite, v52, -1);
CCSpritePlus::addFollower((CCSpritePlus *)v51, v52);
v53 = *(_QWORD *)v51;
v54 = v52->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
*(_BYTE *)(v51 + 617) = 1;
v55 = v54->setRotation;
(*(void (__fastcall **)(__int64))(v53 + 352))(v51);
((void (__fastcall *)(cocos2d::CCSprite *))v55)(v52);
v56 = v52->setScaleX;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v51 + 136LL))(v51);
((void (__fastcall *)(cocos2d::CCSprite *))v56)(v52);
v57 = v52->setScaleY;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v51 + 152LL))(v51);
((void (__fastcall *)(cocos2d::CCSprite *))v57)(v52);
v58 = v52->setPosition;
v59 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v51 + 192LL))(v51);
v58(v52, (const cocos2d::CCPoint *)v59);
if ( v48 == 1 )
{
v48 = 2;
*(_QWORD *)(v51 + 632) = &a1->SpritePartDelegate;
}
else
{
LABEL_30:
++v48;
}
}
case 2012:
v3 = cocos2d::CCSprite::create();
v4 = a1->m_animatedSprite;
a1->m_childSprite = v3;
v4->addChild_0(v4, v3, -1);
v5 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( (unsigned int)cocos2d::CCArray::count(v5) > 1 )
{
v6 = cocos2d::CCArray::objectAtIndex(v5, 0);
v7 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast05_02_glow_001.png");
a1->m_childSprite->addChild_0(a1->m_childSprite, v7, -1);
CCSpritePlus::addFollower((CCSpritePlus *)v6, v7);
v8 = *(_QWORD *)v6;
v9 = v7->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
*(_BYTE *)(v6 + 617) = 1;
v10 = v9->setRotation;
(*(void (__fastcall **)(__int64))(v8 + 352))(v6);
((void (__fastcall *)(cocos2d::CCSprite *))v10)(v7);
v11 = v7->setScaleX;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 136LL))(v6);
((void (__fastcall *)(cocos2d::CCSprite *))v11)(v7);
v12 = v7->setScaleY;
(*(void (__fastcall **)(__int64))(*(_QWORD *)v6 + 152LL))(v6);
((void (__fastcall *)(cocos2d::CCSprite *))v12)(v7);
v13 = v7->setPosition;
v14 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 192LL))(v6);
v13(v7, (const cocos2d::CCPoint *)v14);
*(_QWORD *)(v6 + 632) = &a1->SpritePartDelegate;
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
v15 = (cocos2d::CCSprite *)cocos2d::CCArray::objectAtIndex(v5, 1u);
a1->m_colorSprite = v15;
cocos2d::CCObject::retain(v15);
v16 = (CCSpritePart *)cocos2d::CCArray::objectAtIndex(v5, 2u);
a1->m_eyeSpritePart = v16;
LABEL_9:
cocos2d::CCObject::retain(v16);
GameObject::createSpriteColor(a1, 2);
GameObject::setDefaultSecondaryColorMode(a1, 1011);
}
break;
}
}