//
// GJPathsLayer::init from 0x6d2b08 to 0x6d2e98 (912 bytes)
//
// 1 xrefs:
// > GJPathsLayer::create @ 0x6d1b70
//
// 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:57:04 +0000
//
int __fastcall GJPathsLayer::init(GJPathsLayer *this)
{
cocos2d::CCTextureCache *v2; // r0
cocos2d::CCSpriteFrameCache *v3; // r0
cocos2d::CCSpriteFrameCache *v4; // r0
GameStatsManager *v5; // r0
GameStatsManager *v6; // r0
int v7; // r1
char *v8; // r2
int v9; // r3
int v10; // r8
cocos2d::CCDirector *v11; // r0
cocos2d::CCLayer *WinSize; // r0
int v13; // r0
int v14; // r3
const char *v15; // r1
int v16; // r7
void (__fastcall *v17)(int, _BYTE *); // r9
const char *v18; // r1
int v19; // r0
cocos2d::CCMenu *v20; // r7
int v21; // r0
float v22; // s14
float v23; // s15
int v24; // r7
void (__fastcall *v25)(int, _BYTE *); // r9
const char *v26; // r1
int v27; // r7
void (__fastcall *v28)(int, _BYTE *); // r9
const char *v29; // r1
int v30; // r7
void (__fastcall *v31)(int, _BYTE *); // r9
const char *v32; // r1
int v33; // r7
void (__fastcall *v34)(int, _BYTE *); // r9
int v35; // r9
int v36; // r1
int *v37; // r6
int v38; // r6
float v39; // s16
float v40; // s17
float v41; // r0
void (__fastcall *v43)(int, _BYTE *); // [sp+Ch] [bp-50h]
cocos2d::CCPoint *v44; // [sp+14h] [bp-48h]
float v45; // [sp+1Ch] [bp-40h] BYREF
float v46; // [sp+20h] [bp-3Ch]
_BYTE v47[8]; // [sp+24h] [bp-38h] BYREF
int (__fastcall *v48)(GJPathsLayer *, cocos2d::CCObject *); // [sp+2Ch] [bp-30h]
int v49; // [sp+30h] [bp-2Ch]
_DWORD (*v50)(GJPathsLayer *__hidden, cocos2d::CCObject *); // [sp+34h] [bp-28h]
int v51; // [sp+38h] [bp-24h]
_BYTE v52[8]; // [sp+3Ch] [bp-20h] BYREF
_BYTE v53[8]; // [sp+44h] [bp-18h] BYREF
_BYTE v54[8]; // [sp+4Ch] [bp-10h] BYREF
v2 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(this);
v3 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCTextureCache::addImage(v2, "GJ_PathSheet.png", 0);
v4 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v3);
v5 = (GameStatsManager *)cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v4, "GJ_PathSheet.plist");
*((_BYTE *)this + 528) = 1;
v6 = (GameStatsManager *)GameStatsManager::sharedState(v5);
GameStatsManager::trySelectActivePath(v6, v7, v8, v9);
FLAlertLayer::incrementForcePrio(this);
v54[0] = 0;
v54[1] = 0;
v54[2] = 0;
v54[3] = -81;
v10 = cocos2d::CCLayerColor::initWithColor(this, v54);
if ( v10 )
{
(*(void (__fastcall **)(GJPathsLayer *, int))(*(_DWORD *)this + 500))(this, 1);
v11 = (cocos2d::CCDirector *)(*(int (__fastcall **)(GJPathsLayer *, int))(*(_DWORD *)this + 536))(this, 1);
cocos2d::CCDirector::sharedDirector(v11);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v45);
v13 = cocos2d::CCLayer::create(WinSize);
v14 = *(_DWORD *)this;
*((_DWORD *)this + 115) = v13;
(*(void (__fastcall **)(GJPathsLayer *, int))(v14 + 228))(this, v13);
v16 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"pathSelectBG_001.png", v15);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v16, -1);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v16 + 80))(v16, 1067030938);
v17 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v16 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v54, v45 * 0.5, v46 * 0.5);
v17(v16, v54);
*((_DWORD *)this + 125) = -1;
v19 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v18);
v48 = GJPathsLayer::onClose;
v49 = 0;
*((_DWORD *)this + 131) = v19;
v20 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v19, 0, (int)this, (int)GJPathsLayer::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult((int)v20, 1.6);
v21 = cocos2d::CCMenu::create(v20, nullptr);
v22 = v45;
v23 = (float)(v46 * 0.5) + 130.0;
*((_DWORD *)this + 111) = v21;
v24 = v21;
v25 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v21 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v54, (float)((float)(v22 * 0.5) - 130.0) + 10.0, v23 - 10.0);
v25(v24, v54);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(**((_DWORD **)this + 115) + 232))(
*((_DWORD *)this + 115),
*((_DWORD *)this + 111),
10);
v27 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"label_paths_001.png", v26);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v27, 20);
v28 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v27 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v54, v45 * 0.5, (float)(v46 * 0.5) + 29.0);
v28(v27, v54);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v27 + 80))(v27, 1061997773);
v30 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"label_of_001.png", v29);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v30, 20);
v31 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v30 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v54, v45 * 0.5, v46 * 0.5);
v31(v30, v54);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v30 + 80))(v30, 1061997773);
v33 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"label_power_001.png", v32);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v33, 20);
v34 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v33 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v54, v45 * 0.5, (float)(v46 * 0.5) - 34.0);
v34(v33, v54);
v35 = 0;
(*(void (__fastcall **)(int, int))(*(_DWORD *)v33 + 80))(v33, 1061997773);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, v45 * 0.5, v46 * 0.5);
do
{
v37 = GJPathSprite::create((GJPathSprite *)(v35 + 1), v36);
GJPathSprite::updateState((GJPathSprite *)v37);
v50 = GJPathsLayer::onPath;
v51 = 0;
v38 = CCMenuItemSpriteExtra::create((int)v37, 0, (int)this, (int)GJPathsLayer::onPath, 0);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v38 + 36))(v38, v35 + 1);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v38);
v39 = (float)(90.0 - (float)((float)v35 * 36.0)) * 0.0174532925;
v40 = cosf(v39);
v41 = sinf(v39);
v43 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v38 + 92);
v44 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v54, v40 * 100.0, v41 * 100.0);
cocos2d::CCPoint::operator+(v53, v47, v54);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v52, v44);
v43(v38, v52);
++v35;
}
while ( v35 != 10 );
}
return v10;
}