//
// LevelInfoLayer::updateLabelValues from 0x1002c2d70 to 0x1002c37fa (2698 bytes)
//
// 6 xrefs:
// > LevelInfoLayer::setupLevelInfo @ 0x1002c0cc8
// > LevelInfoLayer::levelDownloadFinished @ 0x1002c38e4
// > LevelInfoLayer::likedItem @ 0x1002c4b8d
// > LevelInfoLayer::incrementLikes @ 0x1002c4bb2
// > LevelInfoLayer::incrementDislikes @ 0x1002c4bd2
// > sub_1002C4BE0 @ 0x1002c4c40
//
// 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 LevelInfoLayer::updateLabelValues(LevelInfoLayer *a1)
{
__m128 v1; // xmm0
__int64 v3; // rsi
const std::string::value_type *v4; // rsi
cocos2d::CCLabelBMFont *m_exactLengthLabel; // rdi
std::string::pointer data; // rsi
cocos2d::CCLabelBMFont *m_lengthLabel; // r14
std::string::pointer v8; // rsi
cocos2d::CCLabelBMFont *m_downloadsLabel; // r14
std::string::pointer v10; // rsi
cocos2d::CCLabelBMFont *m_orbsLabel; // r14
GameStatsManager *v12; // rax
GameStatsManager *v13; // rax
cocos2d::CCString *v14; // rax
const char *CString; // rax
cocos2d::CCLabelBMFont *m_likesLabel; // r15
int v17; // r14d
std::string::pointer v18; // rsi
cocos2d::CCSprite *m_likesIcon; // r15
cocos2d::CCSpriteFrameCache *v20; // rax
const char *v21; // rsi
cocos2d::CCSpriteFrame *v22; // rax
GameManager *v23; // rax
GameManager *v24; // rax
GameManager *v25; // rax
GameManager *v26; // rax
GameManager *v27; // rax
GameManager *v28; // rax
GameManager *v29; // rax
int AverageDifficulty; // r14d
double v31; // xmm0_8
GJGameLevel *m_level; // rax
int v33; // esi
cocos2d::CCLabelBMFont *m_starsLabel; // r14
cocos2d::CCString *v35; // rax
const char *v36; // rax
GameStatsManager *v37; // rax
cocos2d::CCLabelBMFont *v38; // rdi
GJGameLevel *v39; // rax
cocos2d::CCLabelBMFont *v40; // rdi
LevelInfoLayer *v41; // r15
int random; // ebx
int seed; // r12d
GJGameLevel *v44; // rax
cocos2d::CCLabelBMFont *v45; // r14
int v46; // xmm0_4
float *v47; // rax
cocos2d::CCSprite *m_starsIcon; // r14
float *v49; // rax
char v50; // r14
bool v51; // al
bool v52; // al
_QWORD *v53; // rbx
char v54; // al
__m128 m_iconOffset_low; // xmm0
unsigned int v56; // r14d
__int64 v57; // r13
unsigned __int64 *v58; // r15
unsigned int v59; // r14d
__int64 v60; // rax
GJGameLevel *v61; // rdi
int m_coins; // eax
__int64 v63; // xmm0_8
char *v64; // r14
int v65; // r15d
const char *CoinKey; // r13
size_t v67; // rax
std::string::size_type v68; // r12
size_t v69; // rbx
GameStatsManager *v70; // rax
const char *v71; // rsi
bool hasPendingUserCoin; // r13
GameStatsManager *v73; // rax
const char *v74; // rsi
cocos2d::CCSprite *v75; // r12
int v76; // eax
char v77; // [rsp+0h] [rbp-A0h]
char v78; // [rsp+0h] [rbp-A0h]
unsigned __int64 v79; // [rsp+8h] [rbp-98h] BYREF
unsigned __int64 *p_m_basePosition; // [rsp+10h] [rbp-90h]
LevelInfoLayer *v81; // [rsp+18h] [rbp-88h]
int v82; // [rsp+24h] [rbp-7Ch]
void *v83[2]; // [rsp+28h] [rbp-78h] BYREF
void *__p; // [rsp+38h] [rbp-68h]
__m128 v85; // [rsp+40h] [rbp-60h]
unsigned __int64 v86; // [rsp+54h] [rbp-4Ch] BYREF
float v87; // [rsp+5Ch] [rbp-44h]
std::string __dst; // [rsp+60h] [rbp-40h] BYREF
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_exactLengthLabel->setVisible)(a1->m_exactLengthLabel, 0);
if ( GJGameLevel::isPlatformer(a1->m_level) )
{
v1.f32[0] = (float)a1->m_level->m_timestamp / 240.0;
v3 = (unsigned int)(int)_mm_round_ss(v1, v1, 9).f32[0];
strcpy((char *)&__dst, "\n<1min");
if ( (int)v3 < 61 )
{
if ( !(_DWORD)v3 )
std::string::assign(&__dst, "Dur.");
}
else
{
GameToolbox::getTimeString(v83, v3, 1);
if ( ((__int64)v83[0] & 1) != 0 )
v4 = (const std::string::value_type *)__p;
else
v4 = (char *)v83 + 1;
std::string::assign(&__dst, v4);
if ( ((__int64)v83[0] & 1) != 0 )
operator delete(__p);
}
m_exactLengthLabel = a1->m_exactLengthLabel;
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
data = __dst.__r_.__value_.__l.__data_;
else
data = __dst.__r_.__value_.__s.__data_;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string::pointer))m_exactLengthLabel->setString)(
m_exactLengthLabel,
data);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, __int64))a1->m_exactLengthLabel->setVisible)(
a1->m_exactLengthLabel,
1);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
}
m_lengthLabel = a1->m_lengthLabel;
GJGameLevel::lengthKeyToString(&__dst, (unsigned int)a1->m_level->m_levelLength);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v8 = __dst.__r_.__value_.__l.__data_;
else
v8 = __dst.__r_.__value_.__s.__data_;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string::pointer))m_lengthLabel->setString)(m_lengthLabel, v8);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
m_downloadsLabel = a1->m_downloadsLabel;
GameToolbox::pointsToString(&__dst);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v10 = __dst.__r_.__value_.__l.__data_;
else
v10 = __dst.__r_.__value_.__s.__data_;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string::pointer))m_downloadsLabel->setString)(
m_downloadsLabel,
v10);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
m_orbsLabel = a1->m_orbsLabel;
v12 = GameStatsManager::sharedState();
GameStatsManager::getAwardedCurrencyForLevel(v12, a1->m_level);
v13 = GameStatsManager::sharedState();
GameStatsManager::getBaseCurrencyForLevel(v13, a1->m_level);
v14 = (cocos2d::CCString *)sub_1007AB580("%i/%i", v77);
CString = cocos2d::CCString::getCString(v14);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_orbsLabel->setString)(m_orbsLabel, CString);
m_likesLabel = a1->m_likesLabel;
v17 = a1->m_level->m_likes - a1->m_level->m_dislikes;
GameToolbox::pointsToString(&__dst);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v18 = __dst.__r_.__value_.__l.__data_;
else
v18 = __dst.__r_.__value_.__s.__data_;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string::pointer))m_likesLabel->setString)(m_likesLabel, v18);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
m_likesIcon = a1->m_likesIcon;
v20 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v21 = "GJ_dislikesIcon_001.png";
if ( v17 >= 0 )
v21 = "GJ_likesIcon_001.png";
v22 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v20, v21);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_likesIcon->setDisplayFrame)(m_likesIcon, v22);
v23 = GameManager::sharedState();
if ( v23->m_playerUserID.random - v23->m_playerUserID.seed == a1->m_level->m_userID.random
- a1->m_level->m_userID.seed )
{
if ( v17 >= 50 )
{
v24 = GameManager::sharedState();
GameManager::reportAchievementWithID(v24, "geometry.ach.creator03", 100, 0);
if ( (unsigned int)v17 >= 0x64 )
{
v25 = GameManager::sharedState();
GameManager::reportAchievementWithID(v25, "geometry.ach.creator01", 100, 0);
if ( (unsigned int)v17 >= 0xFA )
{
v26 = GameManager::sharedState();
GameManager::reportAchievementWithID(v26, "geometry.ach.creator04", 100, 0);
if ( (unsigned int)v17 >= 0x1F4 )
{
v27 = GameManager::sharedState();
GameManager::reportAchievementWithID(v27, "geometry.ach.creator05", 100, 0);
if ( (unsigned int)v17 >= 0x3E8 )
{
v28 = GameManager::sharedState();
GameManager::reportAchievementWithID(v28, "geometry.ach.creator06", 100, 0);
}
}
}
}
}
if ( a1->m_level->m_stars.random > a1->m_level->m_stars.seed )
{
v29 = GameManager::sharedState();
GameManager::reportAchievementWithID(v29, "geometry.ach.creator02", 100, 0);
}
}
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_lengthLabel, 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_exactLengthLabel, 42.0, 0.34999999, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_downloadsLabel, 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_likesLabel, 60.0, 0.5, 0.0);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_orbsLabel, 60.0, 0.5, 0.0);
AverageDifficulty = GJGameLevel::getAverageDifficulty(a1->m_level);
p_m_basePosition = (unsigned __int64 *)&a1->m_basePosition;
v31 = sub_10028CC60(v83, (double *)&a1->m_basePosition);
m_level = a1->m_level;
if ( m_level->m_demon.random - m_level->m_demon.seed == 1 )
{
AverageDifficulty = GJGameLevel::demonIconForDifficulty((DemonDifficultyType)m_level->m_demonDifficulty);
*(_QWORD *)&v31 = HIDWORD(v83[0]);
*(float *)&v31 = *((float *)v83 + 1) + 5.0;
*((float *)v83 + 1) = *((float *)v83 + 1) + 5.0;
m_level = a1->m_level;
}
v33 = -1;
if ( !m_level->m_autoLevel )
v33 = AverageDifficulty;
GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v33, Long);
((void (__fastcall *)(GJDifficultySprite *, void **, double))a1->m_difficultySprite->setPosition)(
a1->m_difficultySprite,
v83,
v31);
GJDifficultySprite::updateFeatureStateFromLevel(a1->m_difficultySprite, a1->m_level);
m_starsLabel = a1->m_starsLabel;
v35 = (cocos2d::CCString *)sub_1007AB580("%i", v78);
v36 = cocos2d::CCString::getCString(v35);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))m_starsLabel->setString)(m_starsLabel, v36);
v37 = GameStatsManager::sharedState();
if ( GameStatsManager::hasCompletedStarLevel(v37, a1->m_level) )
{
v38 = a1->m_starsLabel;
__dst.__r_.__value_.__s.__data_[1] = 50;
*(_WORD *)&__dst.__r_.__value_.__l.0 = -1;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v38->setColor)(v38, &__dst);
}
v39 = a1->m_level;
v40 = a1->m_starsLabel;
v41 = a1;
random = v39->m_stars.random;
seed = v39->m_stars.seed;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, bool))v40->setVisible)(v40, random > seed);
((void (__fastcall *)(cocos2d::CCSprite *, bool))v41->m_starsIcon->setVisible)(v41->m_starsIcon, random > seed);
v44 = v41->m_level;
v81 = v41;
v45 = v41->m_starsLabel;
if ( v44->m_demon.random - v44->m_demon.seed == 1 )
v46 = -1065353216;
else
v46 = 0;
v87 = *(float *)&v46;
v47 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v45->getPosition)(v45);
sub_10028CBE0((float *)&__dst, *v47, v81->m_baseStarsY + v87);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v45->setPosition)(v45, &__dst);
m_starsIcon = v81->m_starsIcon;
v49 = (float *)((__int64 (__fastcall *)(cocos2d::CCSprite *))m_starsIcon->getPosition)(m_starsIcon);
sub_10028CBE0((float *)&__dst, *v49, v81->m_baseStarsY + v87);
((void (__fastcall *)(cocos2d::CCSprite *, std::string *))m_starsIcon->setPosition)(m_starsIcon, &__dst);
v50 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v81->m_orbsLabel->isVisible)(v81->m_orbsLabel);
v51 = random > seed && !v81->m_challenge;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, bool))v81->m_orbsLabel->setVisible)(v81->m_orbsLabel, v51);
v52 = random > seed && !v81->m_challenge;
v53 = &v81->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
((void (__fastcall *)(cocos2d::CCSprite *, bool))v81->m_orbsIcon->setVisible)(v81->m_orbsIcon, v52);
if ( v50 != ((unsigned __int8 (__fastcall *)(cocos2d::CCLabelBMFont *))v81->m_orbsLabel->isVisible)(v81->m_orbsLabel) )
{
v54 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v81->m_orbsLabel->isVisible)(v81->m_orbsLabel);
m_iconOffset_low = (__m128)LODWORD(v81->m_iconOffset);
if ( !v54 )
m_iconOffset_low = _mm_xor_ps(m_iconOffset_low, (__m128)xmmword_1008150B0);
v85 = m_iconOffset_low;
if ( (unsigned int)sub_100720070(v81->m_icons) )
{
v56 = 0;
do
{
v57 = sub_1007200C0(v81->m_icons, v56);
v58 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v57 + 192LL))(v57);
sub_10028CBE0((float *)&v86, 0.0, v85.f32[0]);
sub_10028CCE0((double *)&__dst, v58, &v86);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v57 + 184LL))(v57, &__dst);
++v56;
}
while ( v56 < (unsigned int)sub_100720070(v81->m_icons) );
}
}
if ( (unsigned int)sub_100720070(v81->m_coins) )
{
v59 = 0;
do
{
v60 = sub_1007200C0(v81->m_coins, v59);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v60 + 504LL))(v60);
++v59;
}
while ( v59 < (unsigned int)sub_100720070(v81->m_coins) );
}
sub_100720270(v81->m_coins);
v61 = v81->m_level;
m_coins = v61->m_coins;
if ( m_coins > 0 )
{
if ( v61->m_stars.random <= v61->m_stars.seed )
{
v63 = 3254517760LL;
}
else if ( v61->m_dailyID.random > v61->m_dailyID.seed || v61->m_gauntletLevel )
{
v63 = 3262119936LL;
}
else
{
v63 = 3258318848LL;
}
v82 = v61->m_coinsVerified.random - v61->m_coinsVerified.seed;
v64 = __dst.__r_.__value_.__s.__data_;
v65 = 0;
v87 = v87 + *(float *)&v63;
while ( 1 )
{
v85.i32[0] = 1092616192;
if ( v65 == 2 )
goto LABEL_79;
if ( v65 == 1 )
{
v85.i32[0] = 1084227584;
if ( m_coins != 2 )
goto LABEL_78;
}
else
{
v85.i32[0] = -1063256064;
if ( m_coins != 2 )
{
v85.i32[0] = -1054867456;
if ( (unsigned int)m_coins <= 2 )
LABEL_78:
v85.i32[0] = 0;
}
}
LABEL_79:
CoinKey = GJGameLevel::getCoinKey(v61, ++v65);
v67 = strlen(CoinKey);
if ( v67 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(*(double *)&v63);
v68 = v67;
if ( v67 >= 0x17 )
{
v69 = (v67 | 7) + 1;
if ( (v67 | 7) == 0x17 )
v69 = 26;
v64 = (char *)operator new(v69);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)v64;
__dst.__r_.__value_.__r.__words[0] = v69 + 1;
v53 = &v81->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
__dst.__r_.__value_.__l.__size_ = v68;
}
else
{
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v67);
if ( !v67 )
goto LABEL_87;
}
memmove(v64, CoinKey, v68);
LABEL_87:
v64[v68] = 0;
v70 = GameStatsManager::sharedState();
v64 = __dst.__r_.__value_.__s.__data_;
v71 = __dst.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v71 = __dst.__r_.__value_.__l.__data_;
hasPendingUserCoin = 1;
if ( !GameStatsManager::hasUserCoin(v70, v71) )
{
v73 = GameStatsManager::sharedState();
v74 = __dst.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
v74 = __dst.__r_.__value_.__l.__data_;
hasPendingUserCoin = GameStatsManager::hasPendingUserCoin(v73, v74);
}
v75 = cocos2d::CCSprite::createWithSpriteFrameName("usercoin_small01_001.png");
(*(void (__fastcall **)(_QWORD *, cocos2d::CCSprite *))(*v53 + 440LL))(v53, v75);
v63 = v85.u32[0];
sub_10028CBE0((float *)&v79, v85.f32[0], v87);
sub_10028CCE0((double *)&v86, p_m_basePosition, &v79);
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v75->setPosition)(v75, &v86);
sub_10071FCD0(v53[63], v75);
if ( v82 == 1 )
{
if ( !hasPendingUserCoin )
{
BYTE2(v86) = -91;
LOWORD(v86) = -23131;
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v75->setColor)(v75, &v86);
}
}
else
{
v76 = 3174821;
if ( hasPendingUserCoin )
v76 = 4960255;
LOWORD(v86) = v76;
BYTE2(v86) = BYTE2(v76);
((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v75->setColor)(v75, &v86);
}
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
if ( (unsigned int)(v65 - 1) <= 1 )
{
v61 = (GJGameLevel *)v53[62];
m_coins = v61->m_coins;
if ( v65 < m_coins )
continue;
}
return;
}
}
}