//
// SlideInLayer::init from 0x10028e5d0 to 0x10028e956 (902 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008f5e08
//
// 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 SlideInLayer::init(SlideInLayer *a1)
{
cocos2d::CCDirector *v2; // rax
cocos2d::CCTouchDispatcher *v3; // rax
bool result; // al
bool v5; // r12
cocos2d::CCLayer *v6; // rax
cocos2d::CCSprite *v7; // r14
cocos2d::CCDirector *v8; // rax
cocos2d::CCDirector *v9; // rax
double v10; // xmm1_8
cocos2d::CCLayerColor *v11; // r15
cocos2d::CCSprite *v12; // rax
CCMenuItemSpriteExtra *v13; // rax
CCMenuItemSpriteExtra *m_exitButton; // rdi
int v15; // edx
int v16; // ecx
int v17; // r8d
int v18; // r9d
cocos2d::CCMenu *v19; // r14
double v20; // xmm0_8
std::string __str; // [rsp+0h] [rbp-50h] BYREF
double v22; // [rsp+1Ch] [rbp-34h] BYREF
float v23; // [rsp+24h] [rbp-2Ch]
float v24; // [rsp+28h] [rbp-28h] BYREF
float v25; // [rsp+2Ch] [rbp-24h]
double v26; // 0:xmm0_8.8
*(&a1->m_closeOnHide + 1) = 1;
v2 = cocos2d::CCDirector::sharedDirector();
v3 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v2->getTouchDispatcher)(v2);
cocos2d::CCTouchDispatcher::registerForcePrio(v3, a1, 2);
v24 = 0.0;
result = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::ccColor4B *)&v24);
if ( result )
{
v5 = result;
((void (__fastcall *)(SlideInLayer *, __int64))a1->setTouchEnabled)(a1, 1);
((void (__fastcall *)(SlideInLayer *, __int64))a1->setKeypadEnabled)(a1, 1);
cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v26 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v24);
v6 = cocos2d::CCLayer::create();
a1->m_mainLayer = v6;
((void (__fastcall *)(SlideInLayer *, cocos2d::CCLayer *, double))a1->addChild)(a1, v6, v26);
v7 = cocos2d::CCSprite::createWithSpriteFrameName("pauseBG_001.png");
sub_10028CBE0((float *)&v22, 0.5, 0.0);
((void (__fastcall *)(cocos2d::CCSprite *, double *))v7->setAnchorPoint)(v7, &v22);
sub_10028CBE0((float *)&v22, v24 * 0.5, (float)(v25 * 0.5) + -240.0);
((void (__fastcall *)(cocos2d::CCSprite *, double *))v7->setPosition)(v7, &v22);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v7,
4294967294LL);
v8 = cocos2d::CCDirector::sharedDirector();
*(float *)&v26 = sub_100484D60(v8);
((void (__fastcall *)(cocos2d::CCSprite *, float))v7->setScaleX)(v7, *(float *)&v26);
v23 = v25;
v9 = cocos2d::CCDirector::sharedDirector();
*(float *)&v26 = sub_100484D40(v9);
*(_QWORD *)&v10 = LODWORD(v23);
if ( *(float *)&v26 != 1.0 )
{
*(float *)&v10 = (float)(v23 + -320.0) + 4.0;
if ( *(float *)&v10 > 0.0 )
{
LODWORD(v22) = -10870016;
v23 = (float)(v23 + -320.0) + 4.0;
v11 = cocos2d::CCLayerColor::create((const cocos2d::ccColor4B *)&v22, v24, *(float *)&v10);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLayerColor *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v11,
4294967293LL);
*(_QWORD *)&v10 = *(unsigned int *)(((__int64 (__fastcall *)(cocos2d::CCSprite *))v7->getPosition)(v7) + 4);
*(float *)&v10 = (float)(*(float *)&v10 - v23) + 2.0;
sub_10028CBE0((float *)&v22, 0.0, *(float *)&v10);
((void (__fastcall *)(cocos2d::CCLayerColor *, double *))v11->setPosition)(v11, &v22);
}
}
v12 = cocos2d::CCSprite::createWithSpriteFrameName("startBtn_001.png");
a1->m_exitSprite = v12;
v13 = CCMenuItemSpriteExtra::create(v12, nullptr, a1, (cocos2d::SEL_MenuHandler)0x519uLL);
a1->m_exitButton = v13;
*(_WORD *)&__str.__r_.__value_.__l.0 = 0;
std::string::operator=((std::string *)&v13->m_activateSound, &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float, double))a1->m_exitButton->setScale)(
a1->m_exitButton,
0.85000002,
v10);
m_exitButton = a1->m_exitButton;
m_exitButton->m_baseScale = 0.85000002;
v19 = (cocos2d::CCMenu *)sub_100792C50((_DWORD)m_exitButton, 0, v15, v16, v17, v18);
a1->m_buttonMenu = v19;
sub_10028CBE0((float *)&v22, v24 * 0.5, (float)(v25 * 0.5) + 210.0);
((void (__fastcall *)(cocos2d::CCMenu *, double *))v19->setPosition)(v19, &v22);
sub_10028CBE0((float *)&v22, 0.0, (float)((float)(v25 * 0.5) + -240.0) - (float)((float)(v25 + -480.0) * 0.5));
sub_10028CC90(&a1->m_endPosition, &v22);
sub_10028CBE0((float *)&v22, a1->m_endPosition.x, a1->m_endPosition.y - v25);
v20 = sub_10028CC90(&a1->m_startPosition, &v22);
((void (__fastcall *)(SlideInLayer *, double))a1->customSetup)(a1, v20);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
a1->m_buttonMenu,
10);
((void (__fastcall *)(SlideInLayer *, __int64))a1->hideLayer)(a1, 1);
return v5;
}
return result;
}