//
// CCScrollLayerExt::ccTouchBegan from 0x1400475f0 to 0x14004770e (286 bytes)
//
// 4 xrefs:
// > ??> @ 0x1405304a8
// > ??> @ 0x140662da4
// > ??> @ 0x140662db4
// > ??> @ 0x1406c48e4
//
// 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 CCScrollLayerExt::ccTouchBegan(CCScrollLayerExt *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
cocos2d::CCDirector *v4; // rax
struct cocos2d::CCPoint v5; // rax
__int64 v6; // rax
struct cocos2d::CCPoint v7; // rax
__int64 v8; // rax
bool v9; // zf
cocos2d::CCRect v11; // [rsp+20h] [rbp-18h] BYREF
struct cocos2d::CCPoint v12; // [rsp+40h] [rbp+8h] BYREF
struct cocos2d::CCPoint v13; // [rsp+58h] [rbp+20h] BYREF
if ( BYTE1(a1->m_sInverse.a) )
return 0;
*(_QWORD *)&a1->m_fSkewY = a2;
cocos2d::CCTouch::getLocationInView(a2);
v4 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector();
v5 = cocos2d::CCDirector::convertToGL(v4, &v13);
v6 = ((__int64 (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&a1->m_obAnchorPointInPoints.y, v5);
cocos2d::CCPoint::operator=(&a1->m_obAnchorPoint.y, v6);
v7 = cocos2d::CCNode::convertToNodeSpace((CCScrollLayerExt *)((char *)a1 - 320), &v13);
((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v12, v7);
cocos2d::CCRect::CCRect(&v11);
cocos2d::CCPoint::operator=(&v11, &stru_1406C13A8);
v8 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)&a1[-1].m_sInverse.ty + 304LL))(&a1[-1].m_sInverse.ty);
cocos2d::CCSize::operator=(&v11.size, v8);
if ( !cocos2d::CCRect::containsPoint(&v11, &v12) )
return 0;
cocos2d::CCNode::stopAllActions(*(cocos2d::CCNode **)&a1->m_sTransform.d);
cocos2d::CCTime::gettimeofdayCocos2d((struct cocos2d::cc_timeval *)&a1->m_obContentSize.height, nullptr);
v9 = BYTE1(a1->m_sInverse.a) == 0;
LOBYTE(a1->m_sAdditionalTransform.b) = 1;
return v9;
}