//
// CCTextInputNode::ccTouchBegan from 0x6c1ea4 to 0x6c2080 (476 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'CCTextInputNode::ccTouchBegan @ 0x6c2084
// > ??> @ 0xa5178
// > ??> @ 0x141fe00
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:51:19 +0000
//
__int64 __fastcall CCTextInputNode::ccTouchBegan(__int64 a1, cocos2d::CCTouch *a2)
{
unsigned __int8 isVisibleInTree; // w0
unsigned int v5; // w19
const void *i; // x19
void *v8; // x0
unsigned __int8 v9; // w0
ScrollableContentLayer *v10; // x0
__int64 v11; // x0
__int64 v12; // [xsp+58h] [xbp+58h] BYREF
float v13; // [xsp+60h] [xbp+60h] BYREF
_BYTE v14[16]; // [xsp+68h] [xbp+68h] BYREF
isVisibleInTree = CCTextInputNode::isVisibleInTree((CCTextInputNode *)a1);
v5 = isVisibleInTree;
if ( isVisibleInTree )
{
cocos2d::CCTouch::getLocation(&v12, a2);
if ( a1 )
{
for ( i = (const void *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 512LL))(a1);
i;
i = (const void *)(*(__int64 (__fastcall **)(const void *))(*(_QWORD *)i + 512LL))(i) )
{
v8 = _dynamic_cast(
i,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCTouchClipper,
-2);
if ( v8 )
{
if ( !(*(unsigned __int8 (__fastcall **)(void *, __int64 *))(*(_QWORD *)v8 + 16LL))(v8, &v12) )
return 0;
}
}
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v14, (const cocos2d::CCPoint *)&v12);
v9 = CCTextInputNode::containsTouchPoint(a1, (const cocos2d::CCPoint *)v14);
v5 = v9;
if ( !v9 )
{
if ( *(_BYTE *)(a1 + 460) && *(_BYTE *)(a1 + 626) )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1160LL))(a1, 0);
return v5;
}
return 0;
}
v10 = *(ScrollableContentLayer **)(a1 + 640);
if ( v10 )
{
ScrollableContentLayer::handleTouchBegan(v10, a2);
}
else
{
v11 = *(_QWORD *)(a1 + 584);
if ( v11 && !(*(unsigned __int8 (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 40LL))(v11, a1) )
return 0;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1160LL))(a1, 1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v13, (const cocos2d::CCPoint *)&v12);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v14, (const cocos2d::CCRect *)&unk_155C0E8);
CCTextInputNode::updateCursorPosition(a1, &v13);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v14, (const cocos2d::CCPoint *)&v12);
CCTextInputNode::armHold(a1, (__int64)v14);
}
return v5;
}