//
// cocos2d::CCLabelTTF::updateTexture from 0x1003bdb80 to 0x1003bdcf3 (371 bytes)
//
// 8 xrefs:
// > cocos2d::CCLabelTTF::_updateWithTextDefinition @ 0x1003bdaff
// > cocos2d::CCLabelTTF::setString @ 0x1003bdb6b
// > sub_1003BDD10 @ 0x1003bdd4f
// > sub_1003BDE00 @ 0x1003bde25
// > sub_1003BDE50 @ 0x1003bde75
// > sub_1003BDEB0 @ 0x1003bdeff
// > sub_1003BDF30 @ 0x1003bdf5e
// > cocos2d::CCLabelTTF::setFontName @ 0x1003be0a0
//
// 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 __fastcall cocos2d::CCLabelTTF::updateTexture(cocos2d::CCLabelTTF *a1)
{
cocos2d::CCTexture2D *v1; // r14
std::array *longStorage; // r15
std::string *m_pFontName; // r12
const char *elems; // r12
cocos2d::CCDirector *v5; // rax
cocos2d::CCDirector *v6; // rax
cocos2d::CCDirector *v7; // rax
float v8; // xmm1_4
double v9; // xmm0_8
__int64 v11; // [rsp+4h] [rbp-4Ch] BYREF
__m128 v12; // [rsp+Ch] [rbp-44h] BYREF
float height; // [rsp+1Ch] [rbp-34h]
float m_fFontSize; // [rsp+20h] [rbp-30h]
float width; // [rsp+24h] [rbp-2Ch]
v1 = (cocos2d::CCTexture2D *)operator new(0x68u);
sub_100477FC0(v1);
if ( (a1->m_string.m_data.m_short.sizex2 & 1) != 0 )
{
longStorage = (std::array *)a1->m_string.m_data.m_long.longStorage;
m_pFontName = a1->m_pFontName;
if ( (m_pFontName->m_data.m_short.sizex2 & 1) != 0 )
goto LABEL_3;
LABEL_5:
elems = m_pFontName->m_data.m_short.shortStorage.__elems_;
goto LABEL_6;
}
longStorage = &a1->m_string.m_data.m_short.shortStorage;
m_pFontName = a1->m_pFontName;
if ( (m_pFontName->m_data.m_short.sizex2 & 1) == 0 )
goto LABEL_5;
LABEL_3:
elems = m_pFontName->m_data.m_long.longStorage;
LABEL_6:
m_fFontSize = a1->m_fFontSize;
v5 = cocos2d::CCDirector::sharedDirector();
m_fFontSize = sub_1004849C0(v5) * m_fFontSize;
width = a1->m_tDimensions.width;
v6 = cocos2d::CCDirector::sharedDirector();
width = sub_1004849C0(v6) * width;
height = a1->m_tDimensions.height;
v7 = cocos2d::CCDirector::sharedDirector();
v8 = height * sub_1004849C0(v7);
sub_10028CBF0(v12.f32, width, v8);
cocos2d::CCTexture2D::initWithString(
v1,
longStorage->__elems_,
elems,
m_fFontSize,
(const cocos2d::CCSize *)&v12,
a1->m_hAlignment,
a1->m_vAlignment);
((void (__fastcall *)(cocos2d::CCLabelTTF *, cocos2d::CCTexture2D *))a1->setTexture)(a1, v1);
cocos2d::CCObject::release(v1);
v9 = sub_10028D180(&v12, (unsigned __int64 *)&unk_1009A1228);
((void (__fastcall *)(__int64 *, double))a1->m_pobTexture->getContentSize)(&v11, v9);
sub_10028CFF0(&v12.i64[1], &v11);
((void (__fastcall *)(cocos2d::CCLabelTTF *, __m128 *))a1->setTextureRect)(a1, &v12);
return 1;
}