//
// EditorSFXActionConfigLayer::refreshRows from 0x1008dfb50 to 0x1008e057b (2603 bytes)
//
// 3 xrefs:
// > EditorSFXActionConfigLayer::init @ 0x1008df96a
// > EditorSFXActionConfigLayer::refreshRowsAddedDeferred @ 0x1008e0829
// > EditorSFXActionConfigLayer::rebuildContent @ 0x1008e08e5
//
// 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:37:45 +0000
//
__int64 __fastcall EditorSFXActionConfigLayer::refreshRows(__int64 a1)
{
__int64 v1; // rax
__int64 v3; // rdi
int v4; // edx
int v5; // ecx
int v6; // r8d
int v7; // r9d
__int64 v8; // rax
__int64 v9; // rdi
__int64 v10; // rax
__int64 v11; // rax
__int64 v12; // rsi
__int64 v13; // r12
bool v14; // bl
void *v15; // r15
__int64 v16; // rsi
void *v17; // r13
int v18; // ecx
void *v19; // r13
void *v20; // rdi
float v21; // xmm0_4
__int64 v22; // r13
int v23; // ebx
unsigned int v24; // r15d
__int64 v25; // rax
__int64 SFXObject; // rax
__int64 v27; // rbx
__int64 v28; // rax
std::string::pointer data; // rdi
void *v30; // r12
double v31; // xmm0_8
char *v32; // r12
__int64 v33; // rax
void *v34; // r12
double v35; // xmm0_8
char *v36; // r12
__int64 v37; // rax
void *v38; // r12
double v39; // xmm0_8
char *v40; // r12
__int64 v41; // rax
void *v42; // r12
void *v43; // r14
__int64 v45; // [rsp+0h] [rbp-E0h]
__int64 v46; // [rsp+8h] [rbp-D8h]
__int64 v47; // [rsp+10h] [rbp-D0h] BYREF
unsigned int v48; // [rsp+18h] [rbp-C8h]
float v49; // [rsp+1Ch] [rbp-C4h]
float v50; // [rsp+20h] [rbp-C0h]
float v51; // [rsp+24h] [rbp-BCh]
float v52; // [rsp+28h] [rbp-B8h]
float v53; // [rsp+2Ch] [rbp-B4h]
std::string v54; // [rsp+30h] [rbp-B0h] BYREF
__int64 v55; // [rsp+50h] [rbp-90h]
int v56; // [rsp+5Ch] [rbp-84h]
std::string v57; // [rsp+60h] [rbp-80h] BYREF
float v58; // [rsp+7Ch] [rbp-64h]
__int64 v59; // [rsp+80h] [rbp-60h]
float v60; // [rsp+8Ch] [rbp-54h]
char v61[16]; // [rsp+90h] [rbp-50h] BYREF
char __str[16]; // [rsp+A0h] [rbp-40h] BYREF
v1 = *(_QWORD *)(a1 + 1048);
if ( v1 && *(_QWORD *)(a1 + 1056) )
{
*(_DWORD *)(a1 + 1068) = *(_DWORD *)(v1 + 436);
v3 = *(_QWORD *)(v1 + 416);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v3 + 584LL))(v3, 1);
v8 = cocos2d::CCMenu::create(v3, 1, v4, v5, v6, v7);
*(_QWORD *)(a1 + 1056) = v8;
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v8 + 296LL))(v8, &unk_100BE70B8);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 1056) + 320LL))(*(_QWORD *)(a1 + 1056), &unk_100BE70C0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(a1 + 1056) + 184LL))(*(_QWORD *)(a1 + 1056), &unk_100BE70B8);
v9 = *(_QWORD *)(*(_QWORD *)(a1 + 1048) + 416LL);
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v9 + 464LL))(v9, *(_QWORD *)(a1 + 1056), 2);
v10 = EditorSFXManager::sharedState(v9);
v11 = EditorSFXManager::soundsForAction(v10, *(unsigned int *)(a1 + 1024));
v45 = v11;
if ( v11 )
v56 = sub_1007FEF90(v11);
else
v56 = 0;
v59 = a1;
sub_100278630(&v47, (_QWORD *)(*(_QWORD *)(a1 + 1048) + 424LL));
v53 = 0.5 * *(float *)&v47;
if ( v56 > 0 )
{
v49 = *(float *)&v47;
v52 = *(float *)&v47 + -23.0;
v50 = (float)(*(float *)&v47 + -23.0) + -28.0;
v51 = v50 + -28.0;
v46 = v59 + 1048;
v12 = 0;
while ( 1 )
{
while ( 1 )
{
v60 = (float)((float)(int)v12 * -32.0) + -20.0;
v55 = v12;
v13 = sub_1007FEFE0(v45, v12);
if ( v13 )
break;
v12 = (unsigned int)(v55 + 1);
if ( (_DWORD)v55 + 1 == v56 )
goto LABEL_35;
}
v14 = (v55 & 1) == 0;
sub_100278270((__int64)&v57, 0.0, 0.0, (__m128)0x42200000u, (__m128)0x42200000u);
v15 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"square02_small.png", (unsigned __int64 *)&v57);
sub_100278260((float *)&v57, v49, 30.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v15 + 320LL))(v15, &v57);
v57.__r_.__value_.__s.__data_[1] = 0;
*(_WORD *)&v57.__r_.__value_.__l.0 = 0;
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v15 + 960LL))(v15, &v57);
v16 = 40;
if ( v14 )
v16 = 70;
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v15 + 912LL))(v15, v16);
sub_100278250((float *)&v57, v53, v60);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v15 + 184LL))(v15, &v57);
(*(void (__fastcall **)(_QWORD, void *, _QWORD))(**(_QWORD **)(*(_QWORD *)(v59 + 1048) + 416LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)(v59 + 1048) + 416LL),
v15,
0);
v48 = v55 + 1;
snprintf(__str, 0x10u, "%d.", v55 + 1);
v17 = cocos2d::CCLabelBMFont::create_3((__int64)__str, (__int64)"bigFont.fnt");
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v17 + 160LL))(v17, 0.34999999);
sub_100278250((float *)&v57, 0.0, 0.5);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v17 + 296LL))(v17, &v57);
v57.__r_.__value_.__s.__data_[1] = -86;
*(_WORD *)&v57.__r_.__value_.__l.0 = -21846;
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v17 + 1072LL))(v17, &v57);
sub_100278250((float *)&v57, 10.0, v60);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v17 + 184LL))(v17, &v57);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(*(_QWORD *)v46 + 416LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)v46 + 416LL),
v17,
1);
memset(&v57, 0, sizeof(v57));
v18 = *(_DWORD *)(v13 + 1864);
if ( v18 > 0 )
break;
std::string::assign(&v57, "(empty)");
v58 = 30.0;
data = v57.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_24;
LABEL_25:
v30 = cocos2d::CCLabelBMFont::create_3((__int64)data, (__int64)"bigFont.fnt");
sub_100278250((float *)&v54, 0.0, 0.5);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v30 + 296LL))(v30, &v54);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v30 + 160LL))(v30, 0.44999999);
cocos2d::CCLabelBMFont::limitLabelWidth(
(__int64)v30,
(float)(v52 - v58) + -90.0,
(__m128)0x3EE66666u,
(__m128)0x3E99999Au);
sub_100278250((float *)&v54, v58, v60);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v30 + 184LL))(v30, &v54);
v31 = (*(double (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(*(_QWORD *)(v59 + 1048) + 416LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)(v59 + 1048) + 416LL),
v30,
1);
v32 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_deleteBtn_001.png", v31);
v33 = (*(__int64 (__fastcall **)(char *))(*(_QWORD *)v32 + 328LL))(v32);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v32 + 160LL))(v32, 24.0 / *(float *)(v33 + 4));
v34 = CCMenuItemSpriteExtra::create((__int64)v32, 0, v59, (__int64)EditorSFXActionConfigLayer::onDeleteSound, 0);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v34 + 72LL))(v34, (unsigned int)(8 * v55 + 1002));
sub_100278250((float *)&v54, v52, v60);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v34 + 184LL))(v34, &v54);
v35 = (*(double (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v59 + 1056) + 456LL))(
*(_QWORD *)(v59 + 1056),
v34);
v36 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_editBtn_001.png", v35);
v37 = (*(__int64 (__fastcall **)(char *))(*(_QWORD *)v36 + 328LL))(v36);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v36 + 160LL))(v36, 24.0 / *(float *)(v37 + 4));
v38 = CCMenuItemSpriteExtra::create((__int64)v36, 0, v59, (__int64)EditorSFXActionConfigLayer::onEditSound, 0);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v38 + 72LL))(v38, (unsigned int)(8 * v55 + 1001));
sub_100278250((float *)&v54, v50, v60);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v38 + 184LL))(v38, &v54);
v39 = (*(double (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v59 + 1056) + 456LL))(
*(_QWORD *)(v59 + 1056),
v38);
v40 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_playBtn2_001.png", v39);
v41 = (*(__int64 (__fastcall **)(char *))(*(_QWORD *)v40 + 328LL))(v40);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v40 + 160LL))(v40, 24.0 / *(float *)(v41 + 4));
v42 = CCMenuItemSpriteExtra::create(
(__int64)v40,
0,
v59,
(__int64)EditorSFXActionConfigLayer::onPreviewSound,
0);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v42 + 72LL))(v42, (unsigned int)(8 * v55 + 1000));
sub_100278250((float *)&v54, v51, v60);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v42 + 184LL))(v42, &v54);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v59 + 1056) + 456LL))(*(_QWORD *)(v59 + 1056), v42);
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v57.__r_.__value_.__l.__data_);
v12 = v48;
if ( v48 == v56 )
goto LABEL_35;
}
snprintf(v61, 0x10u, "%d", v18);
v19 = cocos2d::CCLabelBMFont::create_3((__int64)v61, (__int64)"goldFont.fnt");
sub_100278250((float *)&v54, 0.0, 0.5);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v19 + 296LL))(v19, &v54);
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v19 + 160LL))(v19, 0.44999999);
sub_100278250((float *)&v54, 30.0, v60);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v19 + 184LL))(v19, &v54);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(*(_QWORD *)(v59 + 1048) + 416LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)(v59 + 1048) + 416LL),
v19,
1);
v58 = *(float *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v19 + 328LL))(v19);
v20 = v19;
v21 = (*(float (__fastcall **)(void *))(*(_QWORD *)v19 + 136LL))(v19);
v58 = (float)((float)(v58 * v21) + 6.0) + 30.0;
if ( *(int *)(v13 + 1868) > 0 )
{
v22 = MusicDownloadManager::sharedState();
v23 = *(_DWORD *)(v13 + 1864);
v24 = *(_DWORD *)(v13 + 1868);
v25 = EditorSFXManager::sharedState(v20);
EditorSFXManager::getCustomSFXRawPath(&v54, v25, *(unsigned int *)(v13 + 1864), *(unsigned int *)(v13 + 1868));
SFXObject = (__int64)sub_1006527D0(v22, v23, v24, &v54);
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) != 0 )
{
v27 = SFXObject;
operator delete(v54.__r_.__value_.__l.__data_);
SFXObject = v27;
}
if ( SFXObject )
goto LABEL_18;
}
v28 = MusicDownloadManager::sharedState();
SFXObject = MusicDownloadManager::getSFXObject(v28, *(_DWORD *)(v13 + 1864));
if ( SFXObject )
{
LABEL_18:
if ( (*(_BYTE *)(SFXObject + 80) & 1) != 0 )
{
sub_10001AD30(&v54, *(const void **)(SFXObject + 96), *(_QWORD *)(SFXObject + 88));
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_29;
}
else
{
v54 = *(std::string *)(SFXObject + 80);
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_29;
}
}
else
{
v54.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)18;
strcpy(v54.__r_.__value_.__s.__data_, "(missing)");
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_29:
v57 = v54;
data = v57.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v54.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_25;
LABEL_24:
data = v57.__r_.__value_.__l.__data_;
goto LABEL_25;
}
}
operator delete(v57.__r_.__value_.__l.__data_);
goto LABEL_29;
}
if ( !v56 )
{
v43 = cocos2d::CCLabelBMFont::create_3((__int64)"No sounds bound. Tap + Add Sound below.", (__int64)"bigFont.fnt");
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v43 + 160LL))(v43, 0.5);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v43 + 1024LL))(v43, 140);
sub_100278250((float *)&v57, v53, *((float *)&v47 + 1) * 0.5);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v43 + 184LL))(v43, &v57);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(*(_QWORD *)(v59 + 1048) + 416LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)(v59 + 1048) + 416LL),
v43,
1);
}
LABEL_35:
ScrollableContentLayer::setContentHeight(
*(_QWORD *)(v59 + 1048),
fmaxf(*((float *)&v47 + 1), (float)((float)v56 * 32.0) + 8.0));
ScrollableContentLayer::scrollTo(COERCE_DOUBLE((unsigned __int64)*(_DWORD *)(v59 + 1068)));
}
return __stack_chk_guard;
}