//
// SetupShaderEffectPopup::setupGrayscale from 0x1002cdc30 to 0x1002ce083 (1107 bytes)
//
// 1 xrefs:
// > SetupShaderEffectPopup::init @ 0x1002c61e7
//
// 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
//
void __fastcall SetupShaderEffectPopup::setupGrayscale(SetupShaderEffectPopup *a1)
{
__int128 v1; // [rsp+38h] [rbp-F8h] BYREF
void *v2; // [rsp+48h] [rbp-E8h]
char v3; // [rsp+50h] [rbp-E0h] BYREF
char v4[15]; // [rsp+51h] [rbp-DFh] BYREF
void *v5; // [rsp+60h] [rbp-D0h]
__int128 v6; // [rsp+68h] [rbp-C8h] BYREF
void *v7; // [rsp+78h] [rbp-B8h]
__int128 v8; // [rsp+80h] [rbp-B0h] BYREF
void *v9; // [rsp+90h] [rbp-A0h]
float v10[2]; // [rsp+98h] [rbp-98h] BYREF
char v11; // [rsp+A0h] [rbp-90h] BYREF
_BYTE v12[23]; // [rsp+A1h] [rbp-8Fh] BYREF
__int128 v13; // [rsp+B8h] [rbp-78h] BYREF
void *v14; // [rsp+C8h] [rbp-68h]
__int128 v15; // [rsp+D0h] [rbp-60h] BYREF
void *v16; // [rsp+E0h] [rbp-50h]
char v17; // [rsp+E8h] [rbp-48h] BYREF
_BYTE v18[23]; // [rsp+E9h] [rbp-47h] BYREF
unsigned __int64 v19; // [rsp+100h] [rbp-30h] BYREF
double v20; // [rsp+108h] [rbp-28h] BYREF
unsigned __int64 v21[4]; // [rsp+110h] [rbp-20h] BYREF
v11 = 30;
strcpy(v12, "Setup Grayscale");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)&v11);
if ( (v11 & 1) != 0 )
operator delete(*(void **)&v12[15]);
v3 = 8;
strcpy(v4, "Help");
v7 = operator new(0x118u);
*(_QWORD *)&v6 = 281;
*((_QWORD *)&v6 + 1) = 279;
strcpy(
(char *)v7,
"Applies a grayscale filter to the screen.\n"
"Target is how much of the filter to apply.\n"
"FadeTime is time until final state is reached.\n"
"Tint Channel lets you set a color channel to tint towards.\n"
"UseLum uses a different conversion to grayscale.");
SetupTriggerPopup::addHelpButton((__int64)a1, (__int64)&v3, &v6, (__m128)0x3F800000u);
if ( (v6 & 1) != 0 )
operator delete(v7);
if ( (v3 & 1) != 0 )
operator delete(v5);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v10);
sub_10028CBE0((float *)&v19, v10[0] * 0.5, (float)(0.5 * v10[1]) + 85.0);
LOBYTE(v13) = 14;
strcpy((char *)&v13 + 1, "Target:");
sub_10028CBE0((float *)v21, -100.0, 0.0);
sub_10028CCE0(&v20, &v19, v21);
SetupTriggerPopup::createValueControl((int)a1, 176, &v13, COERCE_DOUBLE(1060320051), 0.0, 0.0);
if ( (v13 & 1) != 0 )
operator delete(v14);
LOBYTE(v8) = 18;
strcpy((char *)&v8 + 1, "FadeTime:");
sub_10028CBE0((float *)v21, 100.0, 0.0);
sub_10028CCE0(&v20, &v19, v21);
SetupTriggerPopup::createValueControl((int)a1, 10, &v8, COERCE_DOUBLE(1060320051), 0.0, 0.0);
if ( (v8 & 1) != 0 )
operator delete(v9);
LOBYTE(v15) = 12;
strcpy((char *)&v15 + 1, "UseLum");
sub_10028CBE0((float *)v21, 55.0, -55.0);
sub_10028CCE0(&v20, &v19, v21);
SetupTriggerPopup::createToggleValueControl((int)a1, 188, &v15, 1.0, (__int64)&v20, 0, 0, 0);
if ( (v15 & 1) != 0 )
operator delete(v16);
LOWORD(v1) = 8194;
BYTE2(v1) = 0;
sub_10028CBE0((float *)v21, -24.0, -55.0);
sub_10028CCE0(&v20, &v19, v21);
SetupTriggerPopup::createToggleValueControl((int)a1, 190, &v1, 1.0, (__int64)&v20, 0, 0, 0);
if ( (v1 & 1) != 0 )
operator delete(v2);
v17 = 26;
strcpy(v18, "Tint\nChannel:");
sub_10028CBE0((float *)v21, -100.0, -55.0);
sub_10028CCE0(&v20, &v19, v21);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
51,
(__int64)&v17,
(float *)&v20,
1,
Int,
0.69999999,
0.0,
0.0,
6,
0,
0,
0,
0,
2,
0);
if ( (v17 & 1) != 0 )
operator delete(*(void **)&v18[15]);
sub_10028CBE0((float *)v21, 0.0, -100.0);
sub_10028CCE0(&v20, &v19, v21);
SetupTriggerPopup::createEasingControls(a1, (cocos2d::CCPoint)1065353216LL, -100.0, (int)&v20, 0);
}