//
// SlideInLayer::init from 0x2f4bf0 to 0x2f4ed6 (742 bytes)
//
// 0 xrefs:
//
// 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 SlideInLayer::init(SlideInLayer *a1)
{
cocos2d::CCDirector *v2; // r0
cocos2d::CCTouchDispatcher *v3; // r0
int v4; // r9
cocos2d::CCDirector *v5; // r0
cocos2d::CCLayer *v6; // r0
SlideInLayer_vtbl *v7; // r3
cocos2d::CCSprite *v8; // r6
void (__fastcall *setAnchorPoint)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
void (__fastcall *setScaleX)(cocos2d::CCSprite *__hidden, float); // r10
cocos2d::CCDirector *v12; // r0
int ScreenScaleFactorW; // r0
float height; // s17
cocos2d::CCDirector *v15; // r0
float v16; // s17
cocos2d::CCSprite *v17; // r0
CCMenuItemSpriteExtra *v18; // r6
cocos2d::CCMenu *m_exitButton; // r0
cocos2d::CCMenu *v20; // r0
float v21; // r1
float v22; // s15
cocos2d::CCMenu_vtbl *v23; // r3
cocos2d::CCMenu *v24; // r6
void (__fastcall *v25)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCNode *v27; // r7
void (__fastcall *v28)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
int v29; // r0
cocos2d::CCSize v30; // [sp+Ch] [bp-1Ch] BYREF
cocos2d::CCPoint v31; // [sp+14h] [bp-14h] BYREF
cocos2d::CCPoint v32; // [sp+1Ch] [bp-Ch] BYREF
*(&a1->m_closeOnHide + 1) = 1;
v2 = cocos2d::CCDirector::sharedDirector();
v3 = v2->getTouchDispatcher(v2);
cocos2d::CCTouchDispatcher::registerForcePrio(v3, a1, 2);
v32.x = 0.0;
v4 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::_ccColor4B *)&v32);
if ( v4 )
{
a1->setTouchEnabled(a1, 1);
a1->setKeypadEnabled(a1, 1);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v30, v5);
v6 = cocos2d::CCLayer::create();
v7 = a1->cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_mainLayer = v6;
v7->addChild(a1, v6);
v8 = cocos2d::CCSprite::createWithSpriteFrameName("pauseBG_001.png");
setAnchorPoint = v8->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v32, 0.5, 0.0);
setAnchorPoint(v8, &v32);
setPosition = v8->setPosition;
cocos2d::CCPoint::CCPoint(&v32, v30.width * 0.5, (float)(v30.height * 0.5) - 240.0);
setPosition(v8, &v32);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v8, -2);
setScaleX = v8->setScaleX;
v12 = cocos2d::CCDirector::sharedDirector();
ScreenScaleFactorW = cocos2d::CCDirector::getScreenScaleFactorW(v12);
((void (__fastcall *)(cocos2d::CCSprite *, int))setScaleX)(v8, ScreenScaleFactorW);
height = v30.height;
v15 = cocos2d::CCDirector::sharedDirector();
if ( COERCE_FLOAT(cocos2d::CCDirector::getScreenScaleFactorMax(v15)) != 1.0 )
{
v16 = (float)(height - 320.0) + 4.0;
if ( v16 > 0.0 )
{
v32.x = -2.8995e38;
v27 = (cocos2d::CCNode *)cocos2d::CCLayerColor::create(
(cocos2d::CCLayerColor *)&v32,
(const cocos2d::_ccColor4B *)LODWORD(v30.width),
v16,
COERCE_FLOAT(255));
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v27, -3);
v28 = v27->setPosition;
v29 = (int)v8->getPosition(v8);
cocos2d::CCPoint::CCPoint(&v32, 0.0, (float)(*(float *)(v29 + 4) - v16) + 2.0);
v28(v27, &v32);
}
}
v17 = cocos2d::CCSprite::createWithSpriteFrameName("startBtn_001.png");
a1->m_exitSprite = v17;
LODWORD(v32.x) = 652;
LODWORD(v32.y) = 1;
v18 = CCMenuItemSpriteExtra::create(v17, nullptr, (cocos2d::SEL_MenuHandler)((unsigned int)a1 | 0x28C00000000LL));
a1->m_exitButton = v18;
sub_776584((int)&v31, (char *)&unk_939830);
sub_775D40(&v18->m_activateSound, &v31);
sub_774008(&v31);
((void (__fastcall *)(CCMenuItemSpriteExtra *, int))a1->m_exitButton->setScale)(a1->m_exitButton, 1062836634);
m_exitButton = (cocos2d::CCMenu *)a1->m_exitButton;
m_exitButton->cocos2d::CCLayerRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)1062836634;
v20 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(m_exitButton, nullptr);
v21 = v30.width * 0.5;
v22 = (float)(v30.height * 0.5) + 210.0;
v23 = v20->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v24 = v20;
a1->m_buttonMenu = v20;
v25 = v23->setPosition;
cocos2d::CCPoint::CCPoint(&v31, v21, v22);
v25(v24, &v31);
cocos2d::CCPoint::CCPoint(
&v31,
0.0,
(float)((float)(v30.height * 0.5) - 240.0) - (float)((float)(v30.height - 480.0) * 0.5));
cocos2d::CCPoint::operator=(&a1->m_endPosition, &v31);
cocos2d::CCPoint::CCPoint(&v31, a1->m_endPosition.x, a1->m_endPosition.y - v30.height);
cocos2d::CCPoint::operator=(&a1->m_startPosition, &v31);
a1->customSetup(a1);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
a1->hideLayer(a1, 1);
}
return v4;
}