//
// LevelEditorLayer::validGroup from 0x65d76c to 0x65d840 (212 bytes)
//
// 11 xrefs:
// > LevelEditorLayer::addObjectsAtPosition @ 0x65d8b8
// > LevelEditorLayer::addObjectsInRect @ 0x65da7c
// > LevelEditorLayer::typeExistsAtPosition @ 0x65dd08
// > LevelEditorLayer::objectAtPosition @ 0x65e1ac
// > LevelEditorLayer::objectsAtPosition @ 0x65e550
// > LevelEditorLayer::objectsInRect @ 0x65ea78
// > LevelEditorLayer::updateVisibility @ 0x663188
// > LevelEditorLayer::updateDebugDraw @ 0x684390
// > EditorUI::selectAll @ 0x6c3170
// > EditorUI::selectAllWithDirection @ 0x6c32b0
// > ??> @ 0x4add8
//
// 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
//
bool LevelEditorLayer::validGroup(LevelEditorLayer *a1, GameObject *a2, bool a3)
{
int m_editorLayer2; // w3
int m_editorLayer; // w1
int m_currentLayer; // w4
_BOOL4 v6; // w4
bool v7; // w5
std::uintptr_t *m_bitptr; // x6
m_editorLayer2 = a2->m_editorLayer2;
m_editorLayer = a2->m_editorLayer;
m_currentLayer = a1->m_currentLayer;
if ( !m_editorLayer2 )
m_editorLayer2 = -1;
v6 = m_currentLayer == -1 || m_editorLayer2 == m_currentLayer || m_editorLayer == m_currentLayer;
v7 = v6;
if ( a3 )
{
if ( m_editorLayer2 < 0 )
{
m_editorLayer2 = -1;
}
else if ( m_editorLayer2 > 9999 )
{
m_editorLayer2 = 9999;
}
v7 = 0;
if ( v6 )
{
m_bitptr = a1->m_lockedLayers.m_start.m_bitptr;
if ( m_editorLayer > 9999 )
m_editorLayer = 9999;
if ( m_editorLayer < 0 )
m_editorLayer = 0;
if ( ((1LL << (m_editorLayer & 0x3F)) & m_bitptr[(unsigned __int64)m_editorLayer >> 6]) == 0 )
return m_editorLayer2 == -1
|| ((1LL << (m_editorLayer2 & 0x3F)) & m_bitptr[(unsigned __int64)m_editorLayer2 >> 6]) == 0;
}
}
return v7;
}