//
// MoreVideoOptionsLayer::init from 0x1007a0ff0 to 0x1007a1461 (1137 bytes)
//
// 2 xrefs:
// > MoreVideoOptionsLayer::create @ 0x1007a0849
// > ??> @ 0x10098f4f8
//
// 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 MoreVideoOptionsLayer::init(MoreVideoOptionsLayer *a1)
{
bool result; // al
GameManager *v2; // rax
cocos2d::CCLayer *v3; // rax
cocos2d::extension::CCScale9Sprite *v4; // r14
cocos2d::CCLabelBMFont *v5; // r14
cocos2d::CCDictionary *v6; // rax
cocos2d::CCDictionary *v7; // rax
cocos2d::CCMenu *v8; // rax
cocos2d::CCSprite *v9; // rax
CCMenuItemSpriteExtra *v10; // r14
cocos2d::CCMenu *m_buttonMenu; // r15
cocos2d::CCSprite *v12; // rax
CCMenuItemSpriteExtra *v13; // rax
CCMenuItemSpriteExtra *m_prevButton; // r15
cocos2d::CCMenu *v15; // r12
cocos2d::CCDirector *v16; // rax
cocos2d::CCSprite *v17; // r14
CCMenuItemSpriteExtra *v18; // rax
CCMenuItemSpriteExtra *m_nextButton; // r14
cocos2d::CCMenu *v20; // r15
cocos2d::CCDirector *v21; // rax
float v22; // [rsp+0h] [rbp-50h] BYREF
cocos2d::ccColor4B v23[4]; // [rsp+8h] [rbp-48h] BYREF
float v24; // [rsp+18h] [rbp-38h] BYREF
float v25; // [rsp+1Ch] [rbp-34h]
float v26; // [rsp+20h] [rbp-30h]
bool v27; // [rsp+27h] [rbp-29h]
double v28; // 0:xmm0_8.8
cocos2d::CCRect v29; // 0:xmm0_8.8,8:xmm1_8.8
v23[0] = (cocos2d::ccColor4B)1258291200;
result = cocos2d::CCLayerColor::initWithColor(a1, v23);
if ( result )
{
v27 = result;
v2 = GameManager::sharedState();
if ( GameManager::getGameVariable(v2, "0168") )
a1->m_noElasticity = 1;
FLAlertLayer::incrementForcePrio(a1);
((void (__fastcall *)(MoreVideoOptionsLayer *, __int64))a1->setTouchEnabled)(a1, 1);
((void (__fastcall *)(MoreVideoOptionsLayer *, __int64))a1->setKeypadEnabled)(a1, 1);
cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v28 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v24);
v3 = cocos2d::CCLayer::create();
a1->m_mainLayer = v3;
((void (__fastcall *)(MoreVideoOptionsLayer *, cocos2d::CCLayer *, double))a1->addChild)(a1, v3, v28);
v29.origin = 0;
v29.size = 0;
sub_10028CC00((__int64)v23, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v4 = cocos2d::extension::CCScale9Sprite::create_2("GJ_square01.png", v29);
sub_10028CBF0((float *)&v23[0].r, 360.0, 260.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, cocos2d::ccColor4B *))v4->setContentSize)(v4, v23);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v4,
0xFFFFFFFFLL);
sub_10028CBE0((float *)&v23[0].r, v24 * 0.5, v25 * 0.5);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, cocos2d::ccColor4B *))v4->setPosition)(v4, v23);
v5 = cocos2d::CCLabelBMFont::create_3("Advanced Video Options", "bigFont.fnt");
sub_10028CBE0((float *)&v23[0].r, v24 * 0.5, (float)((float)(v25 * 0.5) + 130.0) + -16.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, cocos2d::ccColor4B *))v5->setPosition)(v5, v23);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v5->setScale)(v5, 0.60000002);
a1->m_joystickConnected = -1;
v6 = cocos2d::CCDictionary::create();
a1->m_variables = v6;
cocos2d::CCObject::retain(v6);
v7 = cocos2d::CCDictionary::create();
a1->m_values = v7;
cocos2d::CCObject::retain(v7);
v8 = cocos2d::CCMenu::create();
a1->m_buttonMenu = v8;
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v8,
10);
MoreVideoOptionsLayer::addToggle(
a1,
"Smooth Fix",
"0023",
"Makes some optimizations that can reduce lag. Disable if game speed becomes inconsistent.");
MoreVideoOptionsLayer::addToggle(a1, "Show FPS", "0115", "Shows frames per second while playing.");
v9 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v10 = CCMenuItemSpriteExtra::create(
v9,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)MoreVideoOptionsLayer::onClose);
CCMenuItemSpriteExtra::setSizeMult(v10, 1.5);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v10);
v26 = 0.5;
m_buttonMenu = a1->m_buttonMenu;
sub_10028CBE0(&v22, (float)((float)(v24 * 0.5) + -180.0) + 5.0, (float)((float)(v25 * 0.5) + 130.0) + -5.0);
v29.origin = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v23, (const cocos2d::CCPoint *)m_buttonMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::ccColor4B *, double))v10->setPosition)(
v10,
v23,
*(double *)&v29.origin);
v26 = v26 * v25;
v12 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v13 = CCMenuItemSpriteExtra::create(
v12,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)MoreVideoOptionsLayer::onPrevPage);
a1->m_prevButton = v13;
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v13);
m_prevButton = a1->m_prevButton;
v15 = a1->m_buttonMenu;
v16 = cocos2d::CCDirector::sharedDirector();
v29.origin.x = sub_100484D90((__int64)v16);
sub_10028CBE0(&v22, v29.origin.x + 24.0, v26);
v29.origin = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v23, (const cocos2d::CCPoint *)v15);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::ccColor4B *, double))m_prevButton->setPosition)(
m_prevButton,
v23,
*(double *)&v29.origin);
v17 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v17, 1);
v18 = CCMenuItemSpriteExtra::create(
v17,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)MoreVideoOptionsLayer::onNextPage);
a1->m_nextButton = v18;
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v18);
m_nextButton = a1->m_nextButton;
v20 = a1->m_buttonMenu;
v21 = cocos2d::CCDirector::sharedDirector();
v29.origin.x = sub_100484DA0((__int64)v21);
sub_10028CBE0(&v22, v29.origin.x + -24.0, v26);
v29.origin = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v23, (const cocos2d::CCPoint *)v20);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::ccColor4B *, double))m_nextButton->setPosition)(
m_nextButton,
v23,
*(double *)&v29.origin);
MoreVideoOptionsLayer::goToPage(a1, 0);
return v27;
}
return result;
}