//
// SFXBrowser::updatePageLabel from 0xa5d1c0 to 0xa5d3a0 (480 bytes)
//
// 2 xrefs:
// > SFXBrowser::setupList @ 0xa5d968
// > ??> @ 0xb7fa8
//
// 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 SFXBrowser::updatePageLabel(SFXBrowser *a1)
{
int v2; // w0
int m_cellAmount; // w4
int v4; // w20
int v5; // w1
int v6; // w4
const char *v7; // x1
__int64 v8; // x2
int v9; // w20
cocos2d::CCString *v10; // x0
size_t v11; // x0
__n128 v12; // q0
char *v13; // x4
unsigned int *v14; // x20
int v15; // w0
const char *CString; // [xsp+38h] [xbp+38h]
char *v17; // [xsp+50h] [xbp+50h] BYREF
v2 = cocos2d::CCArray::count(a1->m_searchResult->m_filterObjects);
if ( v2 <= 0 )
{
v17 = &byte_124B6C8;
v12 = sub_D1798C(&v17, "No matches", 10);
v9 = 0;
}
else
{
m_cellAmount = a1->m_cellAmount;
v4 = (v2 - 1) / m_cellAmount;
v5 = m_cellAmount * a1->m_searchResult->m_startIndex;
v17 = &byte_124B6C8;
v6 = m_cellAmount + v5;
v7 = (const char *)(unsigned int)(v5 + 1);
if ( v2 > v6 )
v8 = (unsigned int)v6;
else
v8 = (unsigned int)v2;
v9 = vcvtps_s32_f32((float)v4);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i to %i of %i",
v7,
v8,
(unsigned int)v2);
CString = cocos2d::CCString::getCString(v10);
v11 = strlen(CString);
v12 = sub_D1798C(&v17, CString, v11);
}
((void (__fastcall *)(cocos2d::CCLabelBMFont *, char *, long double))a1->m_pageLabel->setString)(
a1->m_pageLabel,
v17,
*(long double *)&v12);
a1->m_prevButton->setVisible(a1->m_prevButton, a1->m_searchResult->m_startIndex > 0);
a1->m_nextButton->setVisible(a1->m_nextButton, a1->m_searchResult->m_startIndex < v9);
v13 = v17 - 24;
if ( v17 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)(v17 - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *((_DWORD *)v17 - 2);
*((_DWORD *)v17 - 2) = v15 - 1;
}
if ( v15 <= 0 )
operator delete(v13);
}
}