//
// EditorUI::ccTouchMoved from 0x1003f8be4 to 0x1003f90b8 (1236 bytes)
//
// 2 xrefs:
// > sub_1003F90B8 @ 0x1003f90bc
// > ??> @ 0x100813ec0
//
// 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 EditorUI::ccTouchMoved(EditorUI *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
int m_nId; // w8
void *m_rotationControl; // x0
LevelEditorLayer *m_editorLayer; // x9
cocos2d::CCEvent *v9; // x2
double v10; // d0
__int64 *v11; // x0
double v12; // d0
cocos2d::CCDirector *v13; // x0
GameManager *v14; // x0
unsigned __int64 v15; // t2
GameObject *m_snapObject; // x0
unsigned int v17; // w20
GameObject *v18; // x21
cocos2d::CCEvent *v19; // x2
GameObject *m_selectedObject; // x20
double v21; // d0
void *m_scaleControl; // x20
float32x2_t *v23; // x0
double v24; // d0
GJTransformControl *m_transformControl; // x20
float32x2_t *v26; // x0
double v27; // d0
float32x2_t v28; // [xsp+0h] [xbp-40h] BYREF
float32x2_t v29; // [xsp+8h] [xbp-38h] BYREF
float32x2_t v30; // [xsp+10h] [xbp-30h] BYREF
float32x2_t v31; // [xsp+18h] [xbp-28h] BYREF
cocos2d::CCPoint v32; // 0:s0.4,4:s1.4
cocos2d::CCPoint v33; // 0:s0.4,4:s1.4
cocos2d::CCPoint v34; // 0:s0.4,4:s1.4
cocos2d::CCPoint TouchPoint; // 0:s0.4,4:s1.4
m_nId = a2->m_nId;
if ( a1->m_rotationTouchID == m_nId )
{
cocos2d::CCNode::stopActionByTag(a1, 123);
m_rotationControl = a1->m_rotationControl;
LABEL_9:
(*(void (__fastcall **)(void *, cocos2d::CCTouch *, cocos2d::CCEvent *))(*(_QWORD *)m_rotationControl + 888LL))(
m_rotationControl,
a2,
a3);
return;
}
if ( a1->m_scaleTouchID == m_nId )
{
cocos2d::CCNode::stopActionByTag(a1, 123);
m_rotationControl = a1->m_scaleControl;
goto LABEL_9;
}
if ( a1->m_transformTouchID == m_nId )
{
cocos2d::CCNode::stopActionByTag(a1, 123);
m_rotationControl = a1->m_transformControl;
goto LABEL_9;
}
m_editorLayer = a1->m_editorLayer;
if ( m_editorLayer->m_playbackMode == Playing )
{
m_rotationControl = m_editorLayer->m_uiLayer;
goto LABEL_9;
}
if ( a1->m_touchID == m_nId )
{
EditorUI::getTouchPoint(a1, a2, a3);
if ( a1->m_snapObjectExists )
{
if ( !a1->m_continueSwipe )
{
if ( fabsf(cocos2d::ccpDistance((const cocos2d::CCPoint *)&v31, &a1->m_swipeStart)) >= 4.0 )
{
a1->m_continueSwipe = 1;
}
else if ( !a1->m_continueSwipe )
{
goto LABEL_45;
}
}
cocos2d::CCNode::convertToNodeSpace(a1->m_editorLayer->m_objectLayer, (const cocos2d::CCPoint *)&v31);
sub_1000229D0(&v31, (double *)&v30);
if ( !sub_100022A5C((float *)&v31, (float *)&a1->m_cameraTest) )
{
if ( !a1->m_continuousSnap )
{
if ( a1->m_snapObject )
{
v14 = GameManager::sharedState();
if ( GameManager::getGameVariable(v14, "0008") )
{
HIDWORD(v15) = -1527099483
* (int)((float (__fastcall *)(GameObject *))a1->m_snapObject->getRotation)(a1->m_snapObject)
+ 47721858;
LODWORD(v15) = HIDWORD(v15);
if ( (unsigned int)(v15 >> 1) <= 0x2D82D82 )
{
m_snapObject = a1->m_snapObject;
v30.i8[2] = 50;
v30.i16[0] = -25601;
((void (__fastcall *)(GameObject *, float32x2_t *))m_snapObject->setObjectColor)(m_snapObject, &v30);
}
}
}
}
a1->m_continuousSnap = 1;
sub_1000229F0(&v31, (float32x2_t *)&a1->m_cameraTest, &v30);
if ( (unsigned int)sub_10024A36C((__int64)a1->m_selectedObjects) )
{
if ( (unsigned int)sub_10024A36C((__int64)a1->m_selectedObjects) )
{
v17 = 0;
do
{
v18 = (GameObject *)sub_10024A388((__int64)a1->m_selectedObjects, v17);
v32.x = sub_1000229B8((__int64 *)&v29, (__int64 *)&v30);
EditorUI::moveObject(a1, v18, v32);
++v17;
}
while ( v17 < (unsigned int)sub_10024A36C((__int64)a1->m_selectedObjects) );
}
}
else
{
m_selectedObject = a1->m_selectedObject;
v34.x = sub_1000229B8((__int64 *)&v29, (__int64 *)&v30);
EditorUI::moveObject(a1, m_selectedObject, v34);
}
sub_1000229D0(&a1->m_cameraTest, (double *)&v31);
sub_1000229DC((float32x2_t *)&a1->m_pivotPoint, &v30, &v29);
v21 = sub_1000229D0(&a1->m_pivotPoint, (double *)&v29);
if ( ((unsigned int (__fastcall *)(GJRotationControl *, double))a1->m_rotationControl->isVisible)(
a1->m_rotationControl,
v21) )
{
m_scaleControl = a1->m_rotationControl;
}
else
{
if ( !((unsigned int (__fastcall *)(GJScaleControl *))a1->m_scaleControl->isVisible)(a1->m_scaleControl) )
{
if ( ((unsigned int (__fastcall *)(GJTransformControl *))a1->m_transformControl->isVisible)(a1->m_transformControl) )
{
m_transformControl = a1->m_transformControl;
v26 = (float32x2_t *)((__int64 (__fastcall *)(GJTransformControl *))m_transformControl->getPosition)(m_transformControl);
*(float32x2_t *)&v27 = sub_1000229DC(v26, &v30, &v29);
((void (__fastcall *)(GJTransformControl *, float32x2_t *, double))m_transformControl->setPosition)(
m_transformControl,
&v29,
v27);
GJTransformControl::refreshControl(a1->m_transformControl);
}
goto LABEL_45;
}
m_scaleControl = a1->m_scaleControl;
}
v23 = (float32x2_t *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)m_scaleControl + 192LL))(m_scaleControl);
*(float32x2_t *)&v24 = sub_1000229DC(v23, &v30, &v29);
(*(void (__fastcall **)(void *, float32x2_t *, double))(*(_QWORD *)m_scaleControl + 184LL))(
m_scaleControl,
&v29,
v24);
}
LABEL_45:
cocos2d::CCNode::stopActionByTag(a1, 123);
return;
}
if ( !a1->m_spaceSwiping )
{
if ( a1->m_swipeEnabled
|| (v13 = cocos2d::CCDirector::sharedDirector(),
(*(_BYTE *)(((__int64 (__fastcall *)(cocos2d::CCDirector *))v13->getKeyboardDispatcher)(v13) + 88) & 1) != 0)
|| a1->m_swipeModeTriggered )
{
EditorUI::getTouchPoint(a1, a2, v9);
if ( a1->m_selectedMode == 3 )
{
sub_1000229D0(&a1->m_swipeEnd, (double *)&v30);
}
else
{
v33.x = sub_1000229B8((__int64 *)&v28, (__int64 *)&v30);
EditorUI::getGridSnappedPos(a1, v33);
sub_1000229D0(&v30, (double *)&v29);
sub_1000229D0(&a1->m_createPosition, (double *)&v30);
TouchPoint = EditorUI::getTouchPoint(a1, a2, v19);
EditorUI::clickOnPosition(a1, TouchPoint);
}
goto LABEL_45;
}
}
if ( a1->m_isDraggingCamera )
{
*(float32x2_t *)&v10 = sub_1000229F0(&v31, (float32x2_t *)&a1->m_cameraTest, &v30);
v11 = (__int64 *)((__int64 (__fastcall *)(cocos2d::CCLayer *, double))a1->m_editorLayer->m_objectLayer->getPosition)(
a1->m_editorLayer->m_objectLayer,
v10);
sub_1000229B8((__int64 *)&v29, v11);
*(float32x2_t *)&v12 = sub_1000229DC(&v29, &v30, &v28);
((void (__fastcall *)(cocos2d::CCLayer *, float32x2_t *, double))a1->m_editorLayer->m_objectLayer->setPosition)(
a1->m_editorLayer->m_objectLayer,
&v28,
v12);
EditorUI::constrainGameLayerPosition(a1, -100.0, -100.0);
sub_1000229D0(&a1->m_cameraTest, (double *)&v31);
EditorUI::updateSlider(a1);
return;
}
if ( fabsf(cocos2d::ccpDistance((const cocos2d::CCPoint *)&v31, &a1->m_swipeStart)) >= 20.0 )
{
sub_1000229D0(&a1->m_cameraTest, (double *)&v31);
a1->m_isDraggingCamera = 1;
goto LABEL_45;
}
}
}