//
// MoreVideoOptionsLayer::init from 0x8f1abc to 0x8f1f44 (1160 bytes)
//
// 3 xrefs:
// > MoreVideoOptionsLayer::create @ 0x8f2094
// > ??> @ 0xdf330
// > ??> @ 0x1460980
//
// 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 12:56:58 +0000
//
__int64 __fastcall MoreVideoOptionsLayer::init(MoreVideoOptionsLayer *this)
{
GameManager *v2; // x0
unsigned int v3; // w23
GameManager *v5; // x0
cocos2d::CCDirector *v6; // x0
cocos2d::CCDirector *v7; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v9; // x0
__int64 v10; // x24
void (__fastcall *v11)(__int64, _BYTE *); // x25
void (__fastcall *v12)(__int64, _BYTE *); // x25
const char *v13; // x2
__int64 v14; // x24
void (__fastcall *v15)(__int64, _BYTE *); // x25
cocos2d::CCObject *v16; // x0
cocos2d::CCDictionary *v17; // x0
cocos2d::CCObject *v18; // x0
cocos2d::CCMenu *v19; // x0
__int64 v20; // x0
const char *v21; // x1
__int64 v22; // x0
__int64 v23; // x24
cocos2d::CCNode *v24; // x26
void (__fastcall *v25)(__int64, __int64 *); // x25
float v26; // s8
const char *v27; // x1
__int64 v28; // x0
__int64 v29; // x0
cocos2d::CCDirector **v30; // x25
cocos2d::CCNode *v31; // x27
void (__fastcall *v32)(cocos2d::CCDirector **, __int64 *); // x26
cocos2d::CCDirector *v33; // x0
float v34; // s0
const char *v35; // x1
cocos2d::CCSprite *v36; // x24
__int64 v37; // x0
cocos2d::CCDirector **v38; // x24
cocos2d::CCNode *v39; // x26
void (__fastcall *v40)(cocos2d::CCDirector **, __int64 *); // x25
cocos2d::CCDirector *v41; // x0
float v42; // s0
__int64 v43; // [xsp+78h] [xbp+78h] BYREF
__int64 v44; // [xsp+80h] [xbp+80h] BYREF
_BYTE v45[16]; // [xsp+88h] [xbp+88h] BYREF
v45[0] = 0;
v45[1] = 0;
v45[2] = 0;
v45[3] = 75;
v2 = (GameManager *)(unsigned __int8)cocos2d::CCLayerColor::initWithColor(this, v45);
v3 = (unsigned __int8)v2;
if ( (_BYTE)v2 )
{
v5 = (GameManager *)GameManager::sharedState(v2);
if ( (unsigned __int8)GameManager::getGameVariable(v5, "0168") )
*((_BYTE *)this + 596) = 1;
FLAlertLayer::incrementForcePrio(this);
(*(void (__fastcall **)(MoreVideoOptionsLayer *, __int64))(*(_QWORD *)this + 1000LL))(this, 1);
v6 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(MoreVideoOptionsLayer *, __int64))(*(_QWORD *)this + 1072LL))(
this,
1);
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v43, v7);
v9 = cocos2d::CCLayer::create(WinSize);
*((_QWORD *)this + 73) = v9;
(*(void (__fastcall **)(MoreVideoOptionsLayer *, __int64))(*(_QWORD *)this + 456LL))(this, v9);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v45, 0.0, 0.0, 80.0, 80.0);
v10 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v45);
v11 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v10 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v45, 360.0, 260.0);
v11(v10, v45);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v10,
0xFFFFFFFFLL);
v12 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v10 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, *(float *)&v43 * 0.5, *((float *)&v43 + 1) * 0.5);
v12(v10, v45);
v14 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Advanced Video Options", "bigFont.fnt", v13);
v15 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v14 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v45,
*(float *)&v43 * 0.5,
(float)((float)(*((float *)&v43 + 1) * 0.5) + 130.0) - 16.0);
v15(v14, v45);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v14);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v14 + 160LL))(v14, 0.6);
*((_DWORD *)this + 160) = -1;
v16 = (cocos2d::CCObject *)cocos2d::CCDictionary::create((cocos2d::CCDictionary *)0xFFFFFFFFLL);
*((_QWORD *)this + 85) = v16;
v17 = (cocos2d::CCDictionary *)cocos2d::CCObject::retain(v16);
v18 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v17);
*((_QWORD *)this + 84) = v18;
v19 = (cocos2d::CCMenu *)cocos2d::CCObject::retain(v18);
v20 = cocos2d::CCMenu::create(v19);
*((_QWORD *)this + 69) = v20;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v20,
10);
MoreVideoOptionsLayer::addToggle(
this,
"Smooth Fix",
"0023",
"Makes some optimizations that can reduce lag. Disable if game speed becomes inconsistent.");
MoreVideoOptionsLayer::addToggle(this, "Show FPS", "0115", "Shows frames per second while playing.");
v22 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v21);
v23 = CCMenuItemSpriteExtra::create(v22, 0, (__int64)this, (__int64)MoreVideoOptionsLayer::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult(v23, 1.5);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v23);
v24 = *((cocos2d::CCNode **)this + 69);
v25 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v23 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v45,
(float)((float)(*(float *)&v43 * 0.5) + -180.0) + 5.0,
(float)((float)(*((float *)&v43 + 1) * 0.5) + 130.0) - 5.0);
cocos2d::CCNode::convertToNodeSpace(&v44, v24, (const cocos2d::CCPoint *)v45);
v25(v23, &v44);
v26 = *((float *)&v43 + 1) * 0.5;
v28 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_01_001.png", v27);
v29 = CCMenuItemSpriteExtra::create(v28, 0, (__int64)this, (__int64)MoreVideoOptionsLayer::onPrevPage, 0);
*((_QWORD *)this + 86) = v29;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v29);
v30 = *((cocos2d::CCDirector ***)this + 86);
v31 = *((cocos2d::CCNode **)this + 69);
v32 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v30 + 23);
v33 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v30);
cocos2d::CCDirector::getScreenLeft(v33);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, v34 + 24.0, v26);
cocos2d::CCNode::convertToNodeSpace(&v44, v31, (const cocos2d::CCPoint *)v45);
v32(v30, &v44);
v36 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_arrow_01_001.png",
v35);
cocos2d::CCSprite::setFlipX(v36, 1);
v37 = CCMenuItemSpriteExtra::create((__int64)v36, 0, (__int64)this, (__int64)MoreVideoOptionsLayer::onNextPage, 0);
*((_QWORD *)this + 87) = v37;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v37);
v38 = *((cocos2d::CCDirector ***)this + 87);
v39 = *((cocos2d::CCNode **)this + 69);
v40 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v38 + 23);
v41 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v38);
cocos2d::CCDirector::getScreenRight(v41);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, v42 - 24.0, v26);
cocos2d::CCNode::convertToNodeSpace(&v44, v39, (const cocos2d::CCPoint *)v45);
v40(v38, &v44);
MoreVideoOptionsLayer::goToPage(this, 0);
}
return v3;
}