//
// HSVLiveOverlay::init from 0x10019f9d8 to 0x10019fdd0 (1016 bytes)
//
// 1 xrefs:
// > HSVLiveOverlay::create @ 0x10019f988
//
// 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 HSVLiveOverlay::init(HSVLiveOverlay *a1, GameObject *a2, cocos2d::CCArray *a3)
{
_BOOL4 inited; // w20
__int64 v7; // x8
cocos2d::CCDirector *v8; // x0
__int64 v9; // x0
cocos2d::CCArray *v10; // x0
cocos2d::CCSprite *v11; // x21
CCMenuItemSpriteExtra *v12; // x0
cocos2d::CCMenu *v13; // x0
__n128 v14; // q0
cocos2d::CCMenu *m_buttonMenu; // x21
__n128 v16; // q1
__n128 v17; // q0
__n128 v18; // q1
double v19; // d0
__int64 v20; // x0
cocos2d::CCArray *v21; // x0
ButtonSprite *v22; // x24
CCMenuItemSpriteExtra *v23; // x21
ButtonSprite *v24; // x24
CCMenuItemSpriteExtra *v25; // x23
int v26; // w22
__n128 v27; // q0
cocos2d::CCMenu *v28; // x24
cocos2d::CCLayer *m_mainLayer; // x25
__n128 v30; // q1
__n128 v31; // q0
__n128 v32; // q1
float32x2_t *v33; // x21
__n128 v34; // q0
__n128 v35; // q1
double v36; // d0
float32x2_t v38; // [xsp+10h] [xbp-80h] BYREF
float32x2_t v39; // [xsp+18h] [xbp-78h] BYREF
float32x2_t v40; // [xsp+20h] [xbp-70h] BYREF
float32x2_t v41; // [xsp+28h] [xbp-68h] BYREF
float32x2_t v42; // [xsp+30h] [xbp-60h] BYREF
cocos2d::CCPoint v43; // 0:kr10_8.8
cocos2d::SEL_MenuHandler v44; // 0:x3.16
cocos2d::SEL_MenuHandler v45; // 0:x3.16
cocos2d::SEL_MenuHandler v46; // 0:x3.16
inited = FLAlertLayer::init_1(a1, 0);
if ( !inited )
return inited;
if ( a2 )
{
v7 = 640;
LABEL_6:
*(HSVLiveOverlay_vtbl **)((char *)&a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ v7) = (HSVLiveOverlay_vtbl *)a2;
cocos2d::CCObject::retain(a2);
goto LABEL_7;
}
if ( a3 )
{
v7 = 648;
a2 = (GameObject *)a3;
goto LABEL_6;
}
LABEL_7:
a1->m_noElasticity = 1;
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8);
v10 = (cocos2d::CCArray *)sub_10024A15C(v9);
a1->m_controls = v10;
cocos2d::CCObject::retain(v10);
((void (__fastcall *)(HSVLiveOverlay *, _QWORD))a1->setTouchEnabled)(a1, 0);
((void (__fastcall *)(HSVLiveOverlay *, _QWORD))a1->setKeypadEnabled)(a1, 0);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v11->setScale)(v11, 0.5);
v44.ptr = (void (__cdecl *)(cocos2d::CCObject *))HSVLiveOverlay::closeColorSelect;
v44.adj = 0;
v12 = CCMenuItemSpriteExtra::create(v11, nullptr, a1, v44);
v13 = (cocos2d::CCMenu *)sub_1001D7ED0(v12);
a1->m_buttonMenu = v13;
v14 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v13,
10);
m_buttonMenu = a1->m_buttonMenu;
v14.n128_u32[0] = 1125974016;
v16.n128_u32[0] = 1126367232;
sub_100022980(v14, v16, &v41);
v17.n128_u32[0] = -1029570560;
v18.n128_u32[0] = 1111490560;
sub_100022980(v17, v18, &v40);
*(float32x2_t *)&v19 = sub_1000229DC(&v41, &v40, &v42);
((void (__fastcall *)(cocos2d::CCMenu *, float32x2_t *, double))m_buttonMenu->setPosition)(m_buttonMenu, &v42, v19);
HSVLiveOverlay::determineStartValues(a1);
if ( a1->m_unkBool1 )
{
if ( !a1->m_unkBool2 )
goto LABEL_10;
v21 = (cocos2d::CCArray *)sub_10024A15C(v20);
a1->m_unkArray = v21;
cocos2d::CCObject::retain(v21);
v22 = ButtonSprite::create_1("1", 20, 0, 0.5, 1, "bigFont.fnt", "GJ_button_01.png", 30.0);
((void (__fastcall *)(ButtonSprite *, float))v22->setScale)(v22, 0.6);
v45.ptr = (void (__cdecl *)(cocos2d::CCObject *))HSVLiveOverlay::onSelectTab;
v45.adj = 0;
v23 = CCMenuItemSpriteExtra::create(v22, nullptr, a1, v45);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v23);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v23->setTag)(v23, 1);
((void (__fastcall *)(ButtonSprite *, __int64))v22->setTag)(v22, 1);
sub_10024A2D0(a1->m_unkArray, v22);
v24 = ButtonSprite::create_1("2", 20, 0, 0.5, 1, "bigFont.fnt", "GJ_button_04.png", 30.0);
((void (__fastcall *)(ButtonSprite *, float))v24->setScale)(v24, 0.6);
v46.ptr = (void (__cdecl *)(cocos2d::CCObject *))HSVLiveOverlay::onSelectTab;
v46.adj = 0;
v25 = CCMenuItemSpriteExtra::create(v24, nullptr, a1, v46);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v25);
v26 = 2;
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v25->setTag)(v25, 2);
((void (__fastcall *)(ButtonSprite *, __int64))v24->setTag)(v24, 2);
v27 = sub_10024A2D0(a1->m_unkArray, v24);
v28 = a1->m_buttonMenu;
m_mainLayer = a1->m_mainLayer;
v27.n128_u32[0] = 1125974016;
v30.n128_u32[0] = 1126367232;
sub_100022980(v27, v30, &v39);
v31.n128_u32[0] = 1120010240;
v32.n128_u32[0] = 1108344832;
sub_100022980(v31, v32, &v38);
sub_1000229DC(&v39, &v38, &v40);
cocos2d::CCNode::convertToWorldSpace(m_mainLayer, (const cocos2d::CCPoint *)&v40);
v43 = cocos2d::CCNode::convertToNodeSpace(v28, (const cocos2d::CCPoint *)&v41);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, float, float))v23->setPosition)(
v23,
&v42,
v43.x,
v43.y);
v33 = (float32x2_t *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))v23->getPosition)(v23);
v34.n128_u32[0] = 0;
v35.n128_u32[0] = -24.0;
sub_100022980(v34, v35, &v41);
*(float32x2_t *)&v36 = sub_1000229DC(v33, &v41, &v42);
((void (__fastcall *)(CCMenuItemSpriteExtra *, float32x2_t *, double))v25->setPosition)(v25, &v42, v36);
if ( a1->m_unkBool1 )
LABEL_10:
v26 = 1;
}
else
{
v26 = 2;
}
HSVLiveOverlay::createHSVWidget(a1, v26);
return inited;
}