//
// SetupPlatformerEndPopup::init from 0x100748d00 to 0x10074916e (1134 bytes)
//
// 1 xrefs:
// > sub_100748BF0 @ 0x100748cb4
//
// 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:36:32 +0000
//
__int64 __fastcall SetupPlatformerEndPopup::init(float *a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
unsigned int v4; // r15d
__int64 v5; // rax
char v6; // [rsp+28h] [rbp-F8h] BYREF
_BYTE v7[23]; // [rsp+29h] [rbp-F7h] BYREF
char v8; // [rsp+40h] [rbp-E0h] BYREF
char v9[15]; // [rsp+41h] [rbp-DFh] BYREF
void *v10; // [rsp+50h] [rbp-D0h]
__int128 v11; // [rsp+58h] [rbp-C8h] BYREF
void *v12; // [rsp+68h] [rbp-B8h]
__int128 v13; // [rsp+70h] [rbp-B0h] BYREF
void *v14; // [rsp+80h] [rbp-A0h]
__int64 v15; // [rsp+88h] [rbp-98h] BYREF
__int128 v16; // [rsp+90h] [rbp-90h] BYREF
void *v17; // [rsp+A0h] [rbp-80h]
__int128 v18; // [rsp+A8h] [rbp-78h] BYREF
void *v19; // [rsp+B8h] [rbp-68h]
__int128 v20; // [rsp+C0h] [rbp-60h] BYREF
void *v21; // [rsp+D0h] [rbp-50h]
unsigned __int64 v22; // [rsp+D8h] [rbp-48h] BYREF
unsigned __int64 v23; // [rsp+E0h] [rbp-40h] BYREF
double v24[2]; // [rsp+E8h] [rbp-38h] BYREF
void *v25; // [rsp+F8h] [rbp-28h]
unsigned __int64 v26[4]; // [rsp+100h] [rbp-20h] BYREF
result = SetupTriggerPopup::init((__int64)a1, a2, a3, 1, 300.0, 240.0, 0.0);
if ( (_BYTE)result )
{
v4 = result;
SetupTriggerPopup::preSetup(a1);
v6 = 18;
strcpy(v7, "Setup End");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)&v6);
if ( (v6 & 1) != 0 )
operator delete(*(void **)&v7[15]);
v8 = 4;
strcpy(v9, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v8);
if ( (v8 & 1) != 0 )
operator delete(v10);
LOBYTE(v11) = 8;
strcpy((char *)&v11 + 1, "Help");
v14 = operator new(0x170u);
*(_QWORD *)&v13 = 369;
*((_QWORD *)&v13 + 1) = 367;
strcpy(
(char *)v14,
"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((__int64)a1, &v11, &v13, 1.0);
if ( (v13 & 1) != 0 )
operator delete(v14);
if ( (v11 & 1) != 0 )
operator delete(v12);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1, (__int64)&v11);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v15, v5);
sub_100278250((float *)&v23, *(float *)&v15 * 0.5, 0.5 * *((float *)&v15 + 1));
LOBYTE(v24[0]) = 16;
strcpy((char *)v24 + 1, "SpawnID:");
sub_100278250((float *)&v22, -75.0, 50.0);
sub_100278350((double *)v26, &v23, &v22);
IDNameInput::create((_DWORD)a1, (_DWORD)a1 + 544, 1, 51, (unsigned int)v24, (unsigned int)v26, 6, 0, 0, 0);
if ( (LOBYTE(v24[0]) & 1) != 0 )
operator delete(v25);
LOBYTE(v24[0]) = 20;
strcpy((char *)v24 + 1, "TargetPos:");
sub_100278250((float *)&v22, 75.0, 50.0);
sub_100278350((double *)v26, &v23, &v22);
IDNameInput::create((_DWORD)a1, (_DWORD)a1 + 544, 1, 71, (unsigned int)v24, (unsigned int)v26, 6, 0, 0, 0);
if ( (LOBYTE(v24[0]) & 1) != 0 )
operator delete(v25);
LOBYTE(v16) = 20;
strcpy((char *)&v16 + 1, "No Effects");
sub_100278250((float *)v26, -90.0, 0.0);
sub_100278350(v24, &v23, v26);
SetupTriggerPopup::createToggleValueControl((int)a1, 460, &v16, (__int64)v24, 0, 0, 1.0, 0);
if ( (v16 & 1) != 0 )
operator delete(v17);
LOBYTE(v18) = 12;
strcpy((char *)&v18 + 1, "No SFX");
sub_100278250((float *)v26, -90.0, -30.0);
sub_100278350(v24, &v23, v26);
SetupTriggerPopup::createToggleValueControl((int)a1, 461, &v18, (__int64)v24, 0, 0, 1.0, 0);
if ( (v18 & 1) != 0 )
operator delete(v19);
LOBYTE(v20) = 14;
strcpy((char *)&v20 + 1, "Instant");
sub_100278250((float *)v26, 40.0, 0.0);
sub_100278350(v24, &v23, v26);
SetupTriggerPopup::createToggleValueControl((int)a1, 487, &v20, (__int64)v24, 0, 0, 1.0, 0);
if ( (v20 & 1) != 0 )
operator delete(v21);
SetupTriggerPopup::postSetup(a1);
return v4;
}
return result;
}