//
// SongCell::loadFromObject from 0x1001051e0 to 0x1001055f0 (1040 bytes)
//
// 1 xrefs:
// > CustomListView::loadCell @ 0x1001010e4
//
// 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 SongCell::loadFromObject(SongCell *a1, SongObject *a2)
{
__int64 v4; // x21
void **v5; // x0
cocos2d::CCLabelBMFont *v6; // x19
__n128 v7; // q0
__n128 v8; // q1
__n128 v9; // q0
__n128 v10; // q1
__n128 v11; // q0
float *v12; // x0
ButtonSprite *v13; // x22
CCMenuItemSpriteExtra *v14; // x23
__int64 v15; // x23
float m_width; // s8
__n128 v17; // q0
__n128 v18; // q1
void **v19; // x8
cocos2d::CCString *v20; // x0
const char *CString; // x21
cocos2d::CCLabelBMFont *v22; // x21
__n128 v23; // q0
__n128 v24; // q1
float32x2_t *v25; // x19
__n128 v26; // q0
__n128 v27; // q1
double v28; // d0
__n128 v29; // q0
float *v30; // x0
float32x2_t v31; // [xsp+10h] [xbp-60h] BYREF
void *__p[2]; // [xsp+18h] [xbp-58h] BYREF
char v33; // [xsp+2Fh] [xbp-41h]
cocos2d::SEL_MenuHandler v34; // 0:x3.16
((void (__fastcall *)(cocos2d::CCLayer *, __int64))a1->m_mainLayer->removeAllChildrenWithCleanup)(a1->m_mainLayer, 1);
a1->m_songObject = a2;
v4 = LevelTools::artistForAudio(a2->m_audioID);
LevelTools::getAudioTitle(__p, (unsigned int)a2->m_audioID);
if ( v33 >= 0 )
v5 = __p;
else
v5 = (void **)__p[0];
v6 = cocos2d::CCLabelBMFont::create_1((const char *)v5, "bigFont.fnt");
if ( v33 < 0 )
operator delete(__p[0]);
v7 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v6);
v7.n128_u32[0] = 0;
v8.n128_u32[0] = 0.5;
sub_100022980(v7, v8, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v6->setAnchorPoint)(v6, __p);
v9 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v6->setScale)(v6, 1.0);
v10.n128_f32[0] = (float)(a1->m_height * 0.5) + 10.0;
v9.n128_u32[0] = 10.0;
sub_100022980(v9, v10, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v6->setPosition)(v6, __p);
v11.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v6->getContentSize)(v6);
if ( v11.n128_f32[0] > 240.0 )
{
v12 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v6->getContentSize)(v6, v11.n128_f32[0]);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v6->setScale)(v6, 240.0 / *v12);
}
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v6->getScale)(v6, v11) <= 0.7 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v6->getScale)(v6);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v6->setScale)(v6);
v13 = ButtonSprite::create_1("View", 50, 0, 0.6, 0, "bigFont.fnt", "GJ_button_01.png", 30.0);
v34.ptr = (void (__cdecl *)(cocos2d::CCObject *))SongCell::onClick;
v34.adj = 0;
v14 = CCMenuItemSpriteExtra::create(v13, nullptr, a1, v34);
CCMenuItemSpriteExtra::setSizeMult(v14, 1.5);
v15 = sub_1001D7ED0(v14);
((void (__fastcall *)(cocos2d::CCLayer *, __int64))a1->m_mainLayer->addChild)(a1->m_mainLayer, v15);
m_width = a1->m_width;
v17.n128_f32[0] = (float)(m_width
- (float)(*(float *)((__int64 (__fastcall *)(ButtonSprite *))v13->getContentSize)(v13) * 0.5))
+ -9.0;
v18.n128_f32[0] = a1->m_height * 0.5;
sub_100022980(v17, v18, __p);
(*(void (__fastcall **)(__int64, void **))(*(_QWORD *)v15 + 184LL))(v15, __p);
LevelTools::nameForArtist(__p, v4);
if ( v33 >= 0 )
v19 = __p;
else
v19 = (void **)__p[0];
v20 = (cocos2d::CCString *)sub_100268F4C("By %s", (const char *)v19);
CString = cocos2d::CCString::getCString(v20);
if ( v33 < 0 )
operator delete(__p[0]);
v22 = cocos2d::CCLabelBMFont::create_1(CString, "goldFont.fnt");
v23 = ((__n128 (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v22);
v23.n128_u32[0] = 0;
v24.n128_u32[0] = 0.5;
sub_100022980(v23, v24, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v22->setAnchorPoint)(v22, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v22->setScale)(v22, 1.0);
v25 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v6->getPosition)(v6);
v26.n128_u32[0] = 2.0;
v27.n128_u32[0] = -21.0;
sub_100022980(v26, v27, &v31);
*(float32x2_t *)&v28 = sub_1000229DC(v25, &v31, (float32x2_t *)__p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **, double))v22->setPosition)(v22, __p, v28);
v29.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v22->getContentSize)(v22);
if ( v29.n128_f32[0] > 140.0 )
{
v30 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v22->getContentSize)(v22, v29.n128_f32[0]);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v22->setScale)(v22, 140.0 / *v30);
}
if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v22->getScale)(v22, v29) <= 0.7 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v22->getScale)(v22);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v22->setScale)(v22);
}