//
// CustomSFXWidget::updateDownloadProgress from 0x1005e49a0 to 0x1005e4a69 (201 bytes)
//
// 6 xrefs:
// > CustomSFXWidget::init @ 0x1005e3908
// > CustomSFXWidget::onDownload @ 0x1005e3a71
// > CustomSFXWidget::startMonitorDownload @ 0x1005e461a
// > CustomSFXWidget::startDownload @ 0x1005e4964
// > CustomSFXWidget::updateDownloadProgress @ 0x1005e49dd
// > CustomSFXWidget::downloadFailed @ 0x1005e4aec
//
// 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::updateDownloadProgress(CustomSFXWidget *a1, float a2)
{
__m128 v2; // xmm2
MusicDownloadManager *v3; // rax
int SFXDownloadProgress; // eax
int v5; // ecx
cocos2d::CCSprite *m_progressBarSprite; // rbx
_BYTE v7[32]; // [rsp+0h] [rbp-20h] BYREF
v3 = MusicDownloadManager::sharedState();
SFXDownloadProgress = MusicDownloadManager::getSFXDownloadProgress(v3, a1->m_sfxObject->m_sfxID);
if ( a1->m_sfxObject == nullptr || SFXDownloadProgress == -1 )
{
cocos2d::CCNode::unschedule(a1, (cocos2d::SEL_SCHEDULE)(unsigned __int64)CustomSFXWidget::updateDownloadProgress);
CustomSFXWidget::updateSFXInfo(a1);
}
else
{
v5 = 0;
if ( SFXDownloadProgress > 0 )
v5 = SFXDownloadProgress;
m_progressBarSprite = a1->m_progressBarSprite;
v2.f32[0] = fminf(
(float)((float)v5 / 100.0) * (float)(a1->m_progressOutlineSprite->m_obRect.size.width + -4.0),
a1->m_progressOutlineSprite->m_obRect.size.width + -4.0);
sub_10028CC00((__int64)v7, 0.0, 0.0, v2, (__m128)0x41000000u);
((void (__fastcall *)(cocos2d::CCSprite *, _BYTE *))m_progressBarSprite->setTextureRect)(m_progressBarSprite, v7);
}
}