//
// HSVLiveOverlay::init from 0x69c45c to 0x69c736 (730 bytes)
//
// 1 xrefs:
// > HSVLiveOverlay::create @ 0x69c8d2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:56:19 +0000
//
GameManager *__fastcall HSVLiveOverlay::init(int a1, cocos2d::CCObject *a2, cocos2d::CCObject *a3, int a4, int a5)
{
GameManager *v8; // r0
cocos2d::CCObject *v9; // r0
cocos2d::CCArray *WinSize; // r0
cocos2d::CCObject *v11; // r0
const char *v12; // r1
int v13; // r6
cocos2d::CCMenu *v14; // r0
int v15; // r0
int v16; // r9
void (__fastcall *v17)(int, _BYTE *); // r6
cocos2d::CCArray *started; // r0
cocos2d::CCObject *v19; // r0
cocos2d::CCObject *v20; // r10
int v21; // r6
cocos2d::CCObject *v22; // r11
int v23; // r5
const cocos2d::CCPoint *v24; // r11
void (__fastcall *v25)(int, _BYTE *); // r9
int v26; // r6
int v27; // r1
float v29; // [sp+10h] [bp-6Ch]
int v30; // [sp+10h] [bp-6Ch]
GameManager *v31; // [sp+14h] [bp-68h]
char *v32; // [sp+18h] [bp-64h]
cocos2d::CCPoint *v33; // [sp+20h] [bp-5Ch]
char v35[8]; // [sp+2Ch] [bp-50h] BYREF
int (__fastcall *v36)(HSVLiveOverlay *, cocos2d::CCObject *); // [sp+34h] [bp-48h]
int v37; // [sp+38h] [bp-44h]
_DWORD (*v38)(HSVLiveOverlay *__hidden, cocos2d::CCObject *); // [sp+3Ch] [bp-40h]
int v39; // [sp+40h] [bp-3Ch]
_DWORD (*v40)(HSVLiveOverlay *__hidden, cocos2d::CCObject *); // [sp+44h] [bp-38h]
int v41; // [sp+48h] [bp-34h]
_BYTE v42[8]; // [sp+4Ch] [bp-30h] BYREF
char v43[8]; // [sp+54h] [bp-28h] BYREF
_BYTE v44[8]; // [sp+5Ch] [bp-20h] BYREF
_BYTE v45[8]; // [sp+64h] [bp-18h] BYREF
_BYTE v46[8]; // [sp+6Ch] [bp-10h] BYREF
v8 = FLAlertLayer::init((FLAlertLayer *)a1, 0);
v31 = v8;
if ( !v8 )
return v31;
*(_WORD *)(a1 + 555) = a4;
*(_BYTE *)(a1 + 557) = BYTE2(a4);
*(_WORD *)(a1 + 558) = a5;
*(_BYTE *)(a1 + 560) = BYTE2(a5);
if ( a2 )
{
*(_DWORD *)(a1 + 524) = a2;
v9 = a2;
}
else
{
if ( !a3 )
goto LABEL_7;
v9 = a3;
*(_DWORD *)(a1 + 528) = a3;
}
v8 = (GameManager *)cocos2d::CCObject::retain(v9);
LABEL_7:
*(_BYTE *)(a1 + 468) = 1;
cocos2d::CCDirector::sharedDirector(v8);
WinSize = (cocos2d::CCArray *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v35);
v11 = (cocos2d::CCObject *)cocos2d::CCArray::create(WinSize);
*(_DWORD *)(a1 + 532) = v11;
cocos2d::CCObject::retain(v11);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)a1 + 500))(a1, 0);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)a1 + 536))(a1, 0);
v13 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v12);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v13 + 80))(v13, 1056964608);
v36 = HSVLiveOverlay::closeColorSelect;
v37 = 0;
v14 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v13, 0, a1, (int)HSVLiveOverlay::closeColorSelect, 0);
v15 = cocos2d::CCMenu::create(v14, nullptr);
*(_DWORD *)(a1 + 444) = v15;
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v15, 10);
v16 = *(_DWORD *)(a1 + 444);
v17 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v16 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, 157.0, 163.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, -81.0, 48.0);
cocos2d::CCPoint::operator+(v44, v45, v46);
v17(v16, v44);
started = (cocos2d::CCArray *)HSVLiveOverlay::determineStartValues((HSVLiveOverlay *)a1);
if ( *(_BYTE *)(a1 + 552) && *(_BYTE *)(a1 + 553) )
{
v19 = (cocos2d::CCObject *)cocos2d::CCArray::create(started);
*(_DWORD *)(a1 + 536) = v19;
cocos2d::CCObject::retain(v19);
v20 = ButtonSprite::create(
(ButtonSprite *)a1i2r3e45s789g,
(const char *)&dword_14,
0,
0.5,
1,
"bigFont.fnt",
"GJ_button_01.png",
COERCE_CONST_CHAR_(30.0),
COERCE_FLOAT(v44));
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v20 + 80))(v20, 1058642330);
v38 = HSVLiveOverlay::onSelectTab;
v39 = 0;
v21 = CCMenuItemSpriteExtra::create((int)v20, 0, a1, (int)HSVLiveOverlay::onSelectTab, 0);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v21);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v21 + 36))(v21, 1);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v20 + 36))(v20, 1);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 536), v20);
v22 = ButtonSprite::create(
(ButtonSprite *)&a1i2r3e45s789g[2],
(const char *)&dword_14,
0,
0.5,
1,
"bigFont.fnt",
"GJ_button_04.png",
COERCE_CONST_CHAR_(30.0),
v29);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v22 + 80))(v22, 1058642330);
v40 = HSVLiveOverlay::onSelectTab;
v41 = 0;
v23 = CCMenuItemSpriteExtra::create((int)v22, 0, a1, (int)HSVLiveOverlay::onSelectTab, 0);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v23);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v23 + 36))(v23, 2);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v22 + 36))(v22, 2);
cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 536), v22);
v24 = *(const cocos2d::CCPoint **)(a1 + 444);
v32 = *(char **)(*(_DWORD *)v21 + 92);
v33 = *(cocos2d::CCPoint **)(a1 + 460);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, 157.0, 163.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, 97.0, 36.0);
cocos2d::CCPoint::operator+(v30, v45, v46);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v43, v33);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v42, v24);
((void (__fastcall *)(int, _BYTE *))v32)(v21, v42);
v25 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v23 + 92);
v26 = (*(int (__fastcall **)(int))(*(_DWORD *)v21 + 96))(v21);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, 0.0, -24.0);
cocos2d::CCPoint::operator+(v45, v26, v46);
v25(v23, v45);
}
if ( *(_BYTE *)(a1 + 552) )
v27 = 1;
else
v27 = 2;
HSVLiveOverlay::createHSVWidget((HSVLiveOverlay *)a1, v27);
return v31;
}