//
// SetupShaderEffectPopup::setupLensCircle from 0x1405e49b0 to 0x1405e538d (2525 bytes)
//
// 2 xrefs:
// > SetupShaderEffectPopup::init @ 0x1405dfaf7
// > ??> @ 0x14092ee5c
//
// This function is hookable on this platform (idp: pc, 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 11:35:02 +0000
//
// Hidden C++ exception states: #wind=4
double __fastcall SetupShaderEffectPopup::setupLensCircle(__int64 a1)
{
_BYTE *v2; // r9
_BYTE *v3; // rcx
const char *v4; // rdx
__int64 v5; // r8
__int64 v6; // rcx
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rdx
char *v16; // rdi
void *v17; // r8
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rax
int v21; // eax
__int64 v22; // rax
int v23; // r8d
int v24; // r9d
__int64 v26; // [rsp+80h] [rbp-88h]
__int64 v27; // [rsp+80h] [rbp-88h]
void **v28; // [rsp+88h] [rbp-80h] BYREF
_BYTE v29[8]; // [rsp+90h] [rbp-78h] BYREF
void **v30; // [rsp+98h] [rbp-70h] BYREF
void **v31; // [rsp+A0h] [rbp-68h] BYREF
__int128 v32; // [rsp+A8h] [rbp-60h] BYREF
__int64 v33; // [rsp+B8h] [rbp-50h]
__int64 v34; // [rsp+C0h] [rbp-48h]
float v35; // [rsp+C8h] [rbp-40h] BYREF
float v36; // [rsp+CCh] [rbp-3Ch]
void *Block[2]; // [rsp+D0h] [rbp-38h] BYREF
__m128i si128; // [rsp+E0h] [rbp-28h]
*(_OWORD *)Block = 0;
Block[0] = sub_14003D460(0x20u);
si128.m128i_i64[0] = 17;
si128.m128i_i64[1] = 31;
strcpy((char *)Block[0], "Setup Lens Circle");
SetupTriggerPopup::addTitle(a1, Block);
v28 = Block;
*(_OWORD *)Block = 0;
si128 = 0u;
v2 = sub_14003D460(0x1C0u);
Block[0] = v2;
si128.m128i_i64[0] = 444;
si128.m128i_i64[1] = 447;
v3 = v2;
v4 = "Creates a lens circle.\n"
"Size defines how big the circle is.\n"
"Strength is the opacity of the circle.\n"
"Fade sets how much the circle fades out at the edges.\n"
"Screen OffX and OffY offsets the center of the effect.\n"
"CenterID lets you set a specific target object as the center.\n"
"FadeTime is time until final state is reached.\n"
"Tint Channel lets you set a color channel to use for the circle.";
v5 = 3;
do
{
*(_OWORD *)v3 = *(_OWORD *)v4;
*((_OWORD *)v3 + 1) = *((_OWORD *)v4 + 1);
*((_OWORD *)v3 + 2) = *((_OWORD *)v4 + 2);
*((_OWORD *)v3 + 3) = *((_OWORD *)v4 + 3);
*((_OWORD *)v3 + 4) = *((_OWORD *)v4 + 4);
*((_OWORD *)v3 + 5) = *((_OWORD *)v4 + 5);
*((_OWORD *)v3 + 6) = *((_OWORD *)v4 + 6);
v3 += 128;
*((_OWORD *)v3 - 1) = *((_OWORD *)v4 + 7);
v4 += 128;
--v5;
}
while ( v5 );
*(_OWORD *)v3 = *(_OWORD *)v4;
*((_OWORD *)v3 + 1) = *((_OWORD *)v4 + 1);
*((_OWORD *)v3 + 2) = *((_OWORD *)v4 + 2);
*((_QWORD *)v3 + 6) = *((_QWORD *)v4 + 6);
*((_DWORD *)v3 + 14) = *((_DWORD *)v4 + 14);
v2[444] = 0;
v32 = 0;
v33 = 4;
v34 = 15;
strcpy((char *)&v32, "Help");
SetupTriggerPopup::addHelpButton(a1, &v32, Block);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, &v35);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, v35 * 0.5, (float)(v36 * 0.5) + 100.0);
v31 = Block;
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 5;
si128.m128i_i64[1] = 15;
LODWORD(Block[0]) = *(_DWORD *)"Size:";
WORD2(Block[0]) = (unsigned __int8)aSize[4];
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, -100.0, 0.0);
cocos2d::CCPoint::operator+(v29, &v28, v8);
SetupTriggerPopup::createValueControl(a1, 179, (unsigned int)Block, (unsigned int)&v28, 1058642330, 0, 0);
v30 = Block;
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 5;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Fade:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, 100.0, 0.0);
cocos2d::CCPoint::operator+(v29, &v28, v9);
SetupTriggerPopup::createValueControl(a1, 181, (unsigned int)Block, (unsigned int)&v28, 1058642330, 0, 0);
v30 = Block;
Block[1] = (void *)58;
si128.m128i_i64[0] = 9;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x656D695465646146LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, -100.0, -45.0);
cocos2d::CCPoint::operator+(v29, &v28, v10);
SetupTriggerPopup::createValueControl(a1, 10, (unsigned int)Block, (unsigned int)&v28, 1058642330, 0, 0);
v30 = Block;
Block[1] = (void *)58;
si128.m128i_i64[0] = 9;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x6874676E65727453LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, 100.0, -45.0);
cocos2d::CCPoint::operator+(v29, &v28, v11);
SetupTriggerPopup::createValueControl(a1, 176, (unsigned int)Block, (unsigned int)&v28, 1058642330, 0, 0);
v30 = Block;
si128.m128i_i64[0] = 12;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Screen\nOffX:");
BYTE5(Block[1]) = 0;
HIWORD(Block[1]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, -100.0, -90.0);
cocos2d::CCPoint::operator+(v29, &v28, v12);
SetupTriggerPopup::createValueControlAdvanced(
a1,
290,
(unsigned int)Block,
(unsigned int)&v28,
1058642330,
0,
1,
6,
0,
-1082130432,
1065353216,
0,
101,
0,
2,
0,
v28);
v30 = Block;
si128.m128i_i64[0] = 12;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Screen\nOffY:");
BYTE5(Block[1]) = 0;
HIWORD(Block[1]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, 100.0, -90.0);
cocos2d::CCPoint::operator+(v29, &v28, v13);
LOBYTE(v26) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
291,
(unsigned int)Block,
(unsigned int)&v28,
1058642330,
0,
1,
6,
0,
-1082130432,
1065353216,
0,
101,
0,
2,
v26);
Block[1] = (void *)58;
si128 = _mm_load_si128((const __m128i *)&xmmword_1408365A0);
Block[0] = (void *)0x44497265746E6543LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, -73.0, -135.0);
cocos2d::CCPoint::operator+(v29, &v28, v14);
v15 = a1 + 544;
if ( !a1 )
v15 = 0;
v16 = IDNameInput::create(
a1,
v15,
1,
51,
(__int64)Block,
(const struct cocos2d::CCPoint *)&v28,
1058642330,
6,
0,
0,
0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v17 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v17 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v17 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v17);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
(*(void (__fastcall **)(_QWORD))(**((_QWORD **)v16 + 62) + 240LL))(*((_QWORD *)v16 + 62));
v30 = (void **)&v32;
v32 = 0;
v33 = 2;
v34 = 15;
strcpy((char *)&v32, "P1");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, -140.0, -170.0);
cocos2d::CCPoint::operator+(v29, &v28, v18);
SetupTriggerPopup::createToggleValueControl(a1, 138, (unsigned int)&v32, (unsigned int)&v28, 0, 1, 0, 1065353216);
v30 = (void **)&v32;
v32 = 0;
v33 = 2;
v34 = 15;
strcpy((char *)&v32, "P2");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, -70.0, -170.0);
cocos2d::CCPoint::operator+(v29, &v28, v19);
SetupTriggerPopup::createToggleValueControl(a1, 200, (unsigned int)&v32, (unsigned int)&v28, 0, 1, 0, 1065353216);
v30 = Block;
si128.m128i_i64[0] = 13;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Tint\nChannel:");
HIWORD(Block[1]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, 100.0, -135.0);
cocos2d::CCPoint::operator+(v29, &v28, v20);
LOBYTE(v27) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
71,
(unsigned int)Block,
(unsigned int)&v28,
1058642330,
1,
2,
6,
0,
0,
0,
0,
0,
0,
2,
v27);
v30 = (void **)&v32;
v33 = 8;
v34 = 15;
v32 = 0x65766974616C6552uLL;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v31,
(float)((float)((float)(*(float *)(a1 + 732) * 0.5) + (float)(v35 * 0.5)) - 72.0) - 90.0,
(float)((float)(v36 * 0.5) - (float)(*(float *)(a1 + 736) * 0.5)) + 20.0);
SetupTriggerPopup::createToggleValueControl(a1, 514, (unsigned int)&v32, v21, 0, 0, 0, 1065353216);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, 100.0, -165.0);
cocos2d::CCPoint::operator+(v29, &v28, v22);
return SetupTriggerPopup::createEasingControls(a1, (unsigned int)&v28, v23, v24, 0);
}