//
// CCTextInputNode::updateBlinkLabelToChar from 0x10016d158 to 0x10016d4e0 (904 bytes)
//
// 5 xrefs:
// > CCTextInputNode::updateLabel @ 0x10016cdb4
// > CCTextInputNode::onTextFieldInsertText @ 0x10016d888
// > CCTextInputNode::onTextFieldAttachWithIME @ 0x10016dca8
// > CCTextInputNode::updateCursorPosition @ 0x10016e524
// > CCTextInputNode::updateCursorPosition @ 0x10016e5e4
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall CCTextInputNode::updateBlinkLabelToChar(CCTextInputNode *a1, int a2)
{
__int64 v2; // x21
cocos2d::CCLabelBMFont *m_textLabel; // x19
cocos2d::CCLabelBMFont **p_m_cursor; // x24
float v6; // s8
TextArea *m_textArea; // x8
cocos2d::CCArray *m_lines; // x22
__int64 v9; // x23
__int64 v10; // x0
int v11; // w0
cocos2d::CCNode *v12; // x22
const cocos2d::CCPoint *v13; // x0
cocos2d::CCNode *v14; // x0
__int64 v15; // x0
__int64 v16; // x22
cocos2d::CCSprite *v17; // x0
float LetterPosXLeft; // s9
float m_fontValue1; // s10
float v20; // s9
float v21; // s10
float v22; // s9
float v23; // s0
char *v24; // x0
_BOOL4 v25; // w20
float v26; // s10
cocos2d::CCLabelBMFont *v27; // x20
float32x2_t *v28; // x21
float v29; // s9
float v30; // s11
float v31; // s9
float v32; // s12
__n128 v33; // q0
__n128 v34; // q1
double v35; // d0
cocos2d::CCLabelBMFont *v36; // x20
__n128 v37; // q1
__n128 v38; // q0
float32x2_t v39[2]; // [xsp+0h] [xbp-A0h] BYREF
char v40; // [xsp+17h] [xbp-89h]
void *__p[2]; // [xsp+18h] [xbp-88h] BYREF
char v42; // [xsp+2Fh] [xbp-71h]
cocos2d::CCPoint v43; // 0:kr00_8.8
v2 = *(_QWORD *)&a2;
m_textLabel = a1->m_textLabel;
if ( m_textLabel )
{
if ( !a1->m_cursor )
return;
p_m_cursor = &a1->m_cursor;
v6 = -1.0;
goto LABEL_14;
}
m_textArea = a1->m_textArea;
if ( !m_textArea || !a1->m_cursor )
return;
p_m_cursor = &a1->m_cursor;
if ( (a2 & 0x80000000) == 0 )
{
m_lines = m_textArea->m_label->m_lines;
if ( (unsigned int)sub_10024A36C(m_lines) )
{
v9 = 0;
do
{
m_textLabel = (cocos2d::CCLabelBMFont *)sub_10024A388(m_lines, v9);
v10 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getChildren)(m_textLabel);
v11 = sub_10024A36C(v10);
if ( (int)v2 <= v11 )
goto LABEL_13;
v9 = (unsigned int)(v9 + 1);
v2 = (unsigned int)(v2 - v11);
}
while ( (unsigned int)v9 < (unsigned int)sub_10024A36C(m_lines) );
}
m_textArea = a1->m_textArea;
}
m_textLabel = (cocos2d::CCLabelBMFont *)sub_10024A398(m_textArea->m_label->m_lines);
v2 = 0xFFFFFFFFLL;
a1->m_textField->m_uCursorPos = -1;
LABEL_13:
v12 = (cocos2d::CCNode *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getParent)(m_textLabel);
v13 = (const cocos2d::CCPoint *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getPosition)(m_textLabel);
v43 = cocos2d::CCNode::convertToWorldSpace(v12, v13);
v14 = (cocos2d::CCNode *)((__int64 (__fastcall *)(TextArea *, float, float))a1->m_textArea->getParent)(
a1->m_textArea,
v43.x,
v43.y);
cocos2d::CCNode::convertToWorldSpace(v14, &stru_10086BA50);
v6 = (float)((float)(*((float *)__p + 1) - v39[0].f32[1])
- *(float *)(((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getPosition)(m_textLabel) + 4))
+ -1.0;
LABEL_14:
v15 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getChildren)(m_textLabel);
if ( (v2 & 0x80000000) != 0 || (v16 = v15, (unsigned int)sub_10024A36C(v15) <= (unsigned int)v2) )
{
v21 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getContentSize)(m_textLabel);
v22 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getScale)(m_textLabel);
v23 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getScaleX)(m_textLabel);
v20 = (float)(v23 + v23) + (float)(v21 * v22);
}
else
{
v17 = (cocos2d::CCSprite *)sub_10024A388(v16, v2);
LetterPosXLeft = cocos2d::CCLabelBMFont::getLetterPosXLeft(m_textLabel, v17, a1->m_fontValue2, a1->m_isChatFont);
m_fontValue1 = a1->m_fontValue1;
v20 = LetterPosXLeft
+ (float)(m_fontValue1 * ((float (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getScaleX)(m_textLabel));
}
v24 = (char *)((__int64 (__fastcall *)(cocos2d::CCTextFieldTTF *))a1->m_textField->getString)(a1->m_textField);
sub_100009900(__p, v24);
sub_100009900(v39, "");
v25 = sub_1000045BC(__p, v39);
if ( v40 < 0 )
operator delete(*(void **)v39);
if ( v42 < 0 )
operator delete(__p[0]);
if ( v25 )
v26 = 2.0;
else
v26 = v20;
v27 = *p_m_cursor;
v28 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getPosition)(m_textLabel);
v29 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getContentSize)(m_textLabel);
v30 = v29
* (float)(1.0
- *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getAnchorPoint)(m_textLabel));
v31 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getScale)(m_textLabel);
v32 = *(float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getContentSize)(m_textLabel);
v33.n128_f64[0] = ((double (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getScale)(m_textLabel);
v33.n128_f32[0] = v26 + (float)((float)(v30 * v31) - (float)(v32 * v33.n128_f32[0]));
v34.n128_f32[0] = v6;
sub_100022980(v33, v34, v39);
*(float32x2_t *)&v35 = sub_1000229DC(v28, v39, (float32x2_t *)__p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **, double))v27->setPosition)(v27, __p, v35);
v36 = *p_m_cursor;
v37.n128_u32[0] = *(_DWORD *)(((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))m_textLabel->getAnchorPoint)(m_textLabel)
+ 4);
v38.n128_u32[0] = 0.5;
sub_100022980(v38, v37, __p);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, void **))v36->setAnchorPoint)(v36, __p);
}