//
// LevelCell::loadLocalLevelCell from 0x10024ec30 to 0x10024f4be (2190 bytes)
//
// 1 xrefs:
// > LevelCell::loadFromLevel @ 0x1002447d8
//
// 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 LevelCell::loadLocalLevelCell(LevelCell *a1)
{
double v1; // xmm0_8
GJGameLevel *m_level; // rax
const char *data; // rdi
cocos2d::CCLabelBMFont *v5; // r14
float *v6; // rax
double v7; // xmm0_8
cocos2d::CCString *v8; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *v10; // r15
__int64 v11; // rsi
__int64 v12; // r12
ButtonSprite *v13; // r15
CCMenuItemSpriteExtra *v14; // r12
LevelCell *v15; // r13
float v16; // xmm0_4
float *v17; // rax
cocos2d::CCSprite *v18; // r12
const char *v19; // rdi
cocos2d::CCLabelBMFont *v20; // r14
__int64 v21; // rbx
cocos2d::CCSprite *v22; // r15
__int64 v23; // r12
float v24; // xmm0_4
const char *v25; // rdi
cocos2d::CCLabelBMFont *v26; // r14
__int64 v27; // rbx
cocos2d::CCSprite *v28; // r15
__int64 v29; // r12
float v30; // xmm0_4
GJGameLevel *v31; // rax
const char *v32; // rdi
cocos2d::CCLabelBMFont *v33; // r14
__int64 v34; // rbx
char v35[8]; // [rsp+0h] [rbp-60h] BYREF
_BYTE v36[8]; // [rsp+8h] [rbp-58h] BYREF
std::string m_levelName; // [rsp+10h] [rbp-50h] BYREF
float m_width; // [rsp+34h] [rbp-2Ch]
double v39; // 0:xmm0_8.8
m_level = a1->m_level;
if ( (m_level->m_levelName.m_data.m_short.sizex2 & 1) != 0 )
{
sub_100006B70(
&m_levelName,
m_level->m_levelName.m_data.m_long.longStorage,
m_level->m_levelName.m_data.m_long.size,
v1);
if ( (*(_BYTE *)&m_levelName.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_3;
}
else
{
m_levelName = (std::string)m_level->m_levelName;
if ( (*(_BYTE *)&m_levelName.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_3:
data = m_levelName.__r_.__value_.__s.__data_;
goto LABEL_6;
}
}
data = m_levelName.__r_.__value_.__l.__data_;
LABEL_6:
v5 = cocos2d::CCLabelBMFont::create_3(data, "bigFont.fnt");
if ( (*(_BYTE *)&m_levelName.__r_.__value_.__s.0 & 1) != 0 )
operator delete(m_levelName.__r_.__value_.__l.__data_);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v5);
sub_10028CBE0(&m_levelName, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v5->setAnchorPoint)(v5, &m_levelName);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v5->setScale)(v5, 1.0);
sub_10028CBE0(&m_levelName, 12.0, (float)(a1->m_height * 0.5) + 14.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v5->setPosition)(v5, &m_levelName);
if ( *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getContentSize)(v5) > 200.0 )
{
v6 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getContentSize)(v5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v5->setScale)(v5, 200.0 / *v6);
}
v7 = ((double (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getScale)(v5);
if ( *(float *)&v7 <= 0.80000001 )
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getScale)(v5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v5->setScale)(v5);
if ( a1->m_level->m_levelRev > 0 )
{
v8 = (cocos2d::CCString *)sub_1007AB580("Rev. %i", v35[0]);
CString = cocos2d::CCString::getCString(v8);
v10 = cocos2d::CCLabelBMFont::create_3(CString, "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v10);
sub_10028CBE0(&m_levelName, 0.0, 0.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v10->setAnchorPoint)(v10, &m_levelName);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v10->setScale)(v10, 0.40000001);
m_width = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getScale)(v5);
v11 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getContentSize)(v5);
sub_10028CFC0(&m_levelName, v11);
v12 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getPosition)(v5);
sub_10028CBE0(
v35,
(float)(*(float *)&m_levelName.__r_.__value_.__l.0 * m_width) + 10.0,
(float)(*((float *)m_levelName.__r_.__value_.__r.__words + 1) * -0.5) * m_width);
sub_10028CCE0(v36, v12);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BYTE *))v10->setPosition)(v10, v36);
}
v13 = ButtonSprite::create_1("View", 50, 0, 0.60000002, 0, "bigFont.fnt", "GJ_button_01.png", 30.0);
v14 = CCMenuItemSpriteExtra::create(v13, nullptr, a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)LevelCell::onClick);
v15 = a1;
v16 = 1.0;
if ( !a1->m_level->m_localOrSaved )
v16 = 1.5;
CCMenuItemSpriteExtra::setSizeMult(v14, v16);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_mainMenu->addChild)(a1->m_mainMenu, v14);
m_width = a1->m_width;
v17 = (float *)((__int64 (__fastcall *)(ButtonSprite *))v13->getContentSize)(v13);
sub_10028CBE0(&m_levelName, (float)(m_width - (float)(*v17 * 0.5)) + -9.0, 0.5 * a1->m_height);
sub_10028CC90();
*(cocos2d::CCPoint *)&v39 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&m_levelName,
(const cocos2d::CCPoint *)a1->m_mainMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, std::string *, double))v14->setPosition)(v14, &m_levelName, v39);
m_width = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getPosition)(v5) + 9.0;
v18 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_timeIcon_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v18);
sub_10028CBE0(&m_levelName, m_width, 20.0);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v18->setPosition)(v18, &m_levelName);
((void (__fastcall *)(cocos2d::CCSprite *, float))v18->setScale)(v18, 0.69999999);
GJGameLevel::lengthKeyToString(&m_levelName, (unsigned int)a1->m_level->m_levelLength);
if ( (*(_BYTE *)&m_levelName.__r_.__value_.__s.0 & 1) != 0 )
v19 = m_levelName.__r_.__value_.__l.__data_;
else
v19 = m_levelName.__r_.__value_.__s.__data_;
v20 = cocos2d::CCLabelBMFont::create_3(v19, "bigFont.fnt");
if ( (*(_BYTE *)&m_levelName.__r_.__value_.__s.0 & 1) != 0 )
operator delete(m_levelName.__r_.__value_.__l.__data_);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v20);
sub_10028CBE0(&m_levelName, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v20->setAnchorPoint)(v20, &m_levelName);
v21 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v18->getPosition)(v18);
sub_10028CBE0(v36, 9.0, 0.0);
sub_10028CCE0(&m_levelName, v21);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v20->setPosition)(v20, &m_levelName);
if ( (float)(100.0 / *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v20->getContentSize)(v20)) <= 0.40000001 )
((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v20->getContentSize)(v20);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v20->setScale)(v20);
v22 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_noteIcon_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v15->m_mainLayer->addChild)(v15->m_mainLayer, v22);
v23 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v20->getPosition)(v20);
m_width = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v20->getContentSize)(v20);
v24 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v20->getScale)(v20);
sub_10028CBE0(v36, (float)(v24 * m_width) + 17.0, 0.0);
sub_10028CCE0(&m_levelName, v23);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v22->setPosition)(v22, &m_levelName);
((void (__fastcall *)(cocos2d::CCSprite *, float))v22->setScale)(v22, 0.69999999);
GJGameLevel::getSongName(&m_levelName);
if ( (*(_BYTE *)&m_levelName.__r_.__value_.__s.0 & 1) != 0 )
v25 = m_levelName.__r_.__value_.__l.__data_;
else
v25 = m_levelName.__r_.__value_.__s.__data_;
v26 = cocos2d::CCLabelBMFont::create_3(v25, "bigFont.fnt");
if ( (*(_BYTE *)&m_levelName.__r_.__value_.__s.0 & 1) != 0 )
operator delete(m_levelName.__r_.__value_.__l.__data_);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v15->m_mainLayer->addChild)(v15->m_mainLayer, v26);
sub_10028CBE0(&m_levelName, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v26->setAnchorPoint)(v26, &m_levelName);
v27 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v22->getPosition)(v22);
sub_10028CBE0(v36, 9.0, 0.0);
sub_10028CCE0(&m_levelName, v27);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v26->setPosition)(v26, &m_levelName);
if ( (float)(100.0 / *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v26->getContentSize)(v26)) <= 0.40000001 )
((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v26->getContentSize)(v26);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v26->setScale)(v26);
v28 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_infoIcon_001.png");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v15->m_mainLayer->addChild)(v15->m_mainLayer, v28);
v29 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v26->getPosition)(v26);
m_width = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v26->getContentSize)(v26);
v30 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v26->getScale)(v26);
sub_10028CBE0(v36, (float)(v30 * m_width) + 17.0, 0.0);
sub_10028CCE0(&m_levelName, v29);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v28->setPosition)(v28, &m_levelName);
((void (__fastcall *)(cocos2d::CCSprite *, float))v28->setScale)(v28, 0.69999999);
v31 = v15->m_level;
if ( v31->m_isUploaded )
{
v32 = "Uploaded";
}
else
{
v32 = "Unverified";
if ( v31->m_isVerified.random - v31->m_isVerified.seed == 1 )
v32 = "Verified";
}
v33 = cocos2d::CCLabelBMFont::create_3(v32, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v15->m_mainLayer->addChild)(v15->m_mainLayer, v33);
sub_10028CBE0(&m_levelName, 0.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v33->setAnchorPoint)(v33, &m_levelName);
v34 = ((__int64 (__fastcall *)(cocos2d::CCSprite *))v28->getPosition)(v28);
sub_10028CBE0(v36, 9.0, 0.0);
sub_10028CCE0(&m_levelName, v34);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v33->setPosition)(v33, &m_levelName);
if ( (float)(60.0 / *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v33->getContentSize)(v33)) <= 0.40000001 )
((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v33->getContentSize)(v33);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))v33->setScale)(v33);
}