//
// GJMGLayer::updateGroundWidth from 0x546ccc to 0x546d84 (184 bytes)
//
// 1 xrefs:
// > GJMGLayer::scaleGround @ 0x546dc6
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:52:23 +0000
//
cocos2d::CCArray *__fastcall GJMGLayer::updateGroundWidth(GJMGLayer *this, float a2, float a3, float a4)
{
cocos2d::CCArray *result; // r0
int v6; // r0
int v7; // r3
int v8; // r0
float v9; // r0
float v10; // s15
float v11; // s14
unsigned int v12; // r5
float v13[3]; // [sp+4h] [bp-Ch] BYREF
v13[0] = a2;
v13[1] = a3;
v13[2] = a4;
result = (cocos2d::CCArray *)(*(int (__fastcall **)(GJMGLayer *))(*(_DWORD *)this + 256))(this);
if ( result )
{
cocos2d::CCDirector::sharedDirector(result);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v13);
v6 = (*(int (__fastcall **)(GJMGLayer *))(*(_DWORD *)this + 256))(this);
v7 = *(_DWORD *)this;
if ( v6 )
{
(*(void (__fastcall **)(GJMGLayer *))(v7 + 68))(this);
}
else
{
v8 = (*(int (__fastcall **)(GJMGLayer *))(v7 + 256))(this);
(*(void (__fastcall **)(int))(*(_DWORD *)v8 + 84))(v8);
}
v9 = (*(float (__fastcall **)(GJMGLayer *))(*(_DWORD *)this + 68))(this);
v10 = (float)(v13[0] / v9) + 10.0;
v11 = *((float *)this + 81);
*((float *)this + 84) = v10;
v12 = (int)(float)(ceilf(v10 / v11) + 1.0);
if ( *((_BYTE *)this + 348) )
++v12;
GJMGLayer::loadGroundSprites(this, v12, 1);
return GJMGLayer::loadGroundSprites(this, v12, 0);
}
return result;
}