//
// EditorUI::moveObject from 0x14011fcb0 to 0x140120106 (1110 bytes)
//
// 17 xrefs:
// > EditorUI::repositionObjectsToCenter @ 0x140114337
// > EditorUI::moveObjectCall_1 @ 0x14011fadb
// > EditorUI::moveObjectCall_1 @ 0x14011fbf9
// > EditorUI::transformObject @ 0x140120c43
// > EditorUI::flipObjectsX @ 0x140120e0e
// > EditorUI::flipObjectsY @ 0x140120fee
// > EditorUI::rotateObjects @ 0x1401213ce
// > EditorUI::scaleObjects @ 0x1401217a5
// > EditorUI::transformObjects @ 0x140121e49
// > EditorUI::alignObjects @ 0x140122376
// > EditorUI::alignObjects @ 0x1401223d9
// > EditorUI::ccTouchMoved @ 0x140124179
// > EditorUI::ccTouchMoved @ 0x1401241ae
// > EditorUI::ccTouchEnded @ 0x140124aae
// > ??> @ 0x14066ffdc
// > ??> @ 0x140670010
// > ??> @ 0x1406c95c4
//
// 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::moveObject(EditorUI *a1, GameObject *a2, cocos2d::CCPoint a3)
{
const cocos2d::CCPoint *v5; // rax
float v6; // xmm2_4
LevelEditorLayer *m_editorLayer; // rax
LevelSettingsObject *m_levelSettings; // rcx
int v9; // eax
LevelEditorLayer *v10; // rbx
int m_objectID; // edx
bool v12; // zf
char v13; // r14
GameObject *v14; // rsi
LevelEditorLayer *v15; // rbx
int v16; // ecx
LevelEditorLayer *v17; // rdx
int v18; // ecx
int v19; // ecx
int v20; // ecx
int v21; // ecx
int v22; // ecx
int v23; // ecx
int v24; // ecx
int v25; // ecx
int v26; // ecx
int v27; // ecx
int v28; // ecx
int v29; // ecx
struct cocos2d::CCPoint v30; // [rsp+48h] [rbp+10h] BYREF
cocos2d::CCPoint v31; // [rsp+58h] [rbp+20h] BYREF
if ( !a2 )
return;
v5 = a2->getPosition_0(a2);
cocos2d::CCPoint::operator+(v5, &v30);
v6 = fmaxf(-3000.0, v30.y);
m_editorLayer = a1->m_editorLayer;
v30.y = v6;
v30.x = fminf(240000.0, fmaxf(-3000.0, v30.x));
m_levelSettings = m_editorLayer->m_levelSettings;
v9 = 80;
if ( m_levelSettings->m_dynamicLevelHeight )
v9 = 1000;
v30.y = fminf((float)((float)v9 * 30.0) + 90.0, v6);
cocos2d::CCPoint::CCPoint(&v31, &v30);
a2->setPosition_0(a2, &v31);
a2->updateStartValues(a2);
v10 = a1->m_editorLayer;
GJBaseGameLayer::removeObjectFromSection(v10, a2);
v10->addToSection(v10, a2);
m_objectID = a2->m_objectID;
if ( m_objectID > 1934 )
{
if ( m_objectID == 1935 || m_objectID == 2900 || m_objectID == 2902 || m_objectID == 3022 )
goto LABEL_20;
v12 = m_objectID == 3027;
goto LABEL_18;
}
if ( m_objectID == 1934 )
{
LABEL_20:
v13 = 1;
goto LABEL_21;
}
if ( m_objectID > 203 )
{
if ( m_objectID != 1334 )
{
v12 = m_objectID == 1917;
goto LABEL_18;
}
goto LABEL_20;
}
if ( m_objectID == 203 || m_objectID == 200 || m_objectID == 201 )
goto LABEL_20;
v12 = m_objectID == 202;
LABEL_18:
if ( v12 )
goto LABEL_20;
v13 = 0;
LABEL_21:
if ( m_objectID == 747 )
{
v14 = *(GameObject **)&a2[1].m_sQuad.bl.texCoords.v;
if ( v14 )
{
v15 = a1->m_editorLayer;
GJBaseGameLayer::removeObjectFromSection(v15, *(GameObject **)&a2[1].m_sQuad.bl.texCoords.v);
v15->addToSection(v15, v14);
}
}
v16 = a2->m_objectID;
v17 = a1->m_editorLayer;
if ( v16 <= 744 )
{
if ( v16 != 744 )
{
switch ( v16 )
{
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
case 31:
case 32:
case 33:
case 55:
case 56:
case 57:
case 58:
case 59:
goto LABEL_61;
case 29:
case 30:
case 105:
goto LABEL_39;
default:
goto LABEL_62;
}
goto LABEL_62;
}
goto LABEL_39;
}
if ( v16 > 2899 )
{
if ( v16 <= 3643 )
{
if ( v16 != 3643 )
{
switch ( v16 )
{
case 2903:
case 2904:
case 2905:
case 2907:
case 2909:
case 2910:
case 2911:
case 2912:
case 2913:
case 2914:
case 2915:
case 2916:
case 2917:
case 2919:
case 2920:
case 2921:
case 2922:
case 2923:
case 2924:
case 3006:
case 3007:
case 3008:
case 3009:
case 3010:
case 3016:
case 3017:
case 3018:
case 3019:
case 3020:
case 3021:
case 3022:
case 3023:
case 3024:
goto LABEL_61;
default:
goto LABEL_62;
}
goto LABEL_62;
}
goto LABEL_61;
}
if ( v16 != 3660 )
goto LABEL_62;
LABEL_61:
v17->m_drawGridLayer->m_sortEffects = 1;
goto LABEL_62;
}
if ( v16 == 2899 )
goto LABEL_61;
if ( v16 > 1594 )
{
if ( v16 <= 1819 )
{
if ( v16 != 1819 )
{
v24 = v16 - 1612;
if ( v24 )
{
v25 = v24 - 1;
if ( v25 )
{
v26 = v25 - 201;
if ( v26 )
{
if ( v26 != 4 )
goto LABEL_62;
}
}
}
}
goto LABEL_61;
}
v27 = v16 - 1912;
if ( v27 )
{
v28 = v27 - 3;
if ( !v28 )
goto LABEL_61;
v29 = v28 - 152;
if ( !v29 )
goto LABEL_61;
if ( v29 != 1 )
goto LABEL_62;
}
LABEL_56:
v17->m_spawnTriggersChanged = 1;
goto LABEL_61;
}
if ( v16 == 1594 )
goto LABEL_61;
if ( v16 > 1007 )
{
v22 = v16 - 1049;
if ( !v22 )
goto LABEL_61;
v23 = v22 - 219;
if ( v23 )
{
if ( (unsigned int)(v23 - 78) >= 2 )
goto LABEL_62;
goto LABEL_61;
}
goto LABEL_56;
}
if ( v16 == 1007 )
{
v17->m_alphaTriggersChanged = 1;
goto LABEL_61;
}
v18 = v16 - 899;
if ( !v18 )
goto LABEL_39;
v19 = v18 - 1;
if ( !v19 )
goto LABEL_39;
v20 = v19 - 1;
if ( !v20 )
goto LABEL_61;
v21 = v20 - 14;
if ( !v21 )
{
LABEL_39:
v17->m_colorTriggersChanged = 1;
goto LABEL_61;
}
if ( v21 == 91 )
{
v17->m_pulseTriggersChanged = 1;
goto LABEL_61;
}
LABEL_62:
if ( a2->m_isSpawnOrderTrigger )
v17->m_spawnOrderObjectsChanged = 1;
if ( a2->m_dontIgnoreDuration )
cocos2d::CCPoint::operator=(&a2[1].m_obUnflippedOffsetPositionFromCenter.y, &dword_1406C2128);
if ( v13 || ((unsigned __int8 (__fastcall *)(GameObject *, LevelEditorLayer *))a2->canReverse)(a2, v17) )
a1->m_speedObjectsUpdated = 1;
}