//
// LevelEditorLayer::pasteGroupState from 0x1000f3d20 to 0x1000f3eba (410 bytes)
//
// 1 xrefs:
// > LevelEditorLayer::pasteAttributeState @ 0x1000f3c98
//
// 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 LevelEditorLayer::pasteGroupState(LevelEditorLayer *a1, GameObject *a2, cocos2d::CCArray *a3)
{
GameObject *m_copyStateObject; // r15
int v4; // r12d
__int64 GroupID; // r13
cocos2d::ccArray *data; // rax
__int64 num; // rcx
GameObject **arr; // rax
GameObject *v9; // r14
GameObject *v10; // r15
int v11; // r12d
__int64 v12; // r13
GameObject **v13; // [rsp+8h] [rbp-38h]
unsigned __int64 v14; // [rsp+10h] [rbp-30h]
m_copyStateObject = a1->m_copyStateObject;
if ( m_copyStateObject )
{
if ( a2 )
{
GJBaseGameLayer::removeFromGroups(a1, a2);
GameObject::resetGroups(a2);
GameObject::resetGroupDisabled(a2);
if ( m_copyStateObject->m_groupCount > 0 )
{
v4 = 0;
do
{
GroupID = (unsigned int)GameObject::getGroupID(m_copyStateObject, v4);
if ( ((unsigned int (__fastcall *)(GameObject *, __int64))a2->addToGroup)(a2, GroupID) == 1 )
((void (__fastcall *)(LevelEditorLayer *, GameObject *, _QWORD, __int64))a1->addToGroup)(
a1,
a2,
(unsigned int)GroupID,
1);
++v4;
}
while ( v4 < m_copyStateObject->m_groupCount );
}
}
else if ( a3 )
{
data = a3->data;
num = data->num;
if ( data->num )
{
arr = (GameObject **)data->arr;
v14 = (unsigned __int64)&arr[num - 1];
do
{
v9 = *arr;
if ( !*arr )
break;
v13 = arr;
v10 = a1->m_copyStateObject;
GJBaseGameLayer::removeFromGroups(a1, v9);
GameObject::resetGroups(v9);
GameObject::resetGroupDisabled(v9);
if ( v10->m_groupCount > 0 )
{
v11 = 0;
do
{
v12 = (unsigned int)GameObject::getGroupID(v10, v11);
if ( ((unsigned int (__fastcall *)(GameObject *, __int64))v9->addToGroup)(v9, v12) == 1 )
((void (__fastcall *)(LevelEditorLayer *, GameObject *, _QWORD, __int64))a1->addToGroup)(
a1,
v9,
(unsigned int)v12,
1);
++v11;
}
while ( v11 < v10->m_groupCount );
}
arr = v13 + 1;
}
while ( (unsigned __int64)(v13 + 1) <= v14 );
}
}
}
}