//
// SetupShaderEffectPopup::setupChromaticGlitch from 0x1002b6440 to 0x1002b6b7c (1852 bytes)
//
// 1 xrefs:
// > SetupShaderEffectPopup::init @ 0x1002b2ed1
//
// 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 12:28:03 +0000
//
__int64 __fastcall SetupShaderEffectPopup::setupChromaticGlitch(void *a1)
{
__int64 v1; // rbx
__int64 v2; // rax
__int128 v4; // [rsp+10h] [rbp-170h] BYREF
void *v5; // [rsp+20h] [rbp-160h]
__int128 v6; // [rsp+28h] [rbp-158h] BYREF
void *v7; // [rsp+38h] [rbp-148h]
__int128 v8; // [rsp+40h] [rbp-140h] BYREF
void *v9; // [rsp+50h] [rbp-130h]
__int128 v10; // [rsp+58h] [rbp-128h] BYREF
void *v11; // [rsp+68h] [rbp-118h]
__int128 v12; // [rsp+70h] [rbp-110h] BYREF
void *v13; // [rsp+80h] [rbp-100h]
__int128 v14; // [rsp+88h] [rbp-F8h] BYREF
void *v15; // [rsp+98h] [rbp-E8h]
void *v16[3]; // [rsp+A0h] [rbp-E0h] BYREF
__int128 v17; // [rsp+B8h] [rbp-C8h] BYREF
void *v18; // [rsp+C8h] [rbp-B8h]
__int128 v19; // [rsp+D0h] [rbp-B0h] BYREF
void *v20; // [rsp+E0h] [rbp-A0h]
__int128 v21; // [rsp+E8h] [rbp-98h] BYREF
void *v22; // [rsp+F8h] [rbp-88h]
__int128 v23; // [rsp+100h] [rbp-80h] BYREF
void *v24; // [rsp+110h] [rbp-70h]
__int128 v25; // [rsp+118h] [rbp-68h] BYREF
void *v26; // [rsp+128h] [rbp-58h]
__int128 v27; // [rsp+130h] [rbp-50h] BYREF
void *v28; // [rsp+140h] [rbp-40h]
float v29; // [rsp+148h] [rbp-38h] BYREF
float v30; // [rsp+14Ch] [rbp-34h]
unsigned __int64 v31; // [rsp+150h] [rbp-30h] BYREF
unsigned __int64 v32; // [rsp+158h] [rbp-28h] BYREF
double v33[4]; // [rsp+160h] [rbp-20h] BYREF
v1 = (__int64)a1;
strcpy((char *)v16, "&Setup Chroma Glitch");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)v16);
if ( ((__int64)v16[0] & 1) != 0 )
operator delete(v16[2]);
LOBYTE(v4) = 8;
strcpy((char *)&v4 + 1, "Help");
v7 = operator new(0x1A8u);
*(_QWORD *)&v6 = 425;
*((_QWORD *)&v6 + 1) = 421;
strcpy(
(char *)v7,
"Applies chromatic aberration in waves alongside glitch lines.\n"
"Speed is how fast the wave effect happens.\n"
"Strength is how big the waves are.\n"
"LineThickness is how big the lines are.\n"
"LineStrength is the opacity of the lines.\n"
"RGBOff sets color offset.\n"
"FadeTime is time until final state is reached.\n"
"RelativePos changes the shape of the effect based on position.");
SetupTriggerPopup::addHelpButton((__int64)a1, &v4, &v6, 1.0);
if ( (v6 & 1) != 0 )
{
a1 = v7;
operator delete(v7);
}
if ( (v4 & 1) != 0 )
{
a1 = v5;
operator delete(v5);
}
v2 = cocos2d::CCDirector::sharedDirector(a1, &v4);
cocos2d::CCDirector::getWinSize(&v29, v2);
sub_100278250((float *)&v31, v29 * 0.5, (float)(v30 * 0.5) + 100.0);
LOBYTE(v17) = 12;
strcpy((char *)&v17 + 1, "Speed:");
sub_100278250((float *)&v32, -100.0, 0.0);
sub_100278350(v33, &v31, &v32);
SetupTriggerPopup::createValueControl(v1, 0xAFu, &v17, (__int64)v33, 0.60000002, 0.0, 5.0);
if ( (v17 & 1) != 0 )
operator delete(v18);
LOBYTE(v19) = 14;
strcpy((char *)&v19 + 1, "RGBOff:");
sub_100278250((float *)&v32, 100.0, 0.0);
sub_100278350(v33, &v31, &v32);
SetupTriggerPopup::createValueControl(v1, 0xB4u, &v19, (__int64)v33, 0.60000002, 0.0, 5.0);
if ( (v19 & 1) != 0 )
operator delete(v20);
LOBYTE(v8) = 18;
strcpy((char *)&v8 + 1, "Strength:");
sub_100278250((float *)&v32, -100.0, -40.0);
sub_100278350(v33, &v31, &v32);
SetupTriggerPopup::createValueControl(v1, 0xB0u, &v8, (__int64)v33, 0.60000002, 0.0, 5.0);
if ( (v8 & 1) != 0 )
operator delete(v9);
LOBYTE(v10) = 18;
strcpy((char *)&v10 + 1, "FadeTime:");
sub_100278250((float *)&v32, 100.0, -40.0);
sub_100278350(v33, &v31, &v32);
SetupTriggerPopup::createValueControl(v1, 0xAu, &v10, (__int64)v33, 0.60000002, 0.0, 5.0);
if ( (v10 & 1) != 0 )
operator delete(v11);
LOBYTE(v21) = 28;
strcpy((char *)&v21 + 1, "LineThickness:");
sub_100278250((float *)&v32, -100.0, -80.0);
sub_100278350(v33, &v31, &v32);
SetupTriggerPopup::createValueControl(v1, 0xB3u, &v21, (__int64)v33, 0.60000002, 0.0, 2.0);
if ( (v21 & 1) != 0 )
operator delete(v22);
LOBYTE(v12) = 18;
strcpy((char *)&v12 + 1, "SegmentH:");
sub_100278250((float *)&v32, 100.0, -80.0);
sub_100278350(v33, &v31, &v32);
SetupTriggerPopup::createValueControl(v1, 0xBDu, &v12, (__int64)v33, 0.60000002, 0.0, 5.0);
if ( (v12 & 1) != 0 )
operator delete(v13);
LOBYTE(v23) = 26;
strcpy((char *)&v23 + 1, "LineStrength:");
sub_100278250((float *)&v32, -100.0, -120.0);
sub_100278350(v33, &v31, &v32);
SetupTriggerPopup::createValueControl(v1, 0xBFu, &v23, (__int64)v33, 0.60000002, 0.0, 2.0);
if ( (v23 & 1) != 0 )
operator delete(v24);
LOBYTE(v25) = 14;
strcpy((char *)&v25 + 1, "Disable");
sub_100278250((float *)&v32, 110.0, -125.0);
sub_100278350(v33, &v31, &v32);
SetupTriggerPopup::createToggleValueControl(v1, 192, &v25, (__int64)v33, 0, 0, 1.0, 0);
if ( (v25 & 1) != 0 )
operator delete(v26);
LOBYTE(v27) = 24;
strcpy((char *)&v27 + 1, "Relative\nPos");
sub_100278250((float *)&v32, 110.0, -155.0);
sub_100278350(v33, &v31, &v32);
SetupTriggerPopup::createToggleValueControl(v1, 194, &v27, (__int64)v33, 0, 0, 1.0, 0);
if ( (v27 & 1) != 0 )
operator delete(v28);
LOBYTE(v14) = 16;
strcpy((char *)&v14 + 1, "Relative");
sub_100278250(
(float *)v33,
(float)((float)((float)(*(float *)(v1 + 732) * 0.5) + (float)(v29 * 0.5)) + -72.0) + -90.0,
(float)((float)(v30 * 0.5) - (float)(0.5 * *(float *)(v1 + 736))) + 20.0);
SetupTriggerPopup::createToggleValueControl(v1, 514, &v14, (__int64)v33, 0, 0, 1.0, 0);
if ( (v14 & 1) != 0 )
operator delete(v15);
sub_100278250((float *)&v32, 0.0, -160.0);
sub_100278350(v33, &v31, &v32);
return SetupTriggerPopup::createEasingControls(v1, (__int64)v33, 0, 0, 0.80000001);
}