//
// SetupReverbPopup::init from 0x1004b7dd0 to 0x1004b8321 (1361 bytes)
//
// 1 xrefs:
// > SetupReverbPopup::create @ 0x1004b7d8b
//
// 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 __fastcall SetupReverbPopup::init(SetupReverbPopup *a1, SFXTriggerGameObject *a2, cocos2d::CCArray *a3)
{
bool result; // al
cocos2d::CCLabelBMFont *v4; // rax
cocos2d::CCLabelBMFont *m_reverbLabel; // r15
cocos2d::CCSprite *v6; // r13
CCMenuItemSpriteExtra *v7; // r13
unsigned __int64 *v8; // r15
cocos2d::CCSprite *v9; // r14
CCMenuItemSpriteExtra *v10; // r15
unsigned __int64 *v11; // r12
cocos2d::CCSprite *v12; // r14
CCMenuItemSpriteExtra *v13; // r15
cocos2d::CCMenu *v14; // r14
char v15; // [rsp+8h] [rbp-D8h] BYREF
char v16[15]; // [rsp+9h] [rbp-D7h] BYREF
void *v17; // [rsp+18h] [rbp-C8h]
char v18; // [rsp+20h] [rbp-C0h] BYREF
char v19[15]; // [rsp+21h] [rbp-BFh] BYREF
void *v20; // [rsp+30h] [rbp-B0h]
__int128 v21; // [rsp+38h] [rbp-A8h] BYREF
void *v22; // [rsp+48h] [rbp-98h]
float v23[2]; // [rsp+50h] [rbp-90h] BYREF
unsigned __int64 v24; // [rsp+58h] [rbp-88h] BYREF
void *v25[3]; // [rsp+60h] [rbp-80h] BYREF
__int128 v26; // [rsp+78h] [rbp-68h] BYREF
void *v27; // [rsp+88h] [rbp-58h]
unsigned __int64 v28; // [rsp+90h] [rbp-50h] BYREF
cocos2d::CCMenu *m_buttonMenu; // [rsp+98h] [rbp-48h]
double v30; // [rsp+A4h] [rbp-3Ch] BYREF
unsigned __int64 v31; // [rsp+ACh] [rbp-34h] BYREF
bool v32; // [rsp+B7h] [rbp-29h]
double v33; // 0:xmm0_8.8
double v34; // 0:xmm0_8.8
double v35; // 0:xmm0_8.8
result = SetupTriggerPopup::init(a1, a2, a3, 320.0, 140.0, 2);
if ( result )
{
v32 = result;
SetupTriggerPopup::preSetup(a1);
strcpy((char *)v25, "$Edit Global Reverb");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)v25);
if ( ((__int64)v25[0] & 1) != 0 )
operator delete(v25[2]);
v15 = 4;
strcpy(v16, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v15);
if ( (v15 & 1) != 0 )
operator delete(v17);
v18 = 8;
strcpy(v19, "Help");
v22 = operator new(0xB8u);
*(_QWORD *)&v21 = 185;
*((_QWORD *)&v21 + 1) = 183;
strcpy(
(char *)v22,
"Lets you change the Reverb settings.\n"
"The sound engine has one global reverb channel. This means that two sounds with different reverb settings cannot b"
"e played simultaneously.");
SetupTriggerPopup::addHelpButton((__int64)a1, (__int64)&v18, &v21, (__m128)0x3F800000u);
if ( (v21 & 1) != 0 )
operator delete(v22);
if ( (v18 & 1) != 0 )
operator delete(v20);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v23);
sub_10028CBE0((float *)&v28, v23[0] * 0.5, v23[1] * 0.5);
LOBYTE(v26) = 12;
strcpy((char *)&v26 + 1, "Enable");
sub_10028CBE0((float *)&v31, (float)(a1->m_width * 0.5) + -78.0, 24.0 - (float)(a1->m_height * 0.5));
sub_10028CCE0(&v30, &v28, &v31);
SetupTriggerPopup::createToggleValueControl((int)a1, 503, &v26, 1.0, (__int64)&v30, 0, 0, 0);
if ( (v26 & 1) != 0 )
operator delete(v27);
v4 = cocos2d::CCLabelBMFont::create_3("Reverb", "goldFont.fnt");
a1->m_reverbLabel = v4;
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v4,
1);
m_reverbLabel = a1->m_reverbLabel;
sub_10028CBE0((float *)&v31, 0.0, 5.0);
sub_10028CCE0(&v30, &v28, &v31);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, double *))m_reverbLabel->setPosition)(m_reverbLabel, &v30);
v6 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v6, 1);
((void (__fastcall *)(cocos2d::CCSprite *, float))v6->setScale)(v6, 0.80000001);
v7 = CCMenuItemSpriteExtra::create(
v6,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SetupReverbPopup::onReverb);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v7);
m_buttonMenu = a1->m_buttonMenu;
v8 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_reverbLabel->getPosition)(a1->m_reverbLabel);
sub_10028CBE0((float *)&v24, 100.0, 0.0);
sub_10028CCE0((double *)&v31, v8, &v24);
*(cocos2d::CCPoint *)&v33 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v30,
(const cocos2d::CCPoint *)m_buttonMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v7->setPosition)(v7, &v30, v33);
CCMenuItemSpriteExtra::setSizeMult(v7, 1.4);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))v7->setTag)(v7, 1);
v9 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v9->setScale)(v9, 0.80000001);
v10 = CCMenuItemSpriteExtra::create(
v9,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SetupReverbPopup::onReverb);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v10);
m_buttonMenu = a1->m_buttonMenu;
v11 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_reverbLabel->getPosition)(a1->m_reverbLabel);
sub_10028CBE0((float *)&v24, -100.0, 0.0);
sub_10028CCE0((double *)&v31, v11, &v24);
*(cocos2d::CCPoint *)&v34 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v30,
(const cocos2d::CCPoint *)m_buttonMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v10->setPosition)(v10, &v30, v34);
CCMenuItemSpriteExtra::setSizeMult(v10, 1.4);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))v10->setTag)(v10, 0);
SetupReverbPopup::updateReverbLabel(a1);
v12 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_playMusicBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v12->setScale)(v12, 0.89999998);
v13 = CCMenuItemSpriteExtra::create(
v12,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SetupReverbPopup::onPlay);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v13);
v14 = a1->m_buttonMenu;
sub_10028CBE0((float *)&v24, (float)(a1->m_width * 0.5) + -24.0, (float)(0.5 * a1->m_height) + -24.0);
sub_10028CCE0((double *)&v31, &v28, &v24);
*(cocos2d::CCPoint *)&v35 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v30,
(const cocos2d::CCPoint *)v14);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v13->setPosition)(v13, &v30, v35);
SetupTriggerPopup::postSetup(a1);
return v32;
}
return result;
}