//
// LevelInfoLayer::setupLevelInfo from 0x3b3368 to 0x3b3b8c (2084 bytes)
//
// 1 xrefs:
// > LevelInfoLayer::init @ 0x3b425e
//
// 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 LevelInfoLayer::setupLevelInfo(LevelInfoLayer *a1)
{
cocos2d::CCArray *v2; // r0
float v3; // s20
cocos2d::CCDirector *v4; // r0
cocos2d::CCSprite *v5; // r9
cocos2d::CCSprite *v6; // r8
cocos2d::CCLabelBMFont *v7; // r0
cocos2d::CCLabelBMFont_vtbl *v8; // r3
cocos2d::CCLabelBMFont *m_lengthLabel; // r6
cocos2d::CCLabelBMFont *v10; // r0
cocos2d::CCLabelBMFont_vtbl *v11; // r3
cocos2d::CCLabelBMFont *m_exactLengthLabel; // r6
cocos2d::CCLabelBMFont *v13; // r0
cocos2d::CCLabelBMFont_vtbl *v14; // r3
cocos2d::CCLabelBMFont *m_downloadsLabel; // r6
cocos2d::CCLabelBMFont *v16; // r0
cocos2d::CCLabelBMFont_vtbl *v17; // r3
cocos2d::CCLabelBMFont *m_likesLabel; // r6
cocos2d::CCLabelBMFont *v19; // r0
cocos2d::CCLabelBMFont_vtbl *v20; // r3
cocos2d::CCLabelBMFont *m_orbsLabel; // r6
void (__fastcall *v22)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r7
GJGameLevel *m_level; // r0
_BOOL4 v24; // r6
_BOOL4 isPlatformer; // r0
void (__fastcall *v26)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
float v27; // s18
float v28; // s16
_BOOL4 v29; // r7
float v30; // s19
float v31; // s17
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCLabelBMFont *v33; // r10
void (__fastcall *v34)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
int v35; // r0
cocos2d::CCSprite *m_likesIcon; // r8
void (__fastcall *v37)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCSprite *v38; // r8
void (__fastcall *v39)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCLabelBMFont *v40; // r8
void (__fastcall *v41)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v42; // r0
void (__fastcall *v43)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
void (__fastcall *v44)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCLabelBMFont *v45; // r10
void (__fastcall *v46)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
int v47; // r0
cocos2d::CCLabelBMFont *v48; // r9
const cocos2d::CCPoint *v49; // r11
cocos2d::CCSprite *m_orbsIcon; // r9
void (__fastcall *v51)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCSprite *v52; // r8
void (__fastcall *v53)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCLabelBMFont *v54; // r8
void (__fastcall *v55)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
const cocos2d::CCPoint *v56; // r0
int v57; // r2
bool v58; // r3
GJDifficultySprite *v59; // r0
LevelInfoLayer_vtbl *v60; // r3
const char *v61; // r0
cocos2d::CCSprite *v62; // r0
LevelInfoLayer_vtbl *v63; // r3
cocos2d::CCSprite *m_starsIcon; // r8
void (__fastcall *v65)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCLabelBMFont *v66; // r0
LevelInfoLayer_vtbl *v67; // r3
cocos2d::CCLabelBMFont *m_starsLabel; // r8
void (__fastcall *v69)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r10
cocos2d::CCLabelBMFont *v70; // r8
void (__fastcall *v71)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v72; // r11
GJGameLevel *v73; // r3
cocos2d::CCSprite *v74; // r8
GameStatsManager *v75; // r0
GameStatsManager *v76; // r0
cocos2d::CCString *v77; // r0
char *CString; // r0
cocos2d::CCLabelBMFont *v79; // r6
void (__fastcall *v80)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r11
float width; // s16
float v82; // s15
void (__fastcall *v83)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r11
float v84; // r2
void (__fastcall *v85)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
int v86; // r8
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
unsigned int i; // r5
int v89; // r0
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // [sp+4h] [bp-30h]
void (__fastcall *v91)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // [sp+4h] [bp-30h]
void (__fastcall *v92)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // [sp+4h] [bp-30h]
void (__fastcall *v93)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // [sp+4h] [bp-30h]
void (__fastcall *v94)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+4h] [bp-30h]
int BaseDiamonds; // [sp+4h] [bp-30h]
char *AwardedDiamondsForLevel; // [sp+8h] [bp-2Ch]
cocos2d::CCLabelBMFont *v97; // [sp+10h] [bp-24h] BYREF
cocos2d::CCSize v98; // [sp+14h] [bp-20h] BYREF
cocos2d::CCPoint v99; // [sp+1Ch] [bp-18h] BYREF
cocos2d::CCPoint v100; // [sp+24h] [bp-10h] BYREF
v2 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)a1);
v3 = 6.0;
a1->m_icons = v2;
cocos2d::CCObject::retain(v2);
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v98, v4);
v5 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_timeIcon_001.png");
v6 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_downloadsIcon_001.png");
a1->m_orbsIcon = cocos2d::CCSprite::createWithSpriteFrameName("currencyOrbIcon_001.png");
a1->m_likesIcon = cocos2d::CCSprite::createWithSpriteFrameName("GJ_likesIcon_001.png");
v7 = cocos2d::CCLabelBMFont::create();
v8 = v7->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_lengthLabel = v7;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v8->setScale)(v7, 1056964608);
m_lengthLabel = a1->m_lengthLabel;
setAnchorPoint = m_lengthLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 0.0, 0.5);
setAnchorPoint(m_lengthLabel, &v100);
v10 = cocos2d::CCLabelBMFont::create();
v11 = v10->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_exactLengthLabel = v10;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v11->setScale)(v10, 1056964608);
m_exactLengthLabel = a1->m_exactLengthLabel;
v91 = m_exactLengthLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 0.0, 0.5);
v91(m_exactLengthLabel, &v100);
v13 = cocos2d::CCLabelBMFont::create();
v14 = v13->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_downloadsLabel = v13;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v14->setScale)(v13, 1056964608);
m_downloadsLabel = a1->m_downloadsLabel;
v92 = m_downloadsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 0.0, 0.5);
v92(m_downloadsLabel, &v100);
v16 = cocos2d::CCLabelBMFont::create();
v17 = v16->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_likesLabel = v16;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v17->setScale)(v16, 1056964608);
m_likesLabel = a1->m_likesLabel;
v93 = m_likesLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 0.0, 0.5);
v93(m_likesLabel, &v100);
v19 = cocos2d::CCLabelBMFont::create();
v20 = v19->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_orbsLabel = v19;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v20->setScale)(v19, 1056964608);
m_orbsLabel = a1->m_orbsLabel;
v22 = m_orbsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 0.0, 0.5);
v22(m_orbsLabel, &v100);
cocos2d::CCArray::addObject(a1->m_icons, v5);
cocos2d::CCArray::addObject(a1->m_icons, v6);
cocos2d::CCArray::addObject(a1->m_icons, a1->m_orbsIcon);
cocos2d::CCArray::addObject(a1->m_icons, a1->m_likesIcon);
cocos2d::CCArray::addObject(a1->m_icons, a1->m_downloadsLabel);
cocos2d::CCArray::addObject(a1->m_icons, a1->m_lengthLabel);
cocos2d::CCArray::addObject(a1->m_icons, a1->m_exactLengthLabel);
cocos2d::CCArray::addObject(a1->m_icons, a1->m_likesLabel);
cocos2d::CCArray::addObject(a1->m_icons, a1->m_orbsLabel);
a1->addChild(a1, v5);
a1->addChild(a1, v6);
a1->addChild(a1, a1->m_orbsIcon);
a1->addChild(a1, a1->m_likesIcon);
a1->addChild(a1, a1->m_downloadsLabel);
a1->addChild(a1, a1->m_lengthLabel);
a1->addChild(a1, a1->m_exactLengthLabel);
a1->addChild(a1, a1->m_likesLabel);
a1->addChild(a1, a1->m_orbsLabel);
m_level = a1->m_level;
v24 = m_level->m_stars.random - m_level->m_stars.seed > 0;
isPlatformer = GJGameLevel::isPlatformer(m_level);
v26 = v6->setAnchorPoint;
v27 = (float)(v98.width * 0.5) + 80.0;
v28 = (float)(v98.height * 0.5) + 51.0;
v29 = isPlatformer;
v30 = v27 + 33.0;
v31 = 28.0;
if ( v24 )
v28 = v28 + 10.0;
else
v31 = 30.0;
a1->m_iconOffset = 10.0;
cocos2d::CCPoint::CCPoint(&v100, 0.0, 0.5);
v26(v6, &v100);
setPosition = v6->setPosition;
cocos2d::CCPoint::CCPoint(&v100, v27, v28 + v31);
setPosition(v6, &v100);
v33 = a1->m_downloadsLabel;
v34 = v33->setPosition;
v35 = (int)v6->getPosition(v6);
cocos2d::CCPoint::CCPoint(&v100, v30, *(float *)(v35 + 4));
v34(v33, &v100);
m_likesIcon = a1->m_likesIcon;
v37 = m_likesIcon->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 0.0, 0.5);
v37(m_likesIcon, &v100);
v38 = a1->m_likesIcon;
v39 = v38->setPosition;
cocos2d::CCPoint::CCPoint(&v100, v27, v28 + 1.0);
v39(v38, &v100);
v40 = a1->m_likesLabel;
v41 = v40->setPosition;
v42 = a1->m_likesIcon->getPosition(a1->m_likesIcon);
cocos2d::CCPoint::CCPoint(&v100, v30, v42->y);
v41(v40, &v100);
v43 = v5->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 0.0, 0.5);
v43(v5, &v100);
v44 = v5->setPosition;
cocos2d::CCPoint::CCPoint(&v100, v27, v28 - v31);
v44(v5, &v100);
v45 = a1->m_lengthLabel;
if ( !v29 )
v3 = 0.0;
v46 = v45->setPosition;
v47 = (int)v5->getPosition(v5);
cocos2d::CCPoint::CCPoint(&v100, v30, v3 + *(float *)(v47 + 4));
v46(v45, &v100);
v48 = a1->m_exactLengthLabel;
v94 = v48->setPosition;
v49 = a1->m_lengthLabel->getPosition(a1->m_lengthLabel);
cocos2d::CCPoint::CCPoint(&v99, 0.0, -14.0);
cocos2d::CCPoint::operator+(&v100, v49, &v99);
v94(v48, &v100);
m_orbsIcon = a1->m_orbsIcon;
v51 = m_orbsIcon->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 0.0, 0.5);
v51(m_orbsIcon, &v100);
v52 = a1->m_orbsIcon;
v53 = v52->setPosition;
cocos2d::CCPoint::CCPoint(&v100, v27 + 1.0, v28 - (float)(v31 + v31));
v53(v52, &v100);
v54 = a1->m_orbsLabel;
v55 = v54->setPosition;
v56 = a1->m_orbsIcon->getPosition(a1->m_orbsIcon);
cocos2d::CCPoint::CCPoint(&v100, v30, v56->y);
v55(v54, &v100);
a1->m_orbsIcon->setVisible(a1->m_orbsIcon, v24);
a1->m_orbsLabel->setVisible(a1->m_orbsLabel, v24);
cocos2d::CCPoint::CCPoint(&v100, (float)(v98.width * 0.5) - 100.0, v28 + 5.0);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_basePosition, COERCE_FLOAT(&v100), v57, v58);
v59 = GJDifficultySprite::create(1, Long);
v60 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_difficultySprite = v59;
v60->addChild_0(a1, v59, 3);
a1->m_difficultySprite->setPosition(a1->m_difficultySprite, &a1->m_basePosition);
if ( v29 )
v61 = "moon_small01_001.png";
else
v61 = "star_small01_001.png";
v62 = cocos2d::CCSprite::createWithSpriteFrameName(v61);
v63 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_starsIcon = v62;
v63->addChild(a1, v62);
m_starsIcon = a1->m_starsIcon;
v65 = m_starsIcon->setPosition;
cocos2d::CCPoint::CCPoint(&v99, 8.0, -30.0);
cocos2d::CCPoint::operator+(&v100, &a1->m_basePosition, &v99);
v65(m_starsIcon, &v100);
v66 = cocos2d::CCLabelBMFont::create();
v67 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_starsLabel = v66;
v67->addChild(a1, v66);
m_starsLabel = a1->m_starsLabel;
v69 = m_starsLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 1.0, 0.5);
v69(m_starsLabel, &v100);
v70 = a1->m_starsLabel;
v71 = v70->setPosition;
v72 = a1->m_starsIcon->getPosition(a1->m_starsIcon);
cocos2d::CCPoint::CCPoint(&v99, -8.0, 0.0);
cocos2d::CCPoint::operator+(&v100, v72, &v99);
v71(v70, &v100);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))a1->m_starsLabel->setScale)(a1->m_starsLabel, 1053609165);
a1->m_baseStarsY = a1->m_starsLabel->getPosition(a1->m_starsLabel)->y;
if ( v24 )
{
v73 = a1->m_level;
if ( v73->m_dailyID.random - v73->m_dailyID.seed > 0 || v73->m_gauntletLevel )
{
v74 = cocos2d::CCSprite::createWithSpriteFrameName("diamond_small01_001.png");
a1->addChild(a1, v74);
v75 = GameStatsManager::sharedState();
BaseDiamonds = GameStatsManager::getBaseDiamonds(v75, a1->m_level->m_stars.random - a1->m_level->m_stars.seed);
v76 = GameStatsManager::sharedState();
AwardedDiamondsForLevel = (char *)GameStatsManager::getAwardedDiamondsForLevel(v76, a1->m_level);
v77 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i/%i",
AwardedDiamondsForLevel,
BaseDiamonds);
CString = (char *)cocos2d::CCString::getCString(v77);
sub_776584((int)&v97, CString);
v79 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v79);
v80 = v79->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v100, 1.0, 0.5);
v80(v79, &v100);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v79->setScale)(v79, 1051931443);
width = v79->getContentSize(v79)->width;
v82 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))v79->getScale)(v79));
v83 = v74->setPosition;
if ( a1->m_level->m_stars.random - a1->m_level->m_stars.seed == 10 )
v84 = -48.5;
else
v84 = -44.5;
cocos2d::CCPoint::CCPoint(&v99, (float)((float)(width * v82) * 0.5) + 2.0, v84);
cocos2d::CCPoint::operator+(&v100, &a1->m_basePosition, &v99);
v83(v74, &v100);
v85 = v79->setPosition;
v86 = (int)v74->getPosition(v74);
cocos2d::CCPoint::CCPoint(&v99, -8.0, 0.0);
cocos2d::CCPoint::operator+(&v100, v86, &v99);
v85(v79, &v100);
if ( AwardedDiamondsForLevel == (char *)BaseDiamonds )
{
setColor = v79->setColor;
LOWORD(v100.x) = -156;
BYTE2(v100.x) = -1;
setColor(v79, (const cocos2d::ccColor3B *)&v100);
}
sub_774008(&v97);
}
}
if ( a1->m_challenge )
{
for ( i = 0; i < cocos2d::CCArray::count(a1->m_icons); ++i )
{
v89 = cocos2d::CCArray::objectAtIndex(a1->m_icons, i);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v89 + 164))(v89, 0);
}
a1->m_orbsIcon->setVisible(a1->m_orbsIcon, 0);
a1->m_orbsLabel->setVisible(a1->m_orbsLabel, 0);
}
LevelInfoLayer::updateLabelValues(a1);
}