//
// cocos2d::CCLabelBMFont::initWithString from 0xae83bc to 0xae86d8 (796 bytes)
//
// 5 xrefs:
// > CCCounterLabel::init @ 0x574bac
// > cocos2d::CCLabelBMFont::create @ 0xae8750
// > cocos2d::CCLabelBMFont::createBatched @ 0xae89c8
// > cocos2d::CCLabelBMFont::init @ 0xae8a78
// > ??> @ 0x894f0
//
// 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
//
bool cocos2d::CCLabelBMFont::initWithString(
cocos2d::CCLabelBMFont *a1,
const char *a2,
const char *a3,
float a4,
cocos2d::CCTextAlignment a5,
cocos2d::CCPoint a6)
{
float *v6; // x4
float *v11; // x24
cocos2d::CCBMFontConfiguration *File; // x0
cocos2d::CCBMFontConfiguration *v14; // x23
cocos2d::CCBMFontConfiguration *m_pConfiguration; // x0
size_t v16; // x0
cocos2d::CCTextureCache *v17; // x0
cocos2d::CCTexture2D *v18; // x23
bool v19; // w21
unsigned int v21; // w0
cocos2d::CCTexture2D *v22; // x0
float v23; // s0
float v24; // s1
float v25; // s0
float v26; // s1
cocos2d::CCSprite *v27; // x24
bool (__fastcall *initWithTexture_1)(cocos2d::CCSprite *__hidden, cocos2d::CCTexture2D *, const cocos2d::CCRect *, bool); // x26
float v29; // s0
float v30; // s1
float v31; // s0
float v32; // s1
cocos2d::CCTexture2D *v33; // [xsp+68h] [xbp+68h]
cocos2d::CCRect v34; // [xsp+78h] [xbp+78h] BYREF
v11 = v6;
if ( !a3 )
{
v18 = (cocos2d::CCTexture2D *)operator new(0x68u);
cocos2d::CCTexture2D::CCTexture2D(v18);
cocos2d::CCObject::autorelease(v18);
if ( a2 )
goto LABEL_6;
goto LABEL_14;
}
File = cocos2d::FNTConfigLoadFile(a3);
v14 = File;
if ( !File )
{
v19 = 0;
cocos2d::CCObject::release(a1);
return v19;
}
cocos2d::CCObject::retain(File);
m_pConfiguration = a1->m_pConfiguration;
if ( m_pConfiguration )
cocos2d::CCObject::release(m_pConfiguration);
a1->m_pConfiguration = v14;
v16 = strlen(a3);
sub_D1798C(&a1->m_sFntFile, a3, v16);
v17 = cocos2d::CCTextureCache::sharedTextureCache();
v18 = cocos2d::CCTextureCache::addImage(v17, (const char *)a1->m_pConfiguration->m_sAtlasName.m_data.m_data, 0);
if ( !a2 )
LABEL_14:
a2 = &byte_F288A0;
LABEL_6:
if ( a1->m_bIsBatched )
{
v19 = cocos2d::CCNode::init(a1);
if ( v19 )
{
a1->m_pAlignment = a5;
a1->m_cRealOpacity = -1;
a1->m_cDisplayedOpacity = -1;
a1->m_tRealColor.r = -1;
a1->m_tRealColor.g = -1;
a1->m_tRealColor.b = -1;
a1->m_fWidth = a4;
*(_WORD *)&a1->m_tDisplayedColor.r = *(_WORD *)&a1->m_tRealColor.r;
a1->m_tDisplayedColor.b = -1;
a1->m_bCascadeOpacityEnabled = 1;
a1->m_bCascadeColorEnabled = 1;
cocos2d::CCSize::operator=(&a1->m_obContentSize, (float *)&stru_12452E8);
a1->m_bIsOpacityModifyRGB = 1;
cocos2d::CCPoint::CCPoint(&v34.origin, 0.5, 0.5);
cocos2d::CCPoint::operator=(&a1->m_obAnchorPoint, v29, v30, (float *)&v34.origin);
cocos2d::CCPoint::operator=(&a1->m_tImageOffset, v31, v32, v11);
a1->m_pSomeTexture = v18;
a1->setString_0(a1, (const unsigned __int8 *)a2, 0);
return v19;
}
}
else
{
v21 = strlen(a2);
v19 = cocos2d::CCSpriteBatchNode::initWithTexture(a1, v18, v21);
if ( v19 )
{
a1->m_pAlignment = a5;
a1->m_cRealOpacity = -1;
a1->m_cDisplayedOpacity = -1;
a1->m_tRealColor.r = -1;
a1->m_tRealColor.g = -1;
a1->m_tRealColor.b = -1;
a1->m_fWidth = a4;
*(_WORD *)&a1->m_tDisplayedColor.r = *(_WORD *)&a1->m_tRealColor.r;
a1->m_tDisplayedColor.b = -1;
a1->m_bCascadeOpacityEnabled = 1;
a1->m_bCascadeColorEnabled = 1;
cocos2d::CCSize::operator=(&a1->m_obContentSize, (float *)&stru_12452E8);
v22 = a1->m_pobTextureAtlas->getTexture(a1->m_pobTextureAtlas);
a1->m_bIsOpacityModifyRGB = cocos2d::CCTexture2D::hasPremultipliedAlpha(v22);
cocos2d::CCPoint::CCPoint(&v34.origin, 0.5, 0.5);
cocos2d::CCPoint::operator=(&a1->m_obAnchorPoint, v23, v24, (float *)&v34.origin);
cocos2d::CCPoint::operator=(&a1->m_tImageOffset, v25, v26, v11);
v27 = (cocos2d::CCSprite *)operator new(0x258u);
cocos2d::CCSprite::CCSprite(v27);
a1->m_pReusedChar = v27;
initWithTexture_1 = v27->initWithTexture_1;
v33 = a1->m_pobTextureAtlas->getTexture(a1->m_pobTextureAtlas);
cocos2d::CCRect::CCRect(&v34, 0.0, 0.0, 0.0, 0.0);
initWithTexture_1(v27, v33, &v34, 0);
a1->m_pReusedChar->setBatchNode(a1->m_pReusedChar, a1);
a1->setString_0(a1, (const unsigned __int8 *)a2, 1);
return v19;
}
}
return 0;
}