//
// CCScrollLayerExt::ccTouchBegan from 0x14004b410 to 0x14004b55f (335 bytes)
//
// 2 xrefs:
// > ??> @ 0x14070b130
// > ??> @ 0x14090fde8
//
// This function is hookable on this platform (idp: pc, 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 11:25:33 +0000
//
bool __fastcall CCScrollLayerExt::ccTouchBegan(__int64 a1, __int64 a2)
{
__int64 Location; // rax
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
bool v10; // zf
_BYTE v12[8]; // [rsp+20h] [rbp-18h] BYREF
_BYTE v13[16]; // [rsp+28h] [rbp-10h] BYREF
char v14; // [rsp+40h] [rbp+8h] BYREF
char v15; // [rsp+58h] [rbp+20h] BYREF
if ( *(_BYTE *)(a1 + 173) )
return 0;
Location = cocos2d::CCTouch::getLocation(a2, &v15);
if ( sub_14004A7E0(a1 - 320, Location) )
return 0;
*(_QWORD *)(a1 + 96) = a2;
cocos2d::CCTouch::getLocationInView(a2, &v14);
v5 = cocos2d::CCDirector::sharedDirector();
v6 = cocos2d::CCDirector::convertToGL(v5, &v15, &v14);
cocos2d::CCPoint::operator=(a1 + 104, v6);
cocos2d::CCPoint::operator=(a1 + 112, v7);
v8 = cocos2d::CCNode::convertToNodeSpace(a1 - 320, &v15, a1 + 104);
cocos2d::CCPoint::operator=(&v14, v8);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v12);
cocos2d::CCPoint::operator=(v12, &unk_140909AE0);
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a1 - 320) + 320LL))(a1 - 320);
cocos2d::CCSize::operator=(v13, v9);
if ( !cocos2d::CCRect::containsPoint((cocos2d::CCRect *)v12, (const struct cocos2d::CCPoint *)&v14) )
return 0;
cocos2d::CCNode::stopAllActions(*(cocos2d::CCNode **)(a1 + 160));
cocos2d::CCTime::gettimeofdayCocos2d((struct cocos2d::cc_timeval *)(a1 + 120), nullptr);
v10 = *(_BYTE *)(a1 + 173) == 0;
*(_BYTE *)(a1 + 128) = 1;
return v10;
}