//
// SetupPlatformerEndPopup::init from 0x96f2a0 to 0x96fa3c (1948 bytes)
//
// 2 xrefs:
// > SetupPlatformerEndPopup::create @ 0x96fbf0
// > ??> @ 0x961b0
//
// 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
//
bool SetupPlatformerEndPopup::init(SetupPlatformerEndPopup *a1, EndTriggerGameObject *a2, cocos2d::CCArray *a3)
{
bool v4; // w26
void *v6; // x0
void *v7; // x0
void *v8; // x0
void *v9; // x0
cocos2d::CCDirector *v10; // x0
float v11; // s3
float v12; // s4
void *v13; // x0
float v14; // s3
float v15; // s4
void *v16; // x0
float v17; // s2
void *v18; // x0
float v19; // s2
void *v20; // x0
float v21; // s2
void *v22; // x19
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; // x1
int v36; // w2
unsigned int *v37; // x1
int v38; // w2
unsigned int *v39; // x22
int v40; // w0
int v41; // [xsp+18h] [xbp-18h]
__int64 v42; // [xsp+18h] [xbp-18h]
char v43; // [xsp+20h] [xbp-10h]
__int64 v44; // [xsp+20h] [xbp-10h]
_QWORD v45[2]; // [xsp+30h] [xbp+0h] BYREF
float v46; // [xsp+C0h] [xbp+90h]
float v47; // [xsp+C4h] [xbp+94h]
cocos2d::CCPoint v48; // [xsp+C8h] [xbp+98h] BYREF
cocos2d::CCPoint v49; // [xsp+D0h] [xbp+A0h] BYREF
__int64 v50; // [xsp+D8h] [xbp+A8h] BYREF
__int64 v51; // [xsp+E0h] [xbp+B0h] BYREF
cocos2d::CCPoint v52; // 0:s0.4,4:s1.4
cocos2d::CCPoint v53; // 0:s0.4,4:s1.4
cocos2d::CCPoint v54; // 0:s0.4,4:s1.4
cocos2d::CCPoint v55; // 0:s0.4,4:s1.4
cocos2d::CCPoint v56; // 0:s0.4,4:s1.4
v4 = SetupTriggerPopup::init(a1, a2, a3, 300.0, 240.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
sub_D153B8((unsigned int)v45 + 176, "Setup End");
SetupTriggerPopup::addTitle(a1, (std::string)&v51);
v6 = (void *)(v51 - 24);
if ( (__int64 *)(v51 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(v51 - 8);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(v51 - 8);
*(_DWORD *)(v51 - 8) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v6);
}
sub_D153B8((unsigned int)v45 + 176, "OK");
SetupTriggerPopup::addCloseButton(a1, (std::string)&v51);
v7 = (void *)(v51 - 24);
if ( (__int64 *)(v51 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)(v51 - 8);
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *(_DWORD *)(v51 - 8);
*(_DWORD *)(v51 - 8) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v7);
}
sub_D153B8((int)&v50, "Help");
sub_D153B8(
(int)&v51,
"Sets a specific object given by TargetPos to be the end of the level. The player is pulled into th"
"e end instantly.\n"
"SpawnID lets you spawn a group at the end.\n"
"Instant teleports the player to the end instantly instead of the default gradual pull.\n"
"No Effects disables visual end effects.\n"
"No SFX disables end sound effects.");
SetupTriggerPopup::addHelpButton(a1, (std::string)&v50, (std::string)&v51, 1.0);
v8 = (void *)(v51 - 24);
if ( (__int64 *)(v51 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v33 = (unsigned int *)(v51 - 8);
do
v34 = __ldaxr(v33);
while ( __stlxr(v34 - 1, v33) );
}
else
{
v34 = *(_DWORD *)(v51 - 8);
*(_DWORD *)(v51 - 8) = v34 - 1;
}
if ( v34 <= 0 )
operator delete(v8);
}
v9 = (void *)(v50 - 24);
if ( (__int64 *)(v50 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v29 = (unsigned int *)(v50 - 8);
do
v30 = __ldaxr(v29);
while ( __stlxr(v30 - 1, v29) );
}
else
{
v30 = *(_DWORD *)(v50 - 8);
*(_DWORD *)(v50 - 8) = v30 - 1;
}
if ( v30 <= 0 )
operator delete(v9);
}
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v10 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v10);
cocos2d::CCPoint::CCPoint(&v48, v46 * 0.5, v47 * 0.5);
sub_D153B8((int)&v51, "SpawnID:");
cocos2d::CCPoint::CCPoint(&v49, -75.0, 50.0);
cocos2d::CCPoint::operator+(&v50, &v48, &v49);
v52.y = 0.0;
v52.x = 0.8;
v41 = 0;
v43 = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
51,
(std::string)&v51,
v52,
9999.0,
(bool)&v50,
Float,
2,
10,
v11,
v12,
1,
0,
GoldLabel,
0,
v41,
v43);
v13 = (void *)(v51 - 24);
if ( (__int64 *)(v51 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v37 = (unsigned int *)(v51 - 8);
do
v38 = __ldaxr(v37);
while ( __stlxr(v38 - 1, v37) );
}
else
{
v38 = *(_DWORD *)(v51 - 8);
*(_DWORD *)(v51 - 8) = v38 - 1;
}
if ( v38 <= 0 )
operator delete(v13);
}
sub_D153B8((int)&v51, "TargetPos:");
cocos2d::CCPoint::CCPoint(&v49, 75.0, 50.0);
cocos2d::CCPoint::operator+(&v50, &v48, &v49);
v53.x = 0.8;
v53.y = 0.0;
LODWORD(v42) = 0;
LOBYTE(v44) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
71,
(std::string)&v51,
v53,
9999.0,
(bool)&v50,
Float,
2,
10,
v14,
v15,
1,
0,
GoldLabel,
0,
v42,
v44);
v16 = (void *)(v51 - 24);
if ( (__int64 *)(v51 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v27 = (unsigned int *)(v51 - 8);
do
v28 = __ldaxr(v27);
while ( __stlxr(v28 - 1, v27) );
}
else
{
v28 = *(_DWORD *)(v51 - 8);
*(_DWORD *)(v51 - 8) = v28 - 1;
}
if ( v28 <= 0 )
operator delete(v16);
}
sub_D153B8((int)&v51, "No Effects");
cocos2d::CCPoint::CCPoint(&v49, -90.0, 0.0);
cocos2d::CCPoint::operator+(&v50, &v48, &v49);
v54.x = 1.0;
SetupTriggerPopup::createToggleValueControl(a1, 460, (std::string)&v51, v54, (bool)&v50, 0, 0, v17);
v18 = (void *)(v51 - 24);
if ( (__int64 *)(v51 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v35 = (unsigned int *)(v51 - 8);
do
v36 = __ldaxr(v35);
while ( __stlxr(v36 - 1, v35) );
}
else
{
v36 = *(_DWORD *)(v51 - 8);
*(_DWORD *)(v51 - 8) = v36 - 1;
}
if ( v36 <= 0 )
operator delete(v18);
}
sub_D153B8((int)&v51, "No SFX");
cocos2d::CCPoint::CCPoint(&v49, -90.0, -30.0);
cocos2d::CCPoint::operator+(&v50, &v48, &v49);
v55.x = 1.0;
SetupTriggerPopup::createToggleValueControl(a1, 461, (std::string)&v51, v55, (bool)&v50, 0, 0, v19);
v20 = (void *)(v51 - 24);
if ( (__int64 *)(v51 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v31 = (unsigned int *)(v51 - 8);
do
v32 = __ldaxr(v31);
while ( __stlxr(v32 - 1, v31) );
}
else
{
v32 = *(_DWORD *)(v51 - 8);
*(_DWORD *)(v51 - 8) = v32 - 1;
}
if ( v32 <= 0 )
operator delete(v20);
}
sub_D153B8((int)&v51, "Instant");
cocos2d::CCPoint::CCPoint(&v49, 40.0, 0.0);
cocos2d::CCPoint::operator+(&v50, &v48, &v49);
v56.x = 1.0;
SetupTriggerPopup::createToggleValueControl(a1, 487, (std::string)&v51, v56, (bool)&v50, 0, 0, v21);
v22 = (void *)(v51 - 24);
if ( (__int64 *)(v51 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v39 = (unsigned int *)(v51 - 8);
do
v40 = __ldaxr(v39);
while ( __stlxr(v40 - 1, v39) );
}
else
{
v40 = *(_DWORD *)(v51 - 8);
*(_DWORD *)(v51 - 8) = v40 - 1;
}
if ( v40 <= 0 )
operator delete(v22);
}
SetupTriggerPopup::postSetup(a1);
}
return v4;
}