//
// EditorUI::selectAllWithDirection from 0x1401c8010 to 0x1401c81c8 (440 bytes)
//
// 5 xrefs:
// > EditorCommandsPopup::onCommand @ 0x14017dc40
// > EditorCommandsPopup::onCommand @ 0x14017dc58
// > EditorUI::handleEditorAction @ 0x1401c34e3
// > EditorUI::handleEditorAction @ 0x1401c34fc
// > ??> @ 0x14091a7f8
//
// This function is hookable on this platform (idp: pc, 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:28:06 +0000
//
__int64 __fastcall EditorUI::selectAllWithDirection(__int64 a1, char a2)
{
cocos2d::CCArray *v4; // rbp
__int64 v5; // rax
__int64 v6; // rbx
__int64 v7; // rax
__int64 v8; // rcx
unsigned int v9; // edi
cocos2d::CCArray *v10; // r14
struct cocos2d::CCObject *v11; // rbx
int v12; // edx
int v13; // eax
float *v14; // rax
__int64 v15; // rcx
__int64 v16; // rcx
float v18; // [rsp+60h] [rbp+8h] BYREF
float v19; // [rsp+64h] [rbp+Ch]
float v20; // [rsp+70h] [rbp+18h] BYREF
char v21; // [rsp+78h] [rbp+20h] BYREF
v4 = *(cocos2d::CCArray **)(*(_QWORD *)(a1 + 1512) + 3536LL);
v5 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v5, &v18);
v6 = *(_QWORD *)(*(_QWORD *)(a1 + 1512) + 4296LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v21,
v18 * 0.5,
(float)(*(float *)(a1 + 904) * 0.5) + (float)(v19 * 0.5));
cocos2d::CCNode::convertToNodeSpace(v6, &v20, v7);
v9 = 0;
v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(v8);
if ( cocos2d::CCArray::count(v4) )
{
while ( 1 )
{
v11 = cocos2d::CCArray::objectAtIndex(v4, v9);
v12 = *((__int16 *)v11 + 606);
v13 = *(__int16 *)(*(_QWORD *)(a1 + 1512) + 14866LL);
if ( !*((_WORD *)v11 + 606) )
v12 = -1;
if ( (_WORD)v13 != 0xFFFF && (_WORD)v13 != *((_WORD *)v11 + 605) && v13 != v12 )
goto LABEL_12;
v14 = (float *)(*(__int64 (__fastcall **)(struct cocos2d::CCObject *))(*(_QWORD *)v11 + 200LL))(v11);
if ( a2 )
break;
if ( *v14 > v20 )
goto LABEL_11;
LABEL_12:
if ( ++v9 >= cocos2d::CCArray::count(v4) )
goto LABEL_13;
}
if ( v20 <= *v14 )
goto LABEL_12;
LABEL_11:
cocos2d::CCArray::addObject(v10, v11);
goto LABEL_12;
}
LABEL_13:
EditorUI::processSelectObjects(a1, v10);
v15 = *(_QWORD *)(a1 + 808);
*(_DWORD *)(a1 + 744) = -1;
if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v15 + 344LL))(v15) )
{
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 808) + 336LL))(*(_QWORD *)(a1 + 808), 0);
GJRotationControl::finishTouch(*(_QWORD *)(a1 + 808));
v16 = *(_QWORD *)(*(_QWORD *)(a1 + 808) + 464LL);
if ( v16 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v16 + 1032LL))(v16, 0);
}
EditorUI::deactivateScaleControl(a1);
return EditorUI::deactivateTransformControl(a1);
}