//
// EditorUI::ccTouchMoved from 0x6c1824 to 0x6c1d5c (1336 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'EditorUI::ccTouchMoved @ 0x6c1d60
// > ??> @ 0x7eb40
// > ??> @ 0x1156a28
//
// 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 EditorUI::ccTouchMoved(EditorUI *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)
{
int m_nId; // w3
LevelEditorLayer *m_editorLayer; // x4
GameManager *v8; // x0
unsigned int v9; // w21
unsigned int v10; // w1
GameObject *v11; // x24
float v12; // s0
float v13; // s1
void *m_scaleControl; // x21
void (__fastcall *v15)(void *, cocos2d::CCPoint *); // x23
__int64 v16; // x0
void *m_rotationControl; // x3
float v18; // s0
float v19; // s1
cocos2d::CCDirector *v20; // x0
float v21; // s0
const cocos2d::CCPoint *v22; // x0
float v23; // s0
float v24; // s1
GameObject *m_selectedObject; // x21
float v26; // s0
float v27; // s1
GJTransformControl *m_transformControl; // x21
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
__int64 v30; // x0
GameObject *m_snapObject; // x0
void (__fastcall *setObjectColor)(GameObject *__hidden, const cocos2d::ccColor3B *); // x2
cocos2d::CCPoint v33; // [xsp+58h] [xbp+58h] BYREF
cocos2d::CCPoint v34; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCPoint v35; // [xsp+68h] [xbp+68h] BYREF
cocos2d::CCPoint v36; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v37; // 0:kr08_8.8
cocos2d::CCPoint TouchPoint; // 0:kr10_8.8
cocos2d::CCPoint GridSnappedPos; // 0:kr18_8.8
cocos2d::CCPoint v40; // 0:s0.4,4:s1.4
cocos2d::CCPoint v41; // 0:s0.4,4:s1.4
cocos2d::CCPoint v42; // 0:s0.4,4:s1.4
cocos2d::CCPoint v43; // 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_21:
(*(void (__fastcall **)(void *, cocos2d::CCTouch *, cocos2d::CCEvent *))(*(_QWORD *)m_rotationControl + 888LL))(
m_rotationControl,
a2,
a3);
return;
}
if ( m_nId == a1->m_scaleTouchID )
{
cocos2d::CCNode::stopActionByTag(a1, 123);
m_rotationControl = a1->m_scaleControl;
goto LABEL_21;
}
if ( m_nId == a1->m_transformTouchID )
{
cocos2d::CCNode::stopActionByTag(a1, 123);
m_rotationControl = a1->m_transformControl;
goto LABEL_21;
}
m_editorLayer = a1->m_editorLayer;
if ( m_editorLayer->m_playbackMode == Playing )
{
((void (__fastcall *)(UILayer *))m_editorLayer->m_uiLayer->ccTouchMoved)(m_editorLayer->m_uiLayer);
return;
}
if ( m_nId == a1->m_touchID )
{
EditorUI::getTouchPoint(a1, a2, a3);
if ( a1->m_snapObjectExists )
{
if ( !a1->m_continueSwipe )
{
if ( fabsf(cocos2d::ccpDistance(&v33, &a1->m_swipeStart)) < 4.0 )
{
if ( !a1->m_continueSwipe )
goto LABEL_29;
}
else
{
a1->m_continueSwipe = 1;
}
}
v37 = cocos2d::CCNode::convertToNodeSpace(a1->m_editorLayer->m_objectLayer, &v33);
cocos2d::CCPoint::operator=(&v33, v37.x, v37.y);
if ( !(unsigned __int8)cocos2d::CCPoint::equals(&v33, &a1->m_cameraTest) )
{
if ( !a1->m_continuousSnap )
{
if ( a1->m_snapObject )
{
v8 = GameManager::sharedState();
if ( GameManager::getGameVariable(v8, "0008") && EditorUI::shouldSnap(a1, a1->m_snapObject) )
{
m_snapObject = a1->m_snapObject;
setObjectColor = m_snapObject->setObjectColor;
LOWORD(v36.x) = -25601;
BYTE2(v36.x) = 50;
setObjectColor(m_snapObject, (const cocos2d::ccColor3B *)&v36);
}
}
}
a1->m_continuousSnap = 1;
v9 = 0;
cocos2d::CCPoint::operator-(&v35, &v33, &a1->m_cameraTest);
if ( (unsigned int)cocos2d::CCArray::count(a1->m_selectedObjects) )
{
while ( v9 < (unsigned int)cocos2d::CCArray::count(a1->m_selectedObjects) )
{
v10 = v9++;
v11 = (GameObject *)cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, v10);
cocos2d::CCPoint::CCPoint(&v36, &v35);
EditorUI::moveObject(a1, v11, v40);
}
}
else
{
m_selectedObject = a1->m_selectedObject;
cocos2d::CCPoint::CCPoint(&v36, &v35);
EditorUI::moveObject(a1, m_selectedObject, v42);
}
cocos2d::CCPoint::operator=(&a1->m_cameraTest, v26, v27);
cocos2d::CCPoint::operator+(&v36, &a1->m_pivotPoint, &v35);
cocos2d::CCPoint::operator=(&a1->m_pivotPoint, v12, v13);
if ( a1->m_rotationControl->isVisible(a1->m_rotationControl) )
{
m_scaleControl = a1->m_rotationControl;
}
else
{
if ( !a1->m_scaleControl->isVisible(a1->m_scaleControl) )
{
if ( a1->m_transformControl->isVisible(a1->m_transformControl) )
{
m_transformControl = a1->m_transformControl;
setPosition = m_transformControl->setPosition;
v30 = (__int64)m_transformControl->getPosition(m_transformControl);
cocos2d::CCPoint::operator+(&v36, v30, &v35);
setPosition(m_transformControl, &v36);
GJTransformControl::refreshControl(a1->m_transformControl);
}
goto LABEL_29;
}
m_scaleControl = a1->m_scaleControl;
}
v15 = *(void (__fastcall **)(void *, cocos2d::CCPoint *))(*(_QWORD *)m_scaleControl + 184LL);
v16 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)m_scaleControl + 192LL))(m_scaleControl);
cocos2d::CCPoint::operator+(&v36, v16, &v35);
v15(m_scaleControl, &v36);
}
}
else
{
if ( a1->m_spaceSwiping
|| !a1->m_swipeEnabled
&& (v20 = cocos2d::CCDirector::sharedDirector(), !v20->getKeyboardDispatcher(v20)->m_bShiftPressed)
&& !a1->m_swipeModeTriggered )
{
if ( a1->m_isDraggingCamera )
{
cocos2d::CCPoint::operator-(&v34, &v33, &a1->m_cameraTest);
v22 = a1->m_editorLayer->m_objectLayer->getPosition(a1->m_editorLayer->m_objectLayer);
cocos2d::CCPoint::CCPoint(&v35, v22);
cocos2d::CCPoint::operator+(&v36, &v35, &v34);
a1->m_editorLayer->m_objectLayer->setPosition(a1->m_editorLayer->m_objectLayer, &v36);
EditorUI::constrainGameLayerPosition(a1);
cocos2d::CCPoint::operator=(&a1->m_cameraTest, v23, v24);
EditorUI::updateSlider(a1);
}
else
{
v21 = fabsf(cocos2d::ccpDistance(&v33, &a1->m_swipeStart));
if ( v21 >= 20.0 )
{
cocos2d::CCPoint::operator=(&a1->m_cameraTest, v21, 20.0);
a1->m_isDraggingCamera = 1;
cocos2d::CCNode::stopActionByTag(a1, 123);
}
}
return;
}
TouchPoint = EditorUI::getTouchPoint(a1, a2, a3);
if ( a1->m_selectedMode == 3 )
{
cocos2d::CCPoint::operator=(&a1->m_swipeEnd, TouchPoint.x, TouchPoint.y);
}
else
{
cocos2d::CCPoint::CCPoint(&v35, &v34);
GridSnappedPos = EditorUI::getGridSnappedPos(a1, v41);
cocos2d::CCPoint::operator=(&v34, GridSnappedPos.x, GridSnappedPos.y);
cocos2d::CCPoint::operator=(&a1->m_createPosition, v18, v19);
v43 = EditorUI::getTouchPoint(a1, a2, a3);
EditorUI::clickOnPosition(a1, v43);
}
}
LABEL_29:
cocos2d::CCNode::stopActionByTag(a1, 123);
}
}