//
// CustomSFXWidget::onPlayback from 0x1002f0b04 to 0x1002f0bb8 (180 bytes)
//
// 2 xrefs:
// > CustomSFXWidget::downloadSFXFinished @ 0x1002f16f0
// > CustomSFXWidget::init @ 0x1002f027c
//
// 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
//
void __fastcall CustomSFXWidget::onPlayback(CustomSFXWidget *a1, cocos2d::CCObject *a2)
{
FMODAudioEngine *v3; // x0
CustomSFXDelegate *m_delegate; // x0
FMODAudioEngine *v5; // x20
std::string *v6; // x1
std::string v7; // [xsp+0h] [xbp-40h] BYREF
void *__p[2]; // [xsp+18h] [xbp-28h] BYREF
char v9; // [xsp+2Fh] [xbp-11h]
if ( a1->m_sfxObject )
{
v3 = FMODAudioEngine::sharedEngine();
FMODAudioEngine::stopAllEffects(v3);
m_delegate = a1->m_delegate;
if ( !m_delegate
|| (((__int64 (__fastcall *)(CustomSFXDelegate *, SFXInfoObject *))m_delegate->overridePlaySFX)(
m_delegate,
a1->m_sfxObject)
& 1) == 0 )
{
v5 = FMODAudioEngine::sharedEngine();
MusicDownloadManager::sharedState();
MusicDownloadManager::pathForSFX((unsigned int)a1->m_sfxObject->m_sfxID, &v7);
if ( (v7.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v6 = &v7;
else
v6 = (std::string *)v7.__r_.__value_.__r.__words[0];
sub_100009900(__p, (char *)v6);
FMODAudioEngine::playEffectAsync((__int64)v5, (__int64)__p);
if ( v9 < 0 )
operator delete(__p[0]);
if ( SHIBYTE(v7.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v7.__r_.__value_.__l.__data_);
}
}
}