//
// AnimatedGameObject::setupChildSprites from 0x3e79c0 to 0x3e7eb4 (1268 bytes)
//
// 1 xrefs:
// > AnimatedGameObject::init @ 0x3e82d2
//
// 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; // r7
cocos2d::CCSprite *v3; // r0
unsigned int v4; // r6
cocos2d::CCArray *v5; // r8
CCSpritePlus *v6; // r5
const char *v7; // r0
cocos2d::CCSprite *v8; // r7
void (__fastcall *v9)(cocos2d::CCSprite *__hidden, float); // r9
int v10; // r0
void (__fastcall *v11)(cocos2d::CCSprite *__hidden, float); // r9
int v12; // r0
void (__fastcall *v13)(cocos2d::CCSprite *__hidden, float); // r9
int v14; // r0
void (__fastcall *v15)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v16; // r0
const cocos2d::CCSize *v17; // r0
cocos2d::CCSprite *m_colorSprite; // r9
void (__fastcall *v19)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r5
cocos2d::CCSprite *v20; // r0
cocos2d::CCArray *m_spriteParts; // r7
CCSpritePlus *v22; // r6
const char *v23; // r0
cocos2d::CCSprite *v24; // r0
cocos2d::CCSprite *v25; // r5
cocos2d::CCSprite_vtbl *v26; // r3
void (__fastcall *setRotation)(cocos2d::CCSprite *__hidden, float); // r9
int v28; // r0
void (__fastcall *setScaleX)(cocos2d::CCSprite *__hidden, float); // r9
int v30; // r0
void (__fastcall *setScaleY)(cocos2d::CCSprite *__hidden, float); // r9
int v32; // r0
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v34; // r0
CCSpritePart *v35; // r0
cocos2d::CCSprite *v36; // r0
unsigned int v37; // r5
cocos2d::CCArray *v38; // r7
cocos2d::CCSprite *v39; // r0
CCSpritePlus *v40; // r6
const char *v41; // r0
cocos2d::CCSprite *v42; // r11
int v43; // r0
int v44; // r0
int v45; // r0
int v46; // r0
cocos2d::CCSprite *v47; // r0
cocos2d::CCArray *v48; // r7
CCSpritePlus *v49; // r5
cocos2d::CCSprite *v50; // r6
cocos2d::CCSprite_vtbl *v51; // r3
void (__fastcall *v52)(cocos2d::CCSprite *__hidden, float); // r9
int v53; // r0
void (__fastcall *v54)(cocos2d::CCSprite *__hidden, float); // r9
int v55; // r0
void (__fastcall *v56)(cocos2d::CCSprite *__hidden, float); // r9
int v57; // r0
void (__fastcall *v58)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v59; // r0
cocos2d::CCSprite *v60; // r0
cocos2d::CCSprite *v61; // [sp+4h] [bp-20h]
cocos2d::CCSprite *v62; // [sp+4h] [bp-20h]
cocos2d::CCSprite *v63; // [sp+4h] [bp-20h]
cocos2d::CCSprite *v64; // [sp+4h] [bp-20h]
cocos2d::CCSize v65; // [sp+Ch] [bp-18h] BYREF
cocos2d::CCPoint v66; // [sp+14h] [bp-10h] BYREF
m_objectID = a1->m_objectID;
if ( m_objectID != 918 )
{
if ( m_objectID == 1327 )
{
v20 = cocos2d::CCSprite::create();
a1->m_childSprite = v20;
a1->m_animatedSprite->addChild_0(a1->m_animatedSprite, v20, -1);
m_spriteParts = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( cocos2d::CCArray::count(m_spriteParts) <= 1u )
return;
v22 = (CCSpritePlus *)cocos2d::CCArray::objectAtIndex(m_spriteParts, 1u);
v23 = "GJBeast02_01_glow_001.png";
LABEL_16:
v25 = cocos2d::CCSprite::createWithSpriteFrameName(v23);
a1->m_childSprite->addChild_0(a1->m_childSprite, v25, -1);
CCSpritePlus::addFollower(v22, v25);
v26 = v25->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v22->m_propagateScaleChanges = 1;
setRotation = v26->setRotation;
v28 = ((int (__fastcall *)(CCSpritePlus *))v22->getRotation)(v22);
((void (__fastcall *)(cocos2d::CCSprite *, int))setRotation)(v25, v28);
setScaleX = v25->setScaleX;
v30 = ((int (__fastcall *)(CCSpritePlus *))v22->getScaleX)(v22);
((void (__fastcall *)(cocos2d::CCSprite *, int))setScaleX)(v25, v30);
setScaleY = v25->setScaleY;
v32 = ((int (__fastcall *)(CCSpritePlus *))v22->getScaleY)(v22);
((void (__fastcall *)(cocos2d::CCSprite *, int))setScaleY)(v25, v32);
setPosition = v25->setPosition;
v34 = (int)v22->getPosition(v22);
setPosition(v25, (const cocos2d::CCPoint *)v34);
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
v35 = (CCSpritePart *)cocos2d::CCArray::objectAtIndex(m_spriteParts, 0);
a1->m_colorSprite = v35;
goto LABEL_17;
}
if ( m_objectID == 1328 )
{
v24 = cocos2d::CCSprite::create();
a1->m_childSprite = v24;
a1->m_animatedSprite->addChild_0(a1->m_animatedSprite, v24, -1);
m_spriteParts = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( cocos2d::CCArray::count(m_spriteParts) <= 1u )
return;
v22 = (CCSpritePlus *)cocos2d::CCArray::objectAtIndex(m_spriteParts, 1u);
v23 = "GJBeast03_01_glow_001.png";
goto LABEL_16;
}
if ( m_objectID != 1584 )
{
if ( m_objectID != 2012 )
return;
v47 = cocos2d::CCSprite::create();
a1->m_childSprite = v47;
a1->m_animatedSprite->addChild_0(a1->m_animatedSprite, v47, -1);
v48 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
if ( cocos2d::CCArray::count(v48) <= 1u )
return;
v49 = (CCSpritePlus *)cocos2d::CCArray::objectAtIndex(v48, 0);
v50 = cocos2d::CCSprite::createWithSpriteFrameName("GJBeast05_02_glow_001.png");
a1->m_childSprite->addChild_0(a1->m_childSprite, v50, -1);
CCSpritePlus::addFollower(v49, v50);
v51 = v50->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v49->m_propagateScaleChanges = 1;
v52 = v51->setRotation;
v53 = ((int (__fastcall *)(CCSpritePlus *))v49->getRotation)(v49);
((void (__fastcall *)(cocos2d::CCSprite *, int))v52)(v50, v53);
v54 = v50->setScaleX;
v55 = ((int (__fastcall *)(CCSpritePlus *))v49->getScaleX)(v49);
((void (__fastcall *)(cocos2d::CCSprite *, int))v54)(v50, v55);
v56 = v50->setScaleY;
v57 = ((int (__fastcall *)(CCSpritePlus *))v49->getScaleY)(v49);
((void (__fastcall *)(cocos2d::CCSprite *, int))v56)(v50, v57);
v58 = v50->setPosition;
v59 = (int)v49->getPosition(v49);
v58(v50, (const cocos2d::CCPoint *)v59);
v49[1].m_uID = (unsigned int)&a1->SpritePartDelegate;
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
v60 = (cocos2d::CCSprite *)cocos2d::CCArray::objectAtIndex(v48, 1u);
a1->m_colorSprite = v60;
cocos2d::CCObject::retain(v60);
v35 = (CCSpritePart *)cocos2d::CCArray::objectAtIndex(v48, 2u);
a1->m_eyeSpritePart = v35;
LABEL_17:
cocos2d::CCObject::retain(v35);
GameObject::createSpriteColor(a1, 2);
GameObject::setDefaultSecondaryColorMode(a1, 1011);
return;
}
v36 = cocos2d::CCSprite::create();
v37 = 1;
a1->m_childSprite = v36;
a1->m_animatedSprite->addChild_0(a1->m_animatedSprite, v36, -1);
v38 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
v39 = (cocos2d::CCSprite *)cocos2d::CCArray::objectAtIndex(v38, 0);
a1->m_colorSprite = v39;
cocos2d::CCObject::retain(v39);
GameObject::createSpriteColor(a1, 2);
GameObject::setDefaultSecondaryColorMode(a1, 1011);
while ( 1 )
{
if ( v37 >= cocos2d::CCArray::count(v38) )
return;
v40 = (CCSpritePlus *)cocos2d::CCArray::objectAtIndex(v38, v37);
switch ( v37 )
{
case 2u:
v41 = "GJBeast04_02_glow_001.png";
break;
case 3u:
v41 = "GJBeast04_01_glow_001.png";
break;
case 1u:
v41 = "GJBeast04_04_glow_001.png";
break;
default:
goto LABEL_30;
}
v42 = cocos2d::CCSprite::createWithSpriteFrameName(v41);
if ( v42 )
{
a1->m_childSprite->addChild_0(a1->m_childSprite, v42, -1);
CCSpritePlus::addFollower(v40, v42);
v40->m_propagateScaleChanges = 1;
v61 = (cocos2d::CCSprite *)v42->setRotation;
v43 = ((int (__fastcall *)(CCSpritePlus *))v40->getRotation)(v40);
((void (__fastcall *)(cocos2d::CCSprite *, int))v61)(v42, v43);
v62 = (cocos2d::CCSprite *)v42->setScaleX;
v44 = ((int (__fastcall *)(CCSpritePlus *))v40->getScaleX)(v40);
((void (__fastcall *)(cocos2d::CCSprite *, int))v62)(v42, v44);
v63 = (cocos2d::CCSprite *)v42->setScaleY;
v45 = ((int (__fastcall *)(CCSpritePlus *))v40->getScaleY)(v40);
((void (__fastcall *)(cocos2d::CCSprite *, int))v63)(v42, v45);
v64 = (cocos2d::CCSprite *)v42->setPosition;
v46 = (int)v40->getPosition(v40);
((void (__fastcall *)(cocos2d::CCSprite *, int))v64)(v42, v46);
if ( v37 == 1 )
v40[1].m_uID = (unsigned int)&a1->SpritePartDelegate;
}
LABEL_30:
++v37;
}
}
v3 = cocos2d::CCSprite::create();
v4 = 0;
a1->m_childSprite = v3;
a1->m_animatedSprite->addChild_0(a1->m_animatedSprite, v3, -1);
v5 = a1->m_animatedSprite->m_paSprite->m_spriteParts;
while ( v4 < cocos2d::CCArray::count(v5) )
{
v6 = (CCSpritePlus *)cocos2d::CCArray::objectAtIndex(v5, v4);
if ( v4 == 1 )
v7 = "GJBeast01_01_glow_001.png";
else
v7 = "GJBeast01_02_glow_001.png";
v8 = cocos2d::CCSprite::createWithSpriteFrameName(v7);
a1->m_childSprite->addChild_0(a1->m_childSprite, v8, -1);
CCSpritePlus::addFollower(v6, v8);
v9 = v8->setRotation;
v10 = ((int (__fastcall *)(CCSpritePlus *))v6->getRotation)(v6);
((void (__fastcall *)(cocos2d::CCSprite *, int))v9)(v8, v10);
v11 = v8->setScaleX;
v12 = ((int (__fastcall *)(CCSpritePlus *))v6->getScaleX)(v6);
((void (__fastcall *)(cocos2d::CCSprite *, int))v11)(v8, v12);
v13 = v8->setScaleY;
v14 = ((int (__fastcall *)(CCSpritePlus *))v6->getScaleY)(v6);
((void (__fastcall *)(cocos2d::CCSprite *, int))v13)(v8, v14);
v15 = v8->setPosition;
v16 = (int)v6->getPosition(v6);
v15(v8, (const cocos2d::CCPoint *)v16);
if ( v4 == 1 )
{
a1->m_unk28c = 1;
a1->m_colorSpriteLocked = 1;
sub_776584((int)&v66, "GJBeast01_03_001.png");
GameObject::addCustomColorChild(a1, (const char **)&v66);
sub_774008(&v66);
GameObject::setDefaultSecondaryColorMode(a1, 1011);
v6->addChild_0(v6, a1->m_colorSprite, 1);
v17 = v6->getContentSize(v6);
cocos2d::CCSize::CCSize(&v65, v17);
m_colorSprite = a1->m_colorSprite;
v19 = m_colorSprite->setPosition;
cocos2d::CCPoint::CCPoint(&v66, v65.width * 0.5, v65.height * 0.5);
v19(m_colorSprite, &v66);
}
++v4;
}
}