//
// CustomSongWidget::downloadSongFailed from 0x100620c80 to 0x100620e23 (419 bytes)
//
// 2 xrefs:
// > sub_100620E90 @ 0x100620e9c
// > ??> @ 0x100982258
//
// 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::downloadSongFailed(CustomSongWidget *a1, int a2, GJSongError a3)
{
std::__vector_base::pointer begin; // r14
std::__vector_base::pointer end; // rax
size_t v6; // r15
__int64 v7; // rcx
cocos2d::CCLabelBMFont *m_errorLabel; // rdi
cocos2d::CCLabelBMFont *v10; // rdi
void (__cdecl *setString)(cocos2d::CCLabelBMFont *__hidden, const char *); // rax
cocos2d::CCLabelBMFont *v12; // rdi
float v13; // xmm0_4
float v14; // xmm1_4
__int128 v15; // [rsp+0h] [rbp-30h] BYREF
if ( !a1->m_hasSFX )
{
if ( a1->m_customSongID != a2 || a1->m_customSongID == 0 )
return;
m_errorLabel = a1->m_errorLabel;
BYTE2(v15) = 25;
LOWORD(v15) = 13055;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int128 *))m_errorLabel->setColor)(m_errorLabel, &v15);
v10 = a1->m_errorLabel;
setString = v10->setString;
if ( (unsigned int)(a3 - 1) > 2 )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))setString)(
v10,
"Download failed. Please try later.");
v12 = a1->m_errorLabel;
if ( !a1->m_isMusicLibrary )
goto LABEL_13;
}
else
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *))setString)(v10, off_100982350[a3 - 1]);
v12 = a1->m_errorLabel;
if ( !a1->m_isMusicLibrary )
{
LABEL_13:
v13 = 230.0;
v14 = 0.40000001;
LABEL_16:
cocos2d::CCLabelBMFont::limitLabelWidth(v12, v13, v14, 0.0);
CustomSongWidget::showError(a1, 0);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_sliderGroove->setVisible)(a1->m_sliderGroove, 0);
cocos2d::CCNode::unschedule(
a1,
(cocos2d::SEL_SCHEDULE)(unsigned __int64)CustomSongWidget::updateDownloadProgress);
a1->m_isNotDownloading = 0;
CustomSongWidget::updateSongInfo(a1);
return;
}
}
v13 = 140.0;
v14 = 0.34999999;
goto LABEL_16;
}
begin = a1->m_undownloadedAssets.__begin_;
end = a1->m_undownloadedAssets.__end_;
if ( begin != end )
{
v6 = (char *)end - (char *)begin - 19;
while ( begin->m_id != a2 || begin->m_assetType != 1 )
{
begin = (std::__vector_base::pointer)((char *)begin + 16);
v6 -= 16LL;
if ( begin == end )
return;
}
++begin->m_status;
LOBYTE(begin[1].m_id) = 0;
if ( &begin[1].m_assetType != (GJAssetType *)end )
{
v15 = *(_OWORD *)&begin->m_id;
memmove(begin, &begin[1].m_assetType, v6);
v7 = *(_QWORD *)((char *)&v15 + 5);
*(_QWORD *)((char *)&begin->m_id + v6 + 3) = v15;
*(_QWORD *)((char *)&begin->m_status + v6) = v7;
}
CustomSongWidget::processNextMultiAsset(a1);
}
}