//
// EditorWindowPopup::ccTouchMoved from 0x1004da3f8 to 0x1004da704 (780 bytes)
//
// 7 xrefs:
// > sub_1004DA704 @ 0x1004da708
// > ??> @ 0x1009860a0
// > ??> @ 0x10098b998
// > ??> @ 0x10098c1e0
// > ??> @ 0x100990cb8
// > ??> @ 0x1009920e8
// > ??> @ 0x1009a7640
//
// 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 11:06:33 +0000
//
__int64 __fastcall EditorWindowPopup::ccTouchMoved(__int64 result, float32x2_t *a2, __int64 a3)
{
__int64 v5; // x19
int v6; // w8
__int64 v7; // x1
float v8; // s2
float v9; // s0
float32x2_t v10; // d4
float v11; // s1
float v12; // s3
float v13; // s4
float v14; // s6
float v15; // s0
float v16; // s2
float32x2_t v17; // d6
float32x2_t v18; // d3
float32x2_t v19; // d4
float32x2_t v20; // d4
float v21; // s5
float32x2_t v27; // d7
unsigned __int8 v28; // w8
float v29; // s7
float32x2_t v30; // [xsp+8h] [xbp-38h] BYREF
float32x2_t v31; // [xsp+10h] [xbp-30h] BYREF
float32x2_t v32; // [xsp+18h] [xbp-28h] BYREF
if ( a2[7].i32[0] == *(_DWORD *)(result + 1076) )
{
v5 = result;
if ( *(_BYTE *)(result + 1093) == 1 )
{
result = *(_QWORD *)(result + 552);
return (*(__int64 (__fastcall **)(__int64, float32x2_t *, __int64))(*(_QWORD *)result + 904LL))(result, a2, a3);
}
if ( *(_BYTE *)(result + 1094) == 1 )
{
cocos2d::CCTouch::getLocation(a2, (float *)&v32);
v6 = EditorWindowPopup::isInCloseButton(v5, (float *)&v32);
result = *(_QWORD *)(v5 + 1032);
if ( result )
{
if ( v6 )
v7 = 150;
else
v7 = 255;
return (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)result + 912LL))(result, v7);
}
}
else if ( *(_DWORD *)(result + 1096) )
{
cocos2d::CCTouch::getLocation(a2, (float *)&v31);
sub_10002632C(&v31, (float32x2_t *)(v5 + 1108), &v32);
if ( *(_DWORD *)(v5 + 1096) == 1 )
v8 = -1.0;
else
v8 = 1.0;
v9 = *(float *)(v5 + 1100);
v10.f32[0] = v8 * (float)(v32.f32[0] - v9);
v11 = *(float *)(v5 + 1104);
if ( *(_DWORD *)(v5 + 1116) == 2 )
{
v12 = *(float *)(v5 + 1056);
v13 = v10.f32[0] / v12;
v14 = *(float *)(v5 + 1060);
if ( v13 < (float)((float)(v11 - v32.f32[1]) / v14) )
v13 = (float)(v11 - v32.f32[1]) / v14;
if ( v13 < *(float *)(v5 + 1144) )
v13 = *(float *)(v5 + 1144);
if ( v13 > *(float *)(v5 + 1148) )
v13 = *(float *)(v5 + 1148);
*(float *)(v5 + 1064) = v13;
v15 = v9 + (float)((float)(v8 * (float)(v12 * v13)) * 0.5);
v16 = (float)(v14 * v13) * 0.5;
}
else
{
v17 = *(float32x2_t *)(v5 + 1128);
v18 = *(float32x2_t *)(v5 + 1136);
v10.f32[1] = v11 - v32.f32[1];
v19 = (float32x2_t)vbsl_s8((int8x8_t)vcgt_f32(v18, v10), (int8x8_t)v10, (int8x8_t)v18);
v20 = (float32x2_t)vbsl_s8((int8x8_t)vcgt_f32(v19, v17), (int8x8_t)v19, (int8x8_t)v17);
v21 = v20.f32[1];
if ( *(_BYTE *)(v5 + 1120) == 1 )
{
__asm { FMOV V17.2S, #1.0 }
v27 = (float32x2_t)vbsl_s8(
(int8x8_t)vcgtz_f32(*(float32x2_t *)(v5 + 1056)),
(int8x8_t)vdiv_f32(v20, *(float32x2_t *)(v5 + 1056)),
_D17);
v28 = vcgt_f32(v27, (float32x2_t)vdup_lane_s32((int32x2_t)v27, 1)).u8[0];
v29 = *(float *)(v5 + 1124);
if ( (v28 & 1) != 0 )
v21 = v20.f32[0] / v29;
else
v20.f32[0] = v20.f32[1] * v29;
if ( v20.f32[0] < v17.f32[0] )
{
v20.i32[0] = *(_QWORD *)(v5 + 1128);
v21 = v17.f32[0] / v29;
}
v17.f32[0] = vmuls_lane_f32(v29, v17, 1);
if ( v21 < v17.f32[1] )
{
v20.f32[0] = v17.f32[0];
v21 = v17.f32[1];
}
if ( v20.f32[0] > v18.f32[0] )
{
v20.i32[0] = *(_QWORD *)(v5 + 1136);
v21 = v18.f32[0] / v29;
}
if ( v21 > v18.f32[1] )
{
v20.f32[0] = v18.f32[1] * v29;
LODWORD(v21) = HIDWORD(*(_QWORD *)(v5 + 1136));
}
}
*(_DWORD *)(v5 + 1056) = v20.i32[0];
*(float *)(v5 + 1060) = v21;
v15 = v9 + (float)((float)(v8 * v20.f32[0]) * 0.5);
v16 = v21 * 0.5;
}
sub_1000262BC((float *)&v31, v15, v11 - v16);
sub_10002630C((_QWORD *)(v5 + 1068), (double *)&v31);
return EditorWindowPopup::applyWindowSize(v5);
}
else if ( *(_BYTE *)(result + 1080) == 1 )
{
cocos2d::CCTouch::getLocation(a2, (float *)&v32);
sub_10002632C(&v32, (float32x2_t *)(v5 + 1084), &v30);
EditorWindowPopup::clampWindowCenter(v5, (__int64)&v30, &v31);
sub_10002630C((_QWORD *)(v5 + 1068), (double *)&v31);
return EditorWindowPopup::layoutWindow(v5);
}
else
{
result = *(_QWORD *)(result + 1040);
if ( result )
{
sub_100525598(result, a2);
result = sub_1005257A4(*(_QWORD *)(v5 + 1040));
if ( (_DWORD)result )
{
if ( *(_BYTE *)(v5 + 1092) == 1 )
{
result = *(_QWORD *)(v5 + 1048);
if ( result )
{
result = (*(__int64 (__fastcall **)(__int64, float32x2_t *, __int64))(*(_QWORD *)result + 920LL))(
result,
a2,
a3);
*(_BYTE *)(v5 + 1092) = 0;
}
}
}
}
if ( *(_BYTE *)(v5 + 1092) == 1 )
{
result = *(_QWORD *)(v5 + 1048);
if ( result )
return (*(__int64 (__fastcall **)(__int64, float32x2_t *, __int64))(*(_QWORD *)result + 904LL))(
result,
a2,
a3);
}
}
}
return result;
}