//
// GJGroundLayer::createLine from 0x545d48 to 0x545ea0 (344 bytes)
//
// 1 xrefs:
// > GJGroundLayer::init @ 0x545f18
//
// 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
//
int __fastcall GJGroundLayer::createLine(GJGroundLayer *this, int a2)
{
cocos2d::CCDirector *v4; // r0
int v5; // r1
float v6; // r7
cocos2d::CCString *v7; // r0
cocos2d::CCSprite *CString; // r0
const char *v9; // r1
int v10; // r0
int v11; // r3
int v12; // r8
void (__fastcall *v13)(int, _DWORD *); // r9
int v14; // r7
void (__fastcall *v15)(int, _DWORD *); // r8
int result; // r0
float v17[2]; // [sp+4h] [bp-18h] BYREF
_DWORD v18[2]; // [sp+Ch] [bp-10h] BYREF
v4 = *((cocos2d::CCDirector **)this + 82);
if ( v4 )
{
v4 = (cocos2d::CCDirector *)(*(int (__fastcall **)(cocos2d::CCDirector *))(*(_DWORD *)v4 + 260))(v4);
*((_DWORD *)this + 82) = 0;
}
v5 = a2;
if ( a2 < 1 )
v5 = 1;
if ( v5 >= 3 )
v5 = 3;
*((_DWORD *)this + 85) = v5;
if ( v5 == 1 )
v6 = 0.5;
else
v6 = 0.2;
cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v17);
if ( *((_DWORD *)this + 85) == 1 )
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"floorLine_%02d_001.png",
(_BYTE *)&dword_0 + 1);
else
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"floorLine_%02d_001.png",
(const char *)&dword_0 + 2);
CString = (cocos2d::CCSprite *)cocos2d::CCString::getCString(v7);
v10 = cocos2d::CCSprite::createWithSpriteFrameName(CString, v9);
v11 = *(_DWORD *)this;
*((_DWORD *)this + 82) = v10;
(*(void (__fastcall **)(GJGroundLayer *, int, int))(v11 + 232))(this, v10, 5);
v12 = *((_DWORD *)this + 82);
v13 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v12 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, v17[0] * 0.5, v6);
v13(v12, v18);
v14 = *((_DWORD *)this + 82);
v15 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v14 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, 0.5, 1.0);
v15(v14, v18);
result = (*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 82) + 36))(*((_DWORD *)this + 82), 2);
if ( *((_BYTE *)this + 333) )
{
v18[0] = 770;
v18[1] = 1;
result = (*(int (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 82) + 540))(*((_DWORD *)this + 82), 770, 1);
}
if ( *((int *)this + 85) > 1 )
result = (*(int (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 82) + 64))(
*((_DWORD *)this + 82),
(float)(v17[0] + 10.0) / *(float *)(*((_DWORD *)this + 82) + 344));
if ( *((_DWORD *)this + 85) == 3 )
return (*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 82) + 72))(*((_DWORD *)this + 82), 0x40000000);
return result;
}