//
// LoadingLayer::init from 0x1001d5ff4 to 0x1001d66ac (1720 bytes)
//
// 1 xrefs:
// > LoadingLayer::create @ 0x1001d5fa8
//
// 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
//
bool __fastcall LoadingLayer::init(LoadingLayer *a1, bool a2)
{
_BOOL4 v4; // w19
FMODAudioEngine *v5; // x0
GameLevelManager *v6; // x0
cocos2d::CCTextureCache *v7; // x0
cocos2d::CCSpriteFrameCache *v8; // x0
cocos2d::CCDirector *v9; // x0
GameManager *v10; // x0
const char *BGTexture; // x0
cocos2d::CCSprite *v12; // x21
__n128 v13; // q0
__n128 v14; // q1
AppDelegate *v15; // x0
float v16; // s0
cocos2d::CCSprite *v17; // x21
__n128 v18; // q0
__n128 v19; // q1
cocos2d::CCSprite *v20; // x22
float32x2_t *v21; // x21
__n128 v22; // q1
__n128 v23; // q0
double v24; // d0
cocos2d::CCSprite *v25; // x21
__n128 v26; // q0
__n128 v27; // q1
cocos2d::CCSprite *v28; // x22
float32x2_t *v29; // x21
__n128 v30; // q0
__n128 v31; // q1
double v32; // d0
const char *LoadingString; // x0
cocos2d::CCLabelBMFont *v34; // x0
__n128 v35; // q0
cocos2d::CCLabelBMFont *m_caption; // x21
__n128 v37; // q1
float v38; // s8
char *v39; // x0
__n128 v40; // q0
__n128 v41; // q1
__n128 v42; // q0
TextArea *m_textArea; // x21
__n128 v44; // q1
__n128 v45; // q0
cocos2d::CCLabelBMFont *v46; // x21
float *v47; // x0
cocos2d::CCLabelBMFont *v48; // x21
cocos2d::CCSprite *v49; // x21
cocos2d::CCSprite *v50; // x0
cocos2d::CCTexture2D *v51; // x0
__n128 v52; // q0
cocos2d::CCSprite *m_sliderBar; // x22
__n128 v54; // q1
__n128 v55; // q0
cocos2d::CCSprite *v56; // x22
__n128 v57; // q1
unsigned __int32 v58; // s8
__n128 v59; // q1
__n128 v60; // q0
cocos2d::CCDirector *v61; // x0
cocos2d::CCActionManager *v62; // x21
cocos2d::CCDelayTime *v63; // x22
char v64; // w0
__int64 v65; // x1
__int64 v66; // x2
__int64 v67; // x3
__int64 v68; // x4
__int64 v69; // x5
__int64 v70; // x6
__int64 v71; // x7
cocos2d::CCSequence *v72; // x0
__int128 v74; // [xsp+10h] [xbp-80h] BYREF
void *__p[2]; // [xsp+20h] [xbp-70h] BYREF
char v76; // [xsp+37h] [xbp-59h]
float32x2_t v77; // [xsp+3Ch] [xbp-54h] BYREF
__int16 v78; // [xsp+44h] [xbp-4Ch] BYREF
char v79; // [xsp+46h] [xbp-4Ah]
float v80; // [xsp+48h] [xbp-48h]
float v81; // [xsp+4Ch] [xbp-44h]
cocos2d::SEL_CallFunc v82; // 0:x1.16
v4 = cocos2d::CCLayer::init(a1);
if ( v4 )
{
a1->m_fromRefresh = a2;
cocos2d::CCDirector::sharedDirector()->m_bDisplayStats = 1;
cocos2d::CCTexture2D::setDefaultAlphaPixelFormat(kCCTexture2DPixelFormat_RGBA8888);
if ( !a1->m_fromRefresh )
{
v5 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::setup(v5);
}
if ( GameManager::sharedState()->m_canGetLevelSaveData )
{
GameManager::sharedState()->m_canGetLevelSaveData = 0;
v6 = GameLevelManager::sharedState();
GameLevelManager::getLevelSaveData(v6);
}
v7 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::addImage(v7, "GJ_LaunchSheet.png", 0);
v8 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v8, "GJ_LaunchSheet.plist");
v9 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v9);
v10 = GameManager::sharedState();
BGTexture = GameManager::getBGTexture(v10, 1);
v12 = cocos2d::CCSprite::create(BGTexture);
v13 = ((__n128 (__fastcall *)(LoadingLayer *, cocos2d::CCSprite *))a1->addChild)(a1, v12);
v13.n128_f32[0] = v80 * 0.5;
v14.n128_f32[0] = v81 * 0.5;
sub_100022980(v13, v14, &v74);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *))v12->setPosition)(v12, &v74);
v15 = AppDelegate::get();
v16 = AppDelegate::bgScale(v15);
((void (__fastcall *)(cocos2d::CCSprite *, float))v12->setScale)(v12, v16);
v79 = -1;
v78 = 26112;
((void (__fastcall *)(cocos2d::CCSprite *, __int16 *))v12->setColor)(v12, &v78);
v17 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_logo_001.png");
v18 = ((__n128 (__fastcall *)(LoadingLayer *, cocos2d::CCSprite *))a1->addChild)(a1, v17);
v18.n128_f32[0] = v80 * 0.5;
v19.n128_f32[0] = (float)(v81 * 0.5) + 0.0;
sub_100022980(v18, v19, &v74);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *))v17->setPosition)(v17, &v74);
v20 = cocos2d::CCSprite::createWithSpriteFrameName("RobTopLogoBig_001.png");
((void (__fastcall *)(LoadingLayer *, cocos2d::CCSprite *))a1->addChild)(a1, v20);
v21 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v17->getPosition)(v17);
v22.n128_u32[0] = 1117782016;
v23.n128_u32[0] = 0;
sub_100022980(v23, v22, &v77);
*(float32x2_t *)&v24 = sub_1000229DC(v21, &v77, (float32x2_t *)&v74);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *, double))v20->setPosition)(v20, &v74, v24);
a1->m_unknown2 = 1;
a1->m_loadStep = 0;
v25 = cocos2d::CCSprite::createWithSpriteFrameName("cocos2DxLogo.png");
v26 = ((__n128 (__fastcall *)(LoadingLayer *, cocos2d::CCSprite *))a1->addChild)(a1, v25);
v26.n128_f32[0] = v80 + -34.0;
v27.n128_u32[0] = 13.0;
sub_100022980(v26, v27, &v74);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *))v25->setPosition)(v25, &v74);
((void (__fastcall *)(cocos2d::CCSprite *, float))v25->setScale)(v25, 0.6);
v28 = cocos2d::CCSprite::createWithSpriteFrameName("fmodLogo.png");
((void (__fastcall *)(LoadingLayer *, cocos2d::CCSprite *))a1->addChild)(a1, v28);
v29 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v25->getPosition)(v25);
v30.n128_u32[0] = 0;
v31.n128_u32[0] = 20.0;
sub_100022980(v30, v31, &v77);
*(float32x2_t *)&v32 = sub_1000229DC(v29, &v77, (float32x2_t *)&v74);
((void (__fastcall *)(cocos2d::CCSprite *, __int128 *, double))v28->setPosition)(v28, &v74, v32);
((void (__fastcall *)(cocos2d::CCSprite *, float))v28->setScale)(v28, 0.6);
((void (__fastcall *)(cocos2d::CCSprite *, void *))v28->setColor)(v28, &unk_10063A17E);
LoadingString = LoadingLayer::getLoadingString(a1);
v34 = cocos2d::CCLabelBMFont::create_1(LoadingString, "goldFont.fnt");
a1->m_caption = v34;
v35 = ((__n128 (__fastcall *)(LoadingLayer *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v34);
m_caption = a1->m_caption;
v35.n128_f32[0] = v80 * 0.5;
v37.n128_f32[0] = (float)(v81 * 0.5) + -70.0;
sub_100022980(v35, v37, &v74);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int128 *))m_caption->setPosition)(m_caption, &v74);
v38 = 0.7;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))a1->m_caption->setScale)(a1->m_caption, 0.7);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_caption->setVisible)(a1->m_caption, 0);
v39 = (char *)LoadingLayer::getLoadingString(a1);
sub_100009900(__p, v39);
v40.n128_u32[0] = 0.5;
v41.n128_u32[0] = 0.5;
sub_100022980(v40, v41, &v74);
a1->m_textArea = (TextArea *)TextArea::create(
(__int64)__p,
(__int64)"goldFont.fnt",
(__int64 *)&v74,
0,
1.0,
440.0,
28.0);
if ( v76 < 0 )
operator delete(__p[0]);
v42 = ((__n128 (__fastcall *)(LoadingLayer *))a1->addChild)(a1);
m_textArea = a1->m_textArea;
v42.n128_f32[0] = v80 * 0.5;
v44.n128_f32[0] = (float)(v81 * 0.5) + -100.0;
sub_100022980(v42, v44, &v74);
((void (__fastcall *)(TextArea *, __int128 *))m_textArea->setPosition)(m_textArea, &v74);
((void (__fastcall *)(TextArea *, float))a1->m_textArea->setScale)(a1->m_textArea, 0.7);
v45.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_caption->getContentSize)(a1->m_caption);
if ( v45.n128_f32[0] > 300.0 )
{
v46 = a1->m_caption;
v47 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v46->getContentSize)(
v46,
v45.n128_f32[0]);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v46->setScale)(v46, 300.0 / *v47);
}
v48 = a1->m_caption;
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v48->getScale)(v48, v45) < 0.7 )
v38 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_caption->getScale)(a1->m_caption);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v48->setScale)(v48, v38);
v49 = cocos2d::CCSprite::create("slidergroove.png");
((void (__fastcall *)(LoadingLayer *, cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v49, 3);
v50 = cocos2d::CCSprite::create("sliderBar.png");
a1->m_sliderBar = v50;
a1->m_sliderGrooveXPos = v49->m_obRect.size.width + -4.0;
a1->m_sliderGrooveHeight = 8.0;
v74 = xmmword_100636BB0;
v51 = (cocos2d::CCTexture2D *)((__int64 (__fastcall *)(cocos2d::CCSprite *))v50->getTexture)(v50);
cocos2d::CCTexture2D::setTexParameters(v51, (cocos2d::ccTexParams *)&v74);
v52 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSprite *, __int64))v49->addChild_0)(
v49,
a1->m_sliderBar,
0xFFFFFFFFLL);
m_sliderBar = a1->m_sliderBar;
v52.n128_u32[0] = 0;
v54.n128_u32[0] = 0;
sub_100022980(v52, v54, &v77);
v55 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))m_sliderBar->setAnchorPoint)(m_sliderBar, &v77);
v56 = a1->m_sliderBar;
v55.n128_u32[0] = 2.0;
v57.n128_u32[0] = 4.0;
sub_100022980(v55, v57, &v77);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))v56->setPosition)(v56, &v77);
v58 = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_caption->getPosition)(a1->m_caption);
v59.n128_f32[0] = *(float *)(((__int64 (__fastcall *)(TextArea *))a1->m_textArea->getPosition)(a1->m_textArea) + 4)
+ 40.0;
v60.n128_u32[0] = v58;
sub_100022980(v60, v59, &v77);
((void (__fastcall *)(cocos2d::CCSprite *, float32x2_t *))v49->setPosition)(v49, &v77);
LoadingLayer::updateProgress(a1, 0);
v61 = cocos2d::CCDirector::sharedDirector();
v62 = (cocos2d::CCActionManager *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v61->getActionManager)(v61);
v63 = cocos2d::CCDelayTime::create(0.0);
v82.ptr = (void (*)(void))LoadingLayer::loadAssets;
v82.adj = 0;
v64 = (unsigned __int8)cocos2d::CCCallFunc::create(a1, v82);
v72 = sub_10018A494(v63, v65, v66, v67, v68, v69, v70, v71, v64);
cocos2d::CCActionManager::addAction(v62, v72, a1, 0);
}
return v4;
}