//
// GJMGLayer::updateGroundWidth from 0x43536c to 0x435424 (184 bytes)
//
// 1 xrefs:
// > GJMGLayer::scaleGround @ 0x435466
//
// 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::updateGroundWidth(GJMGLayer *a1, bool a2)
{
cocos2d::CCDirector *v3; // r0
cocos2d::CCNode *v4; // r0
GJMGLayer_vtbl *v5; // r3
int v6; // r0
float v7; // r0
float v8; // s15
float m_textureWidth; // s14
int v10; // r5
cocos2d::CCSize v11; // [sp+4h] [bp-Ch] BYREF
LODWORD(v11.width) = a2;
if ( a1->getParent(a1) )
{
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v11, v3);
v4 = a1->getParent(a1);
v5 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( v4 )
{
v5->getScaleX(a1);
}
else
{
v6 = (int)v5->getParent(a1);
(*(void (__fastcall **)(int))(*(_DWORD *)v6 + 84))(v6);
}
v7 = a1->getScaleX(a1);
v8 = (float)(v11.width / v7) + 10.0;
m_textureWidth = a1->m_textureWidth;
a1->m_groundWidth = v8;
v10 = (int)(float)(ceilf(v8 / m_textureWidth) + 1.0);
if ( a1->m_cameraRotated )
++v10;
GJMGLayer::loadGroundSprites(a1, v10, 1);
GJMGLayer::loadGroundSprites(a1, v10, 0);
}
}