//
// GJMGLayer::loadGroundSprites from 0x14027f500 to 0x14027f6bd (445 bytes)
//
// 8 xrefs:
// > GJBaseGameLayer::updateCameraBGArt @ 0x14023e875
// > GJBaseGameLayer::updateCameraBGArt @ 0x14023e882
// > GJMGLayer::init @ 0x14027f265
// > GJMGLayer::init @ 0x14027f423
// > ??> @ 0x140687a64
// > ??> @ 0x140687ae0
// > ??> @ 0x140687af8
// > ??> @ 0x1406d12c8
//
// 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 GJMGLayer::loadGroundSprites(GJMGLayer *a1, int a2, bool a3)
{
cocos2d::CCSprite *m_ground1Sprite; // rsi
cocos2d::CCArray *v5; // rbx
struct cocos2d::CCArray *v6; // rax
int i; // r14d
struct cocos2d::CCTexture2D *v8; // rax
struct cocos2d::CCSprite *v9; // rdi
float v10; // xmm0_4
cocos2d::CCSprite_vtbl *v11; // rbx
__int64 v12; // rax
float v13; // xmm0_4
cocos2d::CCSprite_vtbl *v14; // rbx
const cocos2d::CCPoint *v15; // rax
signed int v16; // edi
struct cocos2d::CCObject *Object; // rax
_BOOL8 v18; // r8
if ( a3 )
m_ground1Sprite = a1->m_ground1Sprite;
else
m_ground1Sprite = a1->m_ground2Sprite;
if ( m_ground1Sprite )
{
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(a1);
if ( m_ground1Sprite->getChildren(m_ground1Sprite) )
{
v6 = m_ground1Sprite->getChildren(m_ground1Sprite);
cocos2d::CCArray::addObjectsFromArray(v5, v6);
}
if ( cocos2d::CCArray::count(v5) != a2 )
{
if ( cocos2d::CCArray::count(v5) >= a2 )
{
v16 = cocos2d::CCArray::count(v5) - a2;
while ( v16 > 0 )
{
if ( !cocos2d::CCArray::count(v5) )
break;
--v16;
Object = cocos2d::CCArray::lastObject(v5);
LOBYTE(v18) = 1;
m_ground1Sprite->removeChild(m_ground1Sprite, (cocos2d::CCNode *)Object, v18);
cocos2d::CCArray::removeLastObject(v5, 1);
}
}
else
{
for ( i = cocos2d::CCArray::count(v5); i < a2; ++i )
{
v8 = m_ground1Sprite->getTexture(&m_ground1Sprite->cocos2d::CCTextureProtocol);
v9 = cocos2d::CCSprite::createWithTexture(v8);
v10 = ((float (__fastcall *)(cocos2d::CCSprite *, struct cocos2d::CCSprite *))m_ground1Sprite->addChild_1)(
m_ground1Sprite,
v9);
v11 = v9->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v10, (float)i * v9->m_obRect.size.width);
v13 = ((float (__fastcall *)(struct cocos2d::CCSprite *, __int64))v11->setPosition_0)(v9, v12);
v14 = v9->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v13, 0.0);
v14->setAnchorPoint(v9, v15);
v9->setColor(&v9->cocos2d::CCRGBAProtocol, &stru_140529AC8);
}
}
}
}
}