//
// LoadingLayer::init from 0x10026e548 to 0x10026ec04 (1724 bytes)
//
// 1 xrefs:
// > LoadingLayer::create @ 0x10026e4fc
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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:01:45 +0000
//
bool __fastcall LoadingLayer::init(__int64 a1, char a2)
{
_BOOL8 v4; // x19
__int64 v5; // x0
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x0
void *v9; // x0
_DWORD *v10; // x0
__int64 v11; // x0
__int64 v12; // x0
__int64 v13; // x0
__int64 v14; // x0
__int64 BGTexture; // x0
__int64 v16; // x21
__int64 v17; // x0
__int64 v18; // x0
__int64 v19; // x21
__int64 v20; // x22
float32x2_t *v21; // x21
double v22; // d0
__int64 v23; // x21
__int64 v24; // x22
float32x2_t *v25; // x21
double v26; // d0
const char *LoadingString; // x0
__int64 v28; // x0
__int64 v29; // x21
float v30; // s8
char *v31; // x0
__int64 v32; // x21
__n128 v33; // q0
__int64 v34; // x21
float *v35; // x0
__int64 v36; // x21
float *v37; // x21
__int64 v38; // x0
unsigned int *v39; // x0
__int64 v40; // x22
__int64 v41; // x22
float v42; // s8
__int64 v43; // x0
__int64 v44; // x0
__int64 v45; // x21
float *v46; // x22
char v47; // w0
__int64 v48; // x1
__int64 v49; // x2
__int64 v50; // x3
__int64 v51; // x4
__int64 v52; // x5
__int64 v53; // x6
__int64 v54; // x7
__int64 v55; // x0
__int128 v57; // [xsp+10h] [xbp-80h] BYREF
void *__p[2]; // [xsp+20h] [xbp-70h] BYREF
char v59; // [xsp+37h] [xbp-59h]
float32x2_t v60; // [xsp+3Ch] [xbp-54h] BYREF
__int16 v61; // [xsp+44h] [xbp-4Ch] BYREF
char v62; // [xsp+46h] [xbp-4Ah]
__int64 v63; // [xsp+48h] [xbp-48h] BYREF
v4 = cocos2d::CCLayer::init((_WORD *)a1);
if ( v4 )
{
*(_BYTE *)(a1 + 448) = a2;
*(_BYTE *)(cocos2d::CCDirector::sharedDirector() + 217) = 1;
v5 = cocos2d::CCTexture2D::setDefaultAlphaPixelFormat(0);
if ( (*(_BYTE *)(a1 + 448) & 1) == 0 )
{
v6 = FMODAudioEngine::sharedEngine();
v5 = FMODAudioEngine::setup(v6);
}
v7 = GameManager::sharedState(v5);
if ( *(_BYTE *)(v7 + 1052) == 1 )
{
*(_BYTE *)(GameManager::sharedState(v7) + 1052) = 0;
v8 = GameLevelManager::sharedState();
GameLevelManager::getLevelSaveData(v8);
}
v9 = cocos2d::CCTextureCache::sharedTextureCache();
v10 = cocos2d::CCTextureCache::addImage((__int64)v9, "GJ_LaunchSheet.png");
v11 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v10);
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v11, "GJ_LaunchSheet.plist");
v12 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v12, &v63);
v14 = GameManager::sharedState(v13);
BGTexture = GameManager::getBGTexture(v14, 1);
v16 = cocos2d::CCSprite::create(BGTexture);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v16);
sub_1000262BC((float *)&v57, *(float *)&v63 * 0.5, *((float *)&v63 + 1) * 0.5);
v17 = (*(__int64 (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v16 + 184LL))(v16, &v57);
v18 = AppDelegate::get(v17);
AppDelegate::bgScale(v18);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v16 + 160LL))(v16);
v62 = -1;
v61 = 26112;
(*(void (__fastcall **)(__int64, __int16 *))(*(_QWORD *)v16 + 960LL))(v16, &v61);
v19 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_logo_001.png");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v19);
sub_1000262BC((float *)&v57, *(float *)&v63 * 0.5, (float)(*((float *)&v63 + 1) * 0.5) + 0.0);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v19 + 184LL))(v19, &v57);
v20 = cocos2d::CCSprite::createWithSpriteFrameName("RobTopLogoBig_001.png");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v20);
v21 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v19 + 192LL))(v19);
sub_1000262BC((float *)&v60, 0.0, 80.0);
*(float32x2_t *)&v22 = sub_100026318(v21, &v60, (float32x2_t *)&v57);
(*(void (__fastcall **)(__int64, __int128 *, double))(*(_QWORD *)v20 + 184LL))(v20, &v57, v22);
*(_BYTE *)(a1 + 405) = 1;
*(_DWORD *)(a1 + 408) = 0;
v23 = cocos2d::CCSprite::createWithSpriteFrameName("cocos2DxLogo.png");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v23);
sub_1000262BC((float *)&v57, *(float *)&v63 + -34.0, 13.0);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v23 + 184LL))(v23, &v57);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v23 + 160LL))(v23, 0.6);
v24 = cocos2d::CCSprite::createWithSpriteFrameName("fmodLogo.png");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v24);
v25 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v23 + 192LL))(v23);
sub_1000262BC((float *)&v60, 0.0, 20.0);
*(float32x2_t *)&v26 = sub_100026318(v25, &v60, (float32x2_t *)&v57);
(*(void (__fastcall **)(__int64, __int128 *, double))(*(_QWORD *)v24 + 184LL))(v24, &v57, v26);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v24 + 160LL))(v24, 0.6);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v24 + 960LL))(v24, &unk_100762E56);
LoadingString = (const char *)LoadingLayer::getLoadingString(a1);
v28 = cocos2d::CCLabelBMFont::create_1(LoadingString, "goldFont.fnt");
*(_QWORD *)(a1 + 416) = v28;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v28);
v29 = *(_QWORD *)(a1 + 416);
sub_1000262BC((float *)&v57, *(float *)&v63 * 0.5, (float)(*((float *)&v63 + 1) * 0.5) + -70.0);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v29 + 184LL))(v29, &v57);
v30 = 0.7;
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 416) + 160LL))(*(_QWORD *)(a1 + 416), 0.7);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 416) + 344LL))(*(_QWORD *)(a1 + 416), 0);
v31 = (char *)LoadingLayer::getLoadingString(a1);
sub_100009900(__p, v31);
sub_1000262BC((float *)&v57, 0.5, 0.5);
*(_QWORD *)(a1 + 424) = TextArea::create(
(__int64)__p,
(__int64)"goldFont.fnt",
(double *)&v57,
0,
0,
1.0,
440.0,
28.0);
if ( v59 < 0 )
operator delete(__p[0]);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 456LL))(a1);
v32 = *(_QWORD *)(a1 + 424);
sub_1000262BC((float *)&v57, *(float *)&v63 * 0.5, (float)(*((float *)&v63 + 1) * 0.5) + -100.0);
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v32 + 184LL))(v32, &v57);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 424) + 160LL))(*(_QWORD *)(a1 + 424), 0.7);
v33.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 328LL))(*(_QWORD *)(a1 + 416));
if ( v33.n128_f32[0] > 300.0 )
{
v34 = *(_QWORD *)(a1 + 416);
v35 = (float *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v34 + 328LL))(v34, v33.n128_f32[0]);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v34 + 160LL))(v34, 300.0 / *v35);
}
v36 = *(_QWORD *)(a1 + 416);
if ( (*(float (__fastcall **)(__int64, __n128))(*(_QWORD *)v36 + 168LL))(v36, v33) < 0.7 )
v30 = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 168LL))(*(_QWORD *)(a1 + 416));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v36 + 160LL))(v36, v30);
v37 = (float *)cocos2d::CCSprite::create("slidergroove.png");
(*(void (__fastcall **)(__int64, float *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v37, 3);
v38 = cocos2d::CCSprite::create("sliderBar.png");
*(_QWORD *)(a1 + 432) = v38;
*(float *)(a1 + 440) = v37[108] + -4.0;
*(_DWORD *)(a1 + 444) = 1090519040;
v57 = xmmword_10075DE40;
v39 = (unsigned int *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v38 + 1072LL))(v38);
cocos2d::CCTexture2D::setTexParameters(v39, (GLint *)&v57);
(*(void (__fastcall **)(float *, _QWORD, __int64))(*(_QWORD *)v37 + 464LL))(
v37,
*(_QWORD *)(a1 + 432),
0xFFFFFFFFLL);
v40 = *(_QWORD *)(a1 + 432);
sub_1000262BC((float *)&v60, 0.0, 0.0);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v40 + 296LL))(v40, &v60);
v41 = *(_QWORD *)(a1 + 432);
sub_1000262BC((float *)&v60, 2.0, 4.0);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v41 + 184LL))(v41, &v60);
v42 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 416) + 192LL))(*(_QWORD *)(a1 + 416));
v43 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 424) + 192LL))(*(_QWORD *)(a1 + 424));
sub_1000262BC((float *)&v60, v42, *(float *)(v43 + 4) + 40.0);
(*(void (__fastcall **)(float *, float32x2_t *))(*(_QWORD *)v37 + 184LL))(v37, &v60);
LoadingLayer::updateProgress(a1, 0);
v44 = cocos2d::CCDirector::sharedDirector();
v45 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v44 + 144LL))(v44);
v46 = cocos2d::CCDelayTime::create(0.0);
v47 = (unsigned __int8)cocos2d::CCCallFunc::create(a1, (__int64)LoadingLayer::loadAssets, 0);
v55 = sub_10021D420((__int64)v46, v48, v49, v50, v51, v52, v53, v54, v47);
cocos2d::CCActionManager::addAction(v45, v55, a1, 0);
}
return v4;
}