//
// SetupShaderEffectPopup::setupInvertColor from 0xa067c8 to 0xa07054 (2188 bytes)
//
// 2 xrefs:
// > SetupShaderEffectPopup::init @ 0xa08640
// > ??> @ 0x4deb0
//
// 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 SetupShaderEffectPopup::setupInvertColor(SetupShaderEffectPopup *a1)
{
void *v2; // x0
void *v3; // x0
void *v4; // x0
cocos2d::CCDirector *v5; // x0
void *v6; // x0
void *v7; // x0
void *v8; // x0
void *v9; // x0
void *v10; // x0
void *v11; // x0
void *v12; // x0
void *v13; // x0
float v14; // s2
unsigned int *v15; // x1
int v16; // w2
unsigned int *v17; // x1
int v18; // w2
unsigned int *v19; // x1
int v20; // w2
unsigned int *v21; // x1
int v22; // w2
unsigned int *v23; // x1
int v24; // w2
unsigned int *v25; // x1
int v26; // w2
unsigned int *v27; // x1
int v28; // w2
unsigned int *v29; // x1
int v30; // w2
unsigned int *v31; // x1
int v32; // w2
unsigned int *v33; // x1
int v34; // w2
unsigned int *v35; // x21
int v36; // w1
float v37; // [xsp+80h] [xbp+80h]
float v38; // [xsp+84h] [xbp+84h]
cocos2d::CCPoint v39; // [xsp+88h] [xbp+88h] BYREF
cocos2d::CCPoint v40; // [xsp+90h] [xbp+90h] BYREF
cocos2d::CCPoint v41; // [xsp+98h] [xbp+98h] BYREF
__int64 v42; // [xsp+A0h] [xbp+A0h] BYREF
cocos2d::CCPoint v43; // 0:s0.4,4:s1.4
sub_D153B8((int)&v42, "Setup Invert Color");
SetupTriggerPopup::addTitle((__int64)a1);
v2 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v42 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v2);
}
sub_D153B8((int)&v41, "Help");
sub_D153B8(
(int)&v42,
"Inverts colors on the screen.\n"
"Target is how much of the filter to apply.\n"
"FadeTime is time until final state is reached.\n"
"R, G, and B let you customize the filter color.\n"
"EditRGB allows editing the above values.\n"
"TweenRGB makes transitions smoother.\n"
"ClampRGB limits these values to 1.\n"
"Tip: Use ClampRGB and set an R, G or B value\n"
"over 1 to avoid the middle grey effect.");
SetupTriggerPopup::addHelpButton((__int64)a1, 1.0);
v3 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(v42 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v3);
}
v4 = (void *)(*(_QWORD *)&v41 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v41 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(*(_QWORD *)&v41 - 8LL);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(*(_QWORD *)&v41 - 8LL);
*(_DWORD *)(*(_QWORD *)&v41 - 8LL) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v4);
}
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
cocos2d::CCPoint::CCPoint(&v39, v37 * 0.5, (float)(v38 * 0.5) + 90.0);
sub_D153B8((int)&v42, "Target:");
cocos2d::CCPoint::CCPoint(&v40, -100.0, 0.0);
cocos2d::CCPoint::operator+(&v41, &v39, &v40);
SetupTriggerPopup::createValueControl(a1, 0xB0u, 0.7, 0.0, 0.0, (__int64)&v42, &v41);
v6 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(v42 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v6);
}
sub_D153B8((int)&v42, "FadeTime:");
cocos2d::CCPoint::CCPoint(&v40, 100.0, 0.0);
cocos2d::CCPoint::operator+(&v41, &v39, &v40);
SetupTriggerPopup::createValueControl(a1, 0xAu, 0.7, 0.0, 0.0, (__int64)&v42, &v41);
v7 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(v42 - 8);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v7);
}
sub_D153B8((int)&v42, "R:");
cocos2d::CCPoint::CCPoint(&v40, -130.0, -50.0);
cocos2d::CCPoint::operator+(&v41, &v39, &v40);
SetupTriggerPopup::createValueControl(a1, 0xB3u, 0.6, 0.0, 0.0, (__int64)&v42, &v41);
v8 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)(v42 - 8);
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v8);
}
sub_D153B8((int)&v42, "G:");
cocos2d::CCPoint::CCPoint(&v40, 0.0, -50.0);
cocos2d::CCPoint::operator+(&v41, &v39, &v40);
SetupTriggerPopup::createValueControl(a1, 0xB4u, 0.6, 0.0, 0.0, (__int64)&v42, &v41);
v9 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v27 = (unsigned int *)(v42 - 8);
do
v28 = __ldaxr(v27);
while ( __stlxr(v28 - 1, v27) );
}
else
{
v28 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v28 - 1;
}
if ( v28 <= 0 )
operator delete(v9);
}
sub_D153B8((int)&v42, "B:");
cocos2d::CCPoint::CCPoint(&v40, 130.0, -50.0);
cocos2d::CCPoint::operator+(&v41, &v39, &v40);
SetupTriggerPopup::createValueControl(a1, 0xBDu, 0.6, 0.0, 0.0, (__int64)&v42, &v41);
v10 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v29 = (unsigned int *)(v42 - 8);
do
v30 = __ldaxr(v29);
while ( __stlxr(v30 - 1, v29) );
}
else
{
v30 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v30 - 1;
}
if ( v30 <= 0 )
operator delete(v10);
}
sub_D153B8((int)&v42, "EditRGB");
cocos2d::CCPoint::CCPoint(&v40, -130.0, -105.0);
cocos2d::CCPoint::operator+(&v41, &v39, &v40);
SetupTriggerPopup::createToggleValueControl(a1, 188, 1.0, (__int64)&v42, &v41, 0, 0, 0);
v11 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v31 = (unsigned int *)(v42 - 8);
do
v32 = __ldaxr(v31);
while ( __stlxr(v32 - 1, v31) );
}
else
{
v32 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v32 - 1;
}
if ( v32 <= 0 )
operator delete(v11);
}
sub_D153B8((int)&v42, "TweenRGB");
cocos2d::CCPoint::CCPoint(&v40, -30.0, -105.0);
cocos2d::CCPoint::operator+(&v41, &v39, &v40);
SetupTriggerPopup::createToggleValueControl(a1, 190, 1.0, (__int64)&v42, &v41, 0, 0, 0);
v12 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v33 = (unsigned int *)(v42 - 8);
do
v34 = __ldaxr(v33);
while ( __stlxr(v34 - 1, v33) );
}
else
{
v34 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v34 - 1;
}
if ( v34 <= 0 )
operator delete(v12);
}
sub_D153B8((int)&v42, "ClampRGB");
cocos2d::CCPoint::CCPoint(&v40, 70.0, -105.0);
cocos2d::CCPoint::operator+(&v41, &v39, &v40);
SetupTriggerPopup::createToggleValueControl(a1, 194, 1.0, (__int64)&v42, &v41, 0, 0, 0);
v13 = (void *)(v42 - 24);
if ( (__int64 *)(v42 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v35 = (unsigned int *)(v42 - 8);
do
v36 = __ldaxr(v35);
while ( __stlxr(v36 - 1, v35) );
}
else
{
v36 = *(_DWORD *)(v42 - 8);
*(_DWORD *)(v42 - 8) = v36 - 1;
}
if ( v36 <= 0 )
operator delete(v13);
}
cocos2d::CCPoint::CCPoint(&v41, 0.0, -140.0);
cocos2d::CCPoint::operator+(&v42, &v39, &v41);
v43.x = 0.8;
SetupTriggerPopup::createEasingControls(a1, v43, v14, (int)&v42, 0);
}