//
// CCTextInputNode::refreshLabel from 0x2fa484 to 0x2fa5c8 (324 bytes)
//
// 6 xrefs:
// > CCTextInputNode::setMaxLabelScale @ 0x2fa5d4
// > CCTextInputNode::setMaxLabelWidth @ 0x2fa5dc
// > CCTextInputNode::setLabelPlaceholderScale @ 0x2fa5e4
// > CCTextInputNode::setLabelPlaceholderColor @ 0x2fa5f6
// > CCTextInputNode::setLabelNormalColor @ 0x2fa610
// > CCTextInputNode::updateLabel @ 0x2fa9a2
//
// 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 CCTextInputNode::refreshLabel(CCTextInputNode *a1)
{
char *v2; // r0
unsigned int v3; // r6
cocos2d::CCLabelBMFont *m_textLabel; // r5
unsigned int v5; // r6
cocos2d::CCLabelBMFont_vtbl *v6; // r3
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // r8
float m_maxLabelWidth; // s16
float *v9; // r0
float m_maxLabelScale; // s15
float v11; // s16
void (*setColor)(void); // r3
TextArea *m_textArea; // r0
int v14; // r1
char v15[4]; // [sp+Ch] [bp-Ch] BYREF
char v16[4]; // [sp+10h] [bp-8h] BYREF
if ( a1->m_textLabel || a1->m_textArea )
{
v2 = (char *)a1->m_textField->getString(a1->m_textField);
sub_776584((int)v15, v2);
sub_776584((int)v16, (char *)&unk_939830);
v3 = __clz(sub_774DBC(v15, v16));
sub_774008(v16);
sub_774008(v15);
m_textLabel = a1->m_textLabel;
v5 = v3 >> 5;
if ( m_textLabel )
{
v6 = m_textLabel->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( v5 && a1->m_placeholderScale > 0.0 )
{
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))v6->setScale)(
a1->m_textLabel,
LODWORD(a1->m_placeholderScale));
}
else
{
setScale = v6->setScale;
m_maxLabelWidth = a1->m_maxLabelWidth;
v9 = (float *)v6->getContentSize(a1->m_textLabel);
m_maxLabelScale = a1->m_maxLabelScale;
if ( (float)(m_maxLabelWidth / *v9) <= m_maxLabelScale )
{
m_textLabel = a1->m_textLabel;
v11 = a1->m_maxLabelWidth;
m_maxLabelScale = v11 / m_textLabel->getContentSize(m_textLabel)->width;
}
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))setScale)(m_textLabel, LODWORD(m_maxLabelScale));
if ( !v5 )
{
setColor = (void (*)(void))a1->m_textLabel->setColor;
goto LABEL_12;
}
}
setColor = (void (*)(void))a1->m_textLabel->setColor;
LABEL_12:
setColor();
return;
}
m_textArea = a1->m_textArea;
if ( m_textArea )
{
if ( v5 )
v14 = *(_DWORD *)&a1->m_placeholderColor.r;
else
v14 = a1->m_textColor.r | (a1->m_textColor.g << 8) | (a1->m_textColor.b << 16);
TextArea::colorAllLabels(m_textArea, (cocos2d::ccColor3B)v14);
}
}
}