//
// CustomSongWidget::updateDownloadProgress from 0x10061f210 to 0x10061f2dc (204 bytes)
//
// 13 xrefs:
// > CustomSongWidget::init @ 0x10061ba22
// > CustomSongWidget::onDownload @ 0x10061bc83
// > CustomSongWidget::startMonitorDownload @ 0x10061e6d7
// > CustomSongWidget::startDownload @ 0x10061f1d1
// > CustomSongWidget::updateDownloadProgress @ 0x10061f250
// > CustomSongWidget::downloadFailed @ 0x10061f2fb
// > CustomSongWidget::loadSongInfoFinished @ 0x1006203f6
// > CustomSongWidget::loadSongInfoFailed @ 0x100620671
// > CustomSongWidget::downloadSongStarted @ 0x10062087f
// > sub_1006208C0 @ 0x100620959
// > CustomSongWidget::downloadSongFailed @ 0x100620df8
// > CustomSongWidget::musicActionFailed @ 0x10062139b
// > sub_1006213D0 @ 0x1006213f3
//
// 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 CustomSongWidget::updateDownloadProgress(CustomSongWidget *a1, float a2)
{
__m128 v2; // xmm2
MusicDownloadManager *v3; // rax
int DownloadProgress; // eax
int v5; // ecx
cocos2d::CCSprite *m_sliderBar; // rbx
_BYTE v7[32]; // [rsp+0h] [rbp-20h] BYREF
v3 = MusicDownloadManager::sharedState();
DownloadProgress = MusicDownloadManager::getDownloadProgress(v3, a1->m_songInfoObject->m_songID);
if ( a1->m_songInfoObject == nullptr || DownloadProgress == -1 )
{
cocos2d::CCNode::unschedule(a1, (cocos2d::SEL_SCHEDULE)(unsigned __int64)CustomSongWidget::updateDownloadProgress);
CustomSongWidget::updateSongInfo(a1);
}
else
{
v5 = 0;
if ( DownloadProgress > 0 )
v5 = DownloadProgress;
m_sliderBar = a1->m_sliderBar;
v2.f32[0] = fminf(
(float)((float)v5 / 100.0) * (float)(a1->m_sliderGroove->m_obRect.size.width + -4.0),
a1->m_sliderGroove->m_obRect.size.width + -4.0);
sub_10028CC00((__int64)v7, 0.0, 0.0, v2, (__m128)0x41000000u);
((void (__fastcall *)(cocos2d::CCSprite *, _BYTE *))m_sliderBar->setTextureRect)(m_sliderBar, v7);
}
}