//
// cocos2d::extension::CCScrollView::ccTouchMoved from 0x180013be0 to 0x180013f63 (899 bytes)
//
// 7 xrefs:
// > cocos2d::extension::CCTableView::ccTouchMoved @ 0x180016649
// > ??> @ 0x1800282e0
// > ??> @ 0x18002eae0
// > ??> @ 0x18002eb14
// > ??> @ 0x18002eb28
// > ??> @ 0x18002fdf8
// > ??> @ 0x18004a584
//
// 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
//
void __fastcall cocos2d::extension::CCScrollView::ccTouchMoved(
cocos2d::CCArray **this,
struct cocos2d::CCTouch *a2,
struct cocos2d::CCEvent *a3)
{
cocos2d::extension::CCScrollView *v3; // rsi
__int64 ViewRect; // rax
struct cocos2d::CCObject *v7; // rax
__int64 v8; // rax
int v9; // eax
float v10; // xmm7_4
float v11; // xmm1_4
cocos2d::CCEGLViewProtocol *v12; // rax
float ScaleY; // xmm0_4
cocos2d::CCEGLViewProtocol *v14; // rax
float v15; // xmm6_4
const struct cocos2d::CCPoint *v16; // rax
int v17; // ecx
float v18; // xmm2_4
float v19; // xmm1_4
__int64 v20; // rax
float *v21; // rax
float v22; // xmm7_4
__int64 v23; // rax
float v24; // xmm6_4
float *v25; // rax
struct cocos2d::CCObject *v26; // rax
const struct cocos2d::CCPoint *v27; // rbx
struct cocos2d::CCObject *v28; // rax
cocos2d *v29; // rax
const struct cocos2d::CCPoint *v30; // r8
float v31; // xmm6_4
float v32; // xmm0_4
_BYTE v33[16]; // [rsp+20h] [rbp-50h] BYREF
_BYTE v34[8]; // [rsp+30h] [rbp-40h] BYREF
_BYTE v35[8]; // [rsp+38h] [rbp-38h] BYREF
_BYTE v36[16]; // [rsp+40h] [rbp-30h] BYREF
float v37; // [rsp+90h] [rbp+20h] BYREF
float v38; // [rsp+94h] [rbp+24h]
char v39; // [rsp+A8h] [rbp+38h] BYREF
v3 = (cocos2d::extension::CCScrollView *)(this - 40);
if ( (*((unsigned __int8 (__fastcall **)(char *, struct cocos2d::CCTouch *, struct cocos2d::CCEvent *))*(this - 40)
+ 41))(
(char *)this - 320,
a2,
a3)
&& cocos2d::CCArray::containsObject(*(this + 23), a2) )
{
if ( cocos2d::CCArray::count(*(this + 23)) == 1 && *((_BYTE *)this + 116) )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v34);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v36);
ViewRect = cocos2d::extension::CCScrollView::getViewRect(v3, v33);
cocos2d::CCRect::operator=(v36, ViewRect);
v7 = cocos2d::CCArray::objectAtIndex(*(this + 23), 0);
v8 = cocos2d::CCNode::convertTouchToNodeSpace(v3, v33, v7);
cocos2d::CCPoint::operator=(&v39, v8);
cocos2d::CCPoint::operator-(&v39, v33, this + 21);
cocos2d::CCPoint::operator=(&v37, v33);
v9 = *((_DWORD *)this + 28);
if ( v9 == 1 )
{
v10 = v38;
}
else if ( v9 )
{
v11 = (float)(v37 * v37) + (float)(v38 * v38);
if ( v11 < 0.0 )
v10 = sqrtf(v11);
else
v10 = fsqrt(v11);
}
else
{
v10 = v37;
}
if ( !*((_BYTE *)this + 136) )
{
v12 = (cocos2d::CCEGLViewProtocol *)cocos2d::CCEGLView::sharedOpenGLView();
ScaleY = cocos2d::CCEGLViewProtocol::getScaleY(v12);
v14 = (cocos2d::CCEGLViewProtocol *)cocos2d::CCEGLView::sharedOpenGLView();
v15 = (float)((float)(ScaleY + cocos2d::CCEGLViewProtocol::getScaleX(v14)) * 0.5) * v10;
if ( fabs(v15 / (float)(int)cocos2d::CCDevice::getDPI()) < 0.043749999 )
return;
if ( !*((_BYTE *)this + 136) )
cocos2d::CCPoint::operator=(&v37, &unk_180048620);
}
cocos2d::CCPoint::operator=(this + 21, &v39);
*((_BYTE *)this + 136) = 1;
v16 = (const struct cocos2d::CCPoint *)cocos2d::CCNode::convertToWorldSpace(v3, v33, &v39);
if ( cocos2d::CCRect::containsPoint((cocos2d::CCRect *)v36, v16) )
{
v17 = *((_DWORD *)this + 28);
if ( v17 )
{
if ( v17 != 1 )
{
LABEL_22:
cocos2d::CCPoint::operator=(v34, (char *)this + 140);
cocos2d::CCPoint::operator=(v35, (char *)this + 148);
v21 = (float *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)*(this + 16) + 200LL))(*(this + 16));
v22 = v37 + *v21;
v23 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)*(this + 16) + 200LL))(*(this + 16));
v24 = v38 + *(float *)(v23 + 4);
cocos2d::CCPoint::operator=(this + 20, &v37);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, v22, v24);
cocos2d::extension::CCScrollView::setContentOffset((__int64)v3, v25, 0);
return;
}
v18 = v38;
v19 = 0.0;
}
else
{
v19 = v37;
v18 = 0.0;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, v19, v18);
cocos2d::CCPoint::operator=(&v37, v20);
goto LABEL_22;
}
}
else if ( cocos2d::CCArray::count(*(this + 23)) == 2 && !*((_BYTE *)this + 116) )
{
v26 = cocos2d::CCArray::objectAtIndex(*(this + 23), 1u);
v27 = (const struct cocos2d::CCPoint *)cocos2d::CCNode::convertTouchToNodeSpace(*(this + 16), &v37, v26);
v28 = cocos2d::CCArray::objectAtIndex(*(this + 23), 0);
v29 = (cocos2d *)cocos2d::CCNode::convertTouchToNodeSpace(*(this + 16), &v39, v28);
v31 = cocos2d::ccpDistance(v29, v27, v30);
v32 = (*(float (__fastcall **)(_QWORD))(*(_QWORD *)*(this + 16) + 168LL))(*(this + 16));
cocos2d::extension::CCScrollView::setZoomScale(v3, (float)(v32 * v31) / *((float *)this + 44));
}
}
}