//
// HSVWidgetPopup::create from 0x10042f470 to 0x10042f5f0 (384 bytes)
//
// 4 xrefs:
// > CustomizeObjectLayer::onHSV @ 0x1001f779d
// > CustomizeObjectLayer::onHSV @ 0x1001f77db
// > SetupEnterEffectPopup::onHSV @ 0x1003f31dc
// > SetupAreaTintTriggerPopup::onHSV @ 0x1004d8c0c
//
// 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
//
char *__fastcall HSVWidgetPopup::create(__int64 a1, __int64 a2, __int128 *a3, double a4)
{
char *v5; // rbx
char v6; // r14
__int128 v8; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v5 = (char *)operator new(0x288u);
cocos2d::CCLayerColor::CCLayerColor(v5);
*((_QWORD *)v5 + 72) = 0;
*((_DWORD *)v5 + 146) = 0;
v5[588] = 0;
*((_OWORD *)v5 + 34) = 0;
*(_OWORD *)(v5 + 553) = 0;
*((_OWORD *)v5 + 37) = 0;
*((_QWORD *)v5 + 76) = 0;
*((_DWORD *)v5 + 154) = -1;
*((_WORD *)v5 + 310) = 0;
*((_DWORD *)v5 + 156) = -1;
v5[628] = 0;
*(_QWORD *)v5 = off_1009365A8;
*((_QWORD *)v5 + 40) = off_100936AC8;
*((_QWORD *)v5 + 41) = &off_100936B38;
*((_QWORD *)v5 + 42) = off_100936B50;
*((_QWORD *)v5 + 43) = off_100936B70;
*((_QWORD *)v5 + 44) = off_100936B90;
*((_QWORD *)v5 + 51) = off_100936BB8;
*((_QWORD *)v5 + 54) = off_100936C38;
if ( (*(_BYTE *)a3 & 1) != 0 )
{
sub_100006B70(&v8, *((const void **)a3 + 2), *((_QWORD *)a3 + 1), 0.0);
}
else
{
__p = *((void **)a3 + 2);
v8 = *a3;
}
v6 = HSVWidgetPopup::init(v5, a1, a2, &v8, a4);
if ( (v8 & 1) != 0 )
operator delete(__p);
if ( v6 )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v5);
}
else
{
(*(void (__fastcall **)(char *))(*(_QWORD *)v5 + 16LL))(v5);
return nullptr;
}
return v5;
}