//
// GJMGLayer::loadGroundSprites from 0x10002cc38 to 0x10002cdf4 (444 bytes)
//
// 4 xrefs:
// > GJMGLayer::init @ 0x10002ca68
// > GJMGLayer::init @ 0x10002cbb0
// > GJMGLayer::updateGroundWidth @ 0x10002d0c0
// > GJMGLayer::updateGroundWidth @ 0x10002d0d0
//
// 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 GJMGLayer::loadGroundSprites(GJMGLayer *a1, int a2, bool a3)
{
__int64 v3; // x8
__int64 v4; // x19
__int64 v6; // x21
__int64 v7; // x0
unsigned int v8; // w23
int v9; // w0
int v10; // w22
cocos2d::CCTexture2D *v11; // x0
cocos2d::CCSprite *v12; // x23
__n128 v13; // q0
__n128 v14; // q1
__n128 v15; // q0
__n128 v16; // q1
int v17; // w20
__int64 v18; // x0
int v19; // [xsp+8h] [xbp-38h] BYREF
v3 = 416;
if ( a3 )
v3 = 408;
v4 = *(__int64 *)((char *)&a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable + v3);
if ( v4 )
{
v6 = sub_10024A15C(a1);
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 472LL))(v4) )
{
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 472LL))(v4);
sub_10024A360(v6, v7);
}
if ( (unsigned int)sub_10024A36C(v6) != a2 )
{
v8 = sub_10024A36C(v6);
v9 = sub_10024A36C(v6);
v10 = v9;
if ( v8 >= a2 )
{
if ( v9 - a2 >= 1 )
{
v17 = v9 - a2 + 1;
do
{
if ( !(unsigned int)sub_10024A36C(v6) )
break;
v18 = sub_10024A398(v6);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v4 + 536LL))(v4, v18, 1);
sub_10024A430(v6, 1);
--v17;
}
while ( v17 > 1 );
}
}
else if ( v9 < a2 )
{
do
{
v11 = (cocos2d::CCTexture2D *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 1056LL))(v4);
v12 = cocos2d::CCSprite::createWithTexture_1(v11);
v13 = ((__n128 (__fastcall *)(__int64, cocos2d::CCSprite *))*(_QWORD *)(*(_QWORD *)v4 + 440LL))(v4, v12);
v13.n128_f32[0] = v12->m_obRect.size.width * (float)v10;
v14.n128_u32[0] = 0;
sub_100022980(v13, v14, &v19);
v15 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, int *))v12->setPosition)(v12, &v19);
v15.n128_u32[0] = 0;
v16.n128_u32[0] = 0;
sub_100022980(v15, v16, &v19);
((void (__fastcall *)(cocos2d::CCSprite *, int *))v12->setAnchorPoint)(v12, &v19);
((void (__fastcall *)(cocos2d::CCSprite *, void *))v12->setColor)(v12, &unk_100635654);
++v10;
}
while ( a2 != v10 );
}
}
}
}