//
// LevelEditorLayer::updateLevelFont from 0x466d3c to 0x467012 (726 bytes)
//
// 2 xrefs:
// > SelectFontLayer::onChangeFont @ 0x5d46f6
// > SelectFontLayer2::onSelectFont @ 0x7a1abc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:48:57 +0000
//
cocos2d::CCArray *__fastcall LevelEditorLayer::updateLevelFont(cocos2d::CCArray *this, int a2)
{
LevelEditorLayer *v2; // r4
unsigned int v4; // r7
cocos2d::CCArray *v5; // r6
cocos2d::CCArray *v6; // r5
cocos2d::CCArray *AllObjects; // r9
cocos2d::CCTextureCache *v8; // r0
cocos2d::CCObject *v9; // r0
int v10; // r3
cocos2d::CCObject *v11; // r1
cocos2d::CCArray *v12; // r0
cocos2d::CCTextureCache *v13; // r0
unsigned int v14; // r9
int v15; // r10
int v16; // r0
int v17; // r7
unsigned int i; // r7
LabelGameObject *v19; // r0
int v20; // r0
int v21; // r0
int v22; // r0
int v23; // r0
int v24; // r0
int v25; // r0
int v26; // r0
int v27; // r0
int v28; // r0
int v29; // r0
int v30; // r0
int v31; // r0
int v32; // r0
GameManager *v33; // r0
int v34; // r3
GameManager *v35; // r0
const char *FontTexture; // r8
size_t v37; // r0
cocos2d::CCTextureCache *v38; // r0
cocos2d::CCTextureCache *v39; // r0
char *v40; // r1
int v41; // r10
unsigned int j; // r8
_BYTE *v43; // r4
unsigned int k; // r6
int v45; // r7
int v46[2]; // [sp+8h] [bp-2Ch] BYREF
char *v47; // [sp+10h] [bp-24h]
int v48[3]; // [sp+14h] [bp-20h] BYREF
int v49[3]; // [sp+20h] [bp-14h] BYREF
v2 = this;
if ( a2 != *(_DWORD *)(*((_DWORD *)this + 521) + 300) )
{
v4 = 0;
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(this);
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);
AllObjects = (cocos2d::CCArray *)LevelEditorLayer::getAllObjects(v2);
while ( 1 )
{
v8 = (cocos2d::CCTextureCache *)cocos2d::CCArray::count(AllObjects);
if ( v4 >= (unsigned int)v8 )
{
v13 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v8);
v14 = 0;
v15 = cocos2d::CCTextureCache::addImage(v13, "bigFont.png", 0);
while ( v14 < cocos2d::CCArray::count(v5) )
{
v16 = cocos2d::CCArray::objectAtIndex(v5, v14++);
v17 = v16;
(*(void (__fastcall **)(int, int))(*(_DWORD *)v16 + 656))(v16, 1);
(*(void (__fastcall **)(int))(*(_DWORD *)v17 + 288))(v17);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v17 + 560))(v17, 0);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v17 + 532))(v17, v15);
}
for ( i = 0; i < cocos2d::CCArray::count(v6); ++i )
{
v19 = (LabelGameObject *)cocos2d::CCArray::objectAtIndex(v6, i);
LabelGameObject::removeLabel(v19);
}
(*(void (__fastcall **)(_DWORD))(**((_DWORD **)v2 + 405) + 260))(*((_DWORD *)v2 + 405));
v20 = *((_DWORD *)v2 + 406);
*((_DWORD *)v2 + 405) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v20 + 260))(v20);
v21 = *((_DWORD *)v2 + 419);
*((_DWORD *)v2 + 406) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v21 + 260))(v21);
v22 = *((_DWORD *)v2 + 420);
*((_DWORD *)v2 + 419) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v22 + 260))(v22);
v23 = *((_DWORD *)v2 + 433);
*((_DWORD *)v2 + 420) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v23 + 260))(v23);
v24 = *((_DWORD *)v2 + 434);
*((_DWORD *)v2 + 433) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v24 + 260))(v24);
v25 = *((_DWORD *)v2 + 453);
*((_DWORD *)v2 + 434) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v25 + 260))(v25);
v26 = *((_DWORD *)v2 + 454);
*((_DWORD *)v2 + 453) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v26 + 260))(v26);
v27 = *((_DWORD *)v2 + 467);
*((_DWORD *)v2 + 454) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v27 + 260))(v27);
v28 = *((_DWORD *)v2 + 468);
*((_DWORD *)v2 + 467) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v28 + 260))(v28);
v29 = *((_DWORD *)v2 + 481);
*((_DWORD *)v2 + 468) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v29 + 260))(v29);
v30 = *((_DWORD *)v2 + 482);
*((_DWORD *)v2 + 481) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v30 + 260))(v30);
v31 = *((_DWORD *)v2 + 495);
*((_DWORD *)v2 + 482) = 0;
(*(void (__fastcall **)(int))(*(_DWORD *)v31 + 260))(v31);
v32 = *((_DWORD *)v2 + 496);
*((_DWORD *)v2 + 495) = 0;
v33 = (GameManager *)(*(int (__fastcall **)(int))(*(_DWORD *)v32 + 260))(v32);
v34 = *((_DWORD *)v2 + 521);
*((_DWORD *)v2 + 496) = 0;
*(_DWORD *)(v34 + 300) = a2;
v35 = (GameManager *)GameManager::sharedState(v33);
v46[0] = 0;
v46[1] = 0;
v47 = nullptr;
FontTexture = GameManager::getFontTexture(v35, a2);
v37 = strlen(FontTexture);
v38 = (cocos2d::CCTextureCache *)std::string::__init(v46, FontTexture, v37);
v39 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v38);
if ( (v46[0] & 1) != 0 )
v40 = v47;
else
v40 = (char *)v46 + 1;
v41 = cocos2d::CCTextureCache::addImage(v39, v40, 0);
GJBaseGameLayer::createTextLayers(v2);
for ( j = 0; j < cocos2d::CCArray::count(v5); ++j )
{
v43 = (_BYTE *)cocos2d::CCArray::objectAtIndex(v5, j);
(*(void (__fastcall **)(_BYTE *, int))(*(_DWORD *)v43 + 532))(v43, v41);
std::string::basic_string(v48, (int)(v43 + 1168));
TextGameObject::updateTextObject(v43, (unsigned __int8 *)v48, 0);
std::string::~string((int)v48);
v43[1005] = 1;
(*(void (__fastcall **)(_BYTE *, __int16 *))(*(_DWORD *)v43 + 748))(v43, &word_BEBC88);
}
for ( k = 0; k < cocos2d::CCArray::count(v6); ++k )
{
v45 = cocos2d::CCArray::objectAtIndex(v6, k);
std::string::basic_string(v49, v45 + 1656);
LabelGameObject::createLabel(v45, v49);
std::string::~string((int)v49);
}
return (cocos2d::CCArray *)std::string::~string((int)v46);
}
v9 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(AllObjects, v4);
v10 = *((_DWORD *)v9 + 223);
v11 = v9;
if ( v10 == 914 )
{
v12 = v5;
}
else
{
if ( v10 != 1615 )
goto LABEL_9;
v12 = v6;
}
cocos2d::CCArray::addObject(v12, v11);
LABEL_9:
++v4;
}
}
return this;
}