//
// CustomSongWidget::updateDownloadProgress from 0x1006fb7a0 to 0x1006fb86c (204 bytes)
//
// 13 xrefs:
// > CustomSongWidget::init @ 0x1006f85ee
// > CustomSongWidget::onDownload @ 0x1006f8853
// > CustomSongWidget::startMonitorDownload @ 0x1006fab67
// > CustomSongWidget::startDownload @ 0x1006fb761
// > CustomSongWidget::updateDownloadProgress @ 0x1006fb7e0
// > CustomSongWidget::downloadFailed @ 0x1006fb88b
// > CustomSongWidget::loadSongInfoFinished @ 0x1006fcb66
// > CustomSongWidget::loadSongInfoFailed @ 0x1006fcde1
// > CustomSongWidget::downloadSongStarted @ 0x1006fcfef
// > sub_1006FD030 @ 0x1006fd0c9
// > CustomSongWidget::downloadSongFailed @ 0x1006fd568
// > CustomSongWidget::musicActionFailed @ 0x1006fdb14
// > sub_1006FDB40 @ 0x1006fdb6c
//
// 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:35:56 +0000
//
__int64 __fastcall CustomSongWidget::updateDownloadProgress(_QWORD *a1, double a2, double a3, __m128 a4)
{
__int64 v4; // rax
int DownloadProgress; // eax
int v7; // ecx
__int64 v8; // rbx
_BYTE v9[32]; // [rsp+0h] [rbp-20h] BYREF
v4 = MusicDownloadManager::sharedState();
DownloadProgress = MusicDownloadManager::getDownloadProgress(v4);
if ( a1[42] == 0 || DownloadProgress == -1 )
{
cocos2d::CCNode::unschedule((__int64)a1, (__int64)CustomSongWidget::updateDownloadProgress, 0);
return CustomSongWidget::updateSongInfo((__int64)a1);
}
else
{
v7 = 0;
if ( DownloadProgress > 0 )
v7 = DownloadProgress;
v8 = a1[58];
a4.f32[0] = fminf(
(float)((float)v7 / 100.0) * (float)(*(float *)(a1[57] + 432LL) + -4.0),
*(float *)(a1[57] + 432LL) + -4.0);
sub_100278270((__int64)v9, 0.0, 0.0, a4, (__m128)0x41000000u);
return (*(__int64 (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v8 + 1136LL))(v8, v9);
}
}