//
// FontPreviewCell::loadFromIndex from 0xd02bec to 0xd02f9c (944 bytes)
//
// 2 xrefs:
// > CustomListView::loadCell @ 0x74d204
// > ??> @ 0xbbf90
//
// This function is hookable on this platform (idp: arm, 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 13:06:55 +0000
//
__int64 __fastcall FontPreviewCell::loadFromIndex(FontPreviewCell *this, unsigned int a2, int a3)
{
float v6; // s10
float v7; // s8
cocos2d::CCString *v8; // x0
cocos2d::CCSpriteFrameCache *v9; // x0
cocos2d::CCSprite *v10; // x0
cocos2d::CCSpriteFrame *v11; // x1
__int64 v12; // x20
void (__fastcall *v13)(__int64, __int64 *); // x25
void (__fastcall *v14)(__int64, __int64 *); // x25
const char *v15; // x1
__int64 v16; // x20
cocos2d::CCMenu *v17; // x20
cocos2d::CCDirector **v18; // x24
cocos2d::CCDirector *v19; // x0
__int64 v20; // x0
cocos2d::CCTouchDispatcher *v21; // x0
void (__fastcall *v22)(cocos2d::CCDirector **, _QWORD); // x25
__int64 v23; // x0
__int64 v24; // x0
void (__fastcall *v25)(cocos2d::CCMenu *, __int64 *); // x25
__int64 v27; // x20
void (__fastcall *v28)(__int64, float); // x25
__int64 v29; // x0
void (__fastcall *v30)(__int64, __int64 *); // x2
cocos2d::CCString *v31; // x0
cocos2d::CCLabelBMFont *v32; // x0
const char *v33; // x2
void (__fastcall *v34)(__int64, __int64 *); // x25
void (__fastcall *v35)(__int64, __int64 *); // x25
cocos2d::CCPoint *CString; // [xsp+68h] [xbp+68h]
_BYTE v37[8]; // [xsp+78h] [xbp+78h] BYREF
__int64 v38; // [xsp+80h] [xbp+80h] BYREF
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 67) + 584LL))(*((_QWORD *)this + 67), 1);
*((_DWORD *)this + 138) = a2;
v6 = *((float *)this + 130);
v7 = *((float *)this + 131);
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"font%02dPreview.png",
(const char *)a2);
CString = (cocos2d::CCPoint *)cocos2d::CCString::getCString(v8);
v9 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(CString);
v10 = (cocos2d::CCSprite *)cocos2d::CCSpriteFrameCache::spriteFrameByName(v9, (const char *)CString);
if ( v10 )
{
v12 = cocos2d::CCSprite::createWithSpriteFrame(v10, v11);
v13 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 0.0, 0.5);
v13(v12, &v38);
v14 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 8.0, v7 * 0.5);
v14(v12, &v38);
if ( (float)(v7 - 4.0) < *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 328LL))(v12) + 4) )
{
v28 = *(void (__fastcall **)(__int64, float))(*(_QWORD *)v12 + 160LL);
v29 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 328LL))(v12);
v28(v12, (float)(v7 - 4.0) / *(float *)(v29 + 4));
if ( a2 != a3 )
goto LABEL_4;
}
else if ( a2 != a3 )
{
goto LABEL_4;
}
v30 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 960LL);
LOWORD(v38) = -256;
BYTE2(v38) = -106;
v30(v12, &v38);
}
else
{
v31 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Font %i",
(const char *)(a2 + 1));
v32 = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v31);
v12 = cocos2d::CCLabelBMFont::create(v32, "bigFont.fnt", v33);
v34 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 0.0, 0.5);
v34(v12, &v38);
v35 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v12 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v38, 8.0, v7 * 0.5);
v35(v12, &v38);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v12 + 160LL))(v12, 0.5);
}
LABEL_4:
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 67) + 456LL))(*((_QWORD *)this + 67), v12);
if ( a2 == a3 )
{
v16 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_selectSongOnBtn_001.png", v15);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v16 + 160LL))(v16, 0.65);
v17 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(
v16,
0,
(__int64)this,
(__int64)FontPreviewCell::onSelectFont,
0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v17, 1.1);
(*(void (__fastcall **)(cocos2d::CCMenu *, _QWORD))(*(_QWORD *)v17 + 1056LL))(v17, 0);
}
else
{
v27 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_selectSongBtn_001.png", v15);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v27 + 160LL))(v27, 0.65);
v17 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(
v27,
0,
(__int64)this,
(__int64)FontPreviewCell::onSelectFont,
0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v17, 1.1);
}
v18 = (cocos2d::CCDirector **)cocos2d::CCMenu::create(v17, nullptr);
v19 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(_QWORD, cocos2d::CCDirector **, __int64))(**((_QWORD **)this + 67)
+ 464LL))(
*((_QWORD *)this + 67),
v18,
3);
v20 = cocos2d::CCDirector::sharedDirector(v19);
v21 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 160LL))(v20);
if ( (unsigned __int8)cocos2d::CCTouchDispatcher::isUsingForcePrio(v21) )
{
v22 = *((void (__fastcall **)(cocos2d::CCDirector **, _QWORD))*v18 + 128);
v23 = cocos2d::CCDirector::sharedDirector(*v18);
v24 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v23 + 160LL))(v23);
v22(v18, (unsigned int)(*(_DWORD *)(v24 + 128) - 1));
}
v25 = *(void (__fastcall **)(cocos2d::CCMenu *, __int64 *))(*(_QWORD *)v17 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v37, v6 - 18.0, v7 * 0.5);
cocos2d::CCNode::convertToNodeSpace(&v38, (cocos2d::CCNode *)v18, (const cocos2d::CCPoint *)v37);
v25(v17, &v38);
FontPreviewCell::updateBGColor(this, a2);
return _stack_chk_guard;
}