//
// CCTextInputNode::ccTouchBegan from 0x5a55d0 to 0x5a57bc (492 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'CCTextInputNode::ccTouchBegan @ 0x5a57c0
// > ??> @ 0x7ba08
// > ??> @ 0x1141220
//
// 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 CCTextInputNode::ccTouchBegan(CCTextInputNode *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
cocos2d::CCDirector *v4; // x0
const cocos2d::CCPoint *v5; // x0
float v6; // s0
cocos2d::CCNode *v7; // x0
const cocos2d::CCPoint *v8; // x0
float v9; // s0
float v10; // s1
char v11; // w24
TextInputDelegate *m_delegate; // x0
cocos2d::CCPoint v14; // [xsp+50h] [xbp+50h] BYREF
cocos2d::CCPoint v15; // [xsp+58h] [xbp+58h] BYREF
cocos2d::CCPoint v16; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCRect v17; // [xsp+68h] [xbp+68h] BYREF
cocos2d::CCRect v18; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCPoint v19; // 0:kr08_8.8
cocos2d::CCPoint v20; // 0:kr10_8.8
cocos2d::CCPoint v21; // 0:kr18_8.8
cocos2d::CCPoint v22; // 0:s0.4,4:s1.4
cocos2d::CCRect v23; // 0:s2.4,4:s3.4,8:s4.4,12:s5.4
cocos2d::CCTouch::getLocationInView(a2);
v4 = cocos2d::CCDirector::sharedDirector();
v19 = cocos2d::CCDirector::convertToGL(v4, &v14);
cocos2d::CCPoint::operator=(&v14, v19.x, v19.y);
v20 = cocos2d::CCNode::convertToWorldSpace(a1, &v14);
cocos2d::CCPoint::operator=(&v14, v20.x, v20.y);
v21 = cocos2d::CCNode::convertToNodeSpace(a1, &v14);
cocos2d::CCPoint::operator=(&v14, v21.x, v21.y);
v5 = a1->m_textField->getAnchorPoint(a1->m_textField);
cocos2d::CCPoint::CCPoint(&v18.origin, v5);
v6 = sub_5951D8((__int64)a1, (float *)&v18.origin, &v17);
if ( ((__int64 (__fastcall *)(CCTextInputNode *, float))a1->getParent)(a1, v6) )
{
v7 = a1->getParent(a1);
v8 = v7->getPosition(v7);
cocos2d::CCPoint::CCPoint(&v15, v8);
}
else
{
cocos2d::CCPoint::CCPoint(&v15, 0.0, 0.0);
}
cocos2d::CCPoint::operator+(&v18, &v17, &v15);
cocos2d::CCPoint::operator=(&v17, v9, v10);
v11 = cocos2d::CCRect::containsPoint(&v17, &v14);
if ( !v11 )
return 0;
m_delegate = a1->m_delegate;
if ( m_delegate )
{
if ( !m_delegate->allowTextInput(m_delegate, a1) )
return 0;
}
a1->onClickTrackNode(a1, 1);
cocos2d::CCPoint::CCPoint(&v16, &v14);
cocos2d::CCRect::CCRect(&v18, &v17);
CCTextInputNode::updateCursorPosition(a1, v22, v23);
return v11;
}