//
// CustomSFXWidget::deleteSFX from 0x140161950 to 0x140161b24 (468 bytes)
//
// 2 xrefs:
// > CustomSFXWidget::FLAlert_Clicked @ 0x1401639a9
// > ??> @ 0x140917cf0
//
// 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 11:27:25 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall CustomSFXWidget::deleteSFX(__int64 a1)
{
__int64 v2; // rcx
_QWORD *v3; // rcx
__int64 v4; // rcx
const char *v5; // rcx
__int64 v6; // rdx
__int16 v7; // [rsp+20h] [rbp-68h] BYREF
char v8; // [rsp+22h] [rbp-66h]
void *v9; // [rsp+28h] [rbp-60h]
char *FileName[4]; // [rsp+30h] [rbp-58h] BYREF
_BYTE v11[32]; // [rsp+50h] [rbp-38h] BYREF
if ( *(_QWORD *)(a1 + 336) )
{
v2 = qword_14090C070;
if ( !qword_14090C070 )
{
v9 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v2 = qword_14090C070;
}
MusicDownloadManager::pathForSFX(v2, v11, *(unsigned int *)(*(_QWORD *)(a1 + 336) + 56LL));
v3 = (_QWORD *)qword_14090BF60;
if ( !qword_14090BF60 )
{
v9 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v3 = (_QWORD *)qword_14090BF60;
}
FMODAudioEngine::stopAllEffects(v3);
v4 = qword_14090C070;
if ( !qword_14090C070 )
{
v9 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v4 = qword_14090C070;
}
MusicDownloadManager::pathForSFX(v4, FileName, *(unsigned int *)(*(_QWORD *)(a1 + 336) + 56LL));
v5 = (const char *)FileName;
if ( FileName[3] > (char *)0xF )
v5 = FileName[0];
remove(v5);
sub_14003D310((__int64)FileName);
CustomSFXWidget::updateSFXInfo(a1);
LOBYTE(v6) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 368) + 336LL))(*(_QWORD *)(a1 + 368), v6);
v7 = 25855;
v8 = 0;
(**(void (__fastcall ***)(__int64, __int16 *))(*(_QWORD *)(a1 + 368) + 368LL))(*(_QWORD *)(a1 + 368) + 368LL, &v7);
(**(void (__fastcall ***)(__int64, const char *))(*(_QWORD *)(a1 + 368) + 360LL))(
*(_QWORD *)(a1 + 368) + 360LL,
"SFX Deleted");
cocos2d::CCLabelBMFont::limitLabelWidth(*(cocos2d::CCLabelBMFont **)(a1 + 368), 230.0, 0.40000001, 0.0);
sub_14003D310((__int64)v11);
}
}