//
// SelectFontLayer::updateFontLabel from 0x1002d22b0 to 0x1002d23b0 (256 bytes)
//
// 2 xrefs:
// > SelectFontLayer::init @ 0x1002d2188
// > SelectFontLayer::onChangeFont @ 0x1002d22ac
//
// 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 SelectFontLayer::updateFontLabel(SelectFontLayer *a1)
{
int m_fontIndex; // w20
cocos2d::CCLabelBMFont *m_fontLabel; // x0
cocos2d::CCString *v4; // x0
const char *CString; // x20
GameManager *v6; // x0
GameManager *v7; // x21
GameManager *v8; // x0
const char *FontFile; // x0
cocos2d::CCLabelBMFont *v10; // x0
cocos2d::CCDirector *v11; // x0
cocos2d::CCLabelBMFont *v12; // x19
__n128 v13; // q0
__n128 v14; // q1
_DWORD v15[4]; // [xsp+10h] [xbp-30h] BYREF
m_fontIndex = a1->m_editorLayer->m_levelSettings->m_fontIndex;
if ( a1->m_font != m_fontIndex )
{
m_fontLabel = a1->m_fontLabel;
if ( m_fontLabel )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *))m_fontLabel->removeFromParent)(m_fontLabel);
a1->m_fontLabel = nullptr;
}
a1->m_font = m_fontIndex;
v4 = (cocos2d::CCString *)sub_100268F4C("Font %i", m_fontIndex + 1);
CString = cocos2d::CCString::getCString(v4);
v6 = GameManager::sharedState();
GameManager::loadFont(v6, a1->m_font);
v7 = GameManager::sharedState();
v8 = GameManager::sharedState();
FontFile = GameManager::getFontFile(v7, v8->m_loadedFont);
v10 = cocos2d::CCLabelBMFont::create_1(CString, FontFile);
a1->m_fontLabel = v10;
((void (__fastcall *)(SelectFontLayer *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v10);
v11 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v11);
v12 = a1->m_fontLabel;
v13.n128_f32[0] = *(float *)&v15[2] * 0.5;
v14.n128_f32[0] = *(float *)&v15[3] * 0.5;
sub_100022980(v13, v14, v15);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD *))v12->setPosition)(v12, v15);
}
}