//
// EditorUI::createNewKeyframeAnim from 0x6befec to 0x6bf1fc (528 bytes)
//
// 2 xrefs:
// > SetGroupIDLayer::onAnim @ 0x974a10
// > ??> @ 0x7c050
//
// 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::createNewKeyframeAnim(EditorUI *a1)
{
GameObject *m_selectedObject; // x0
cocos2d::CCArray *v3; // x0
cocos2d::CCArray *v4; // x20
GameObject *v5; // x1
cocos2d::CCArray *v6; // x0
cocos2d::CCArray *v7; // x25
cocos2d::ccArray *data; // x0
cocos2d::CCObject **arr; // x22
__int64 v10; // x20
char *v11; // x26
cocos2d::CCObject *i; // x21
cocos2d::CCObject *v13; // x0
cocos2d::CCObject_vtbl *v14; // x0
void (__fastcall *v15)(cocos2d::CCObject *__hidden); // x28
__int64 v16; // x27
int v17; // w27
const cocos2d::CCPoint *v18; // x0
KeyframeGameObject *Object; // x20
cocos2d::CCArray *NewKeyframeAnim; // x0
LevelEditorLayer *m_editorLayer; // x0
unsigned __int64 v22; // [xsp+68h] [xbp+68h]
cocos2d::CCPoint v23; // [xsp+70h] [xbp+70h] BYREF
cocos2d::CCPoint v24; // 0:s0.4,4:s1.4
m_selectedObject = a1->m_selectedObject;
if ( m_selectedObject
|| (m_selectedObject = (GameObject *)cocos2d::CCArray::count(a1->m_selectedObjects), (_DWORD)m_selectedObject) )
{
v3 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)m_selectedObject);
v4 = v3;
v5 = a1->m_selectedObject;
if ( v5 )
cocos2d::CCArray::addObject(v3, v5);
else
cocos2d::CCArray::addObjectsFromArray(v3, a1->m_selectedObjects);
EditorUI::deselectAll(a1);
v6 = (cocos2d::CCArray *)((__int64 (__fastcall *)(LevelEditorLayer *, float))a1->m_editorLayer->updateVisibility)(
a1->m_editorLayer,
0.0);
v7 = (cocos2d::CCArray *)cocos2d::CCArray::create(v6);
if ( v4 )
{
data = v4->data;
if ( data->num )
{
arr = data->arr;
v10 = 8LL * data->num - 8;
v11 = (char *)arr + v10;
if ( arr <= (cocos2d::CCObject **)((char *)arr + v10) )
{
for ( i = *arr; *arr; i = *arr )
{
if ( BYTE2(i[20].m_uIndexInArray) )
{
v13 = cocos2d::CCDictionary::objectForKey(a1->m_editorLayer->m_parentGroupIDs, HIDWORD(i[16].__vftable));
if ( v13 )
{
v14 = v13[1].__vftable;
if ( LODWORD(v14->copyWithZone) )
{
v15 = v14->~CCObject_0;
v16 = 8LL * LODWORD(v14->copyWithZone) - 8;
v22 = (unsigned __int64)v15 + v16;
while ( v22 >= (unsigned __int64)v15 )
{
if ( !*(_QWORD *)v15 )
break;
v17 = *(_DWORD *)(*(_QWORD *)v15 + 56LL);
v15 = (void (__fastcall *)(cocos2d::CCObject *__hidden))((char *)v15 + 8);
v18 = (const cocos2d::CCPoint *)((__int64 (__fastcall *)(cocos2d::CCObject *))i->__vftable[2].acceptVisitor)(i);
cocos2d::CCPoint::CCPoint(&v23, v18);
Object = (KeyframeGameObject *)EditorUI::createObject(a1, 3032, v24);
LevelEditorLayer::removeSpecial(a1->m_editorLayer, Object);
cocos2d::CCArray::addObject(v7, Object);
EffectGameObject::setTargetID(Object, v17);
KeyframeGameObject::updateShadowObjects(Object, a1->m_editorLayer, a1);
NewKeyframeAnim = GJBaseGameLayer::createNewKeyframeAnim(a1->m_editorLayer);
Object->m_keyframeGroup = NewKeyframeAnim->getTag(NewKeyframeAnim);
m_editorLayer = a1->m_editorLayer;
Object->m_keyframeIndex = 0;
LevelEditorLayer::addSpecial(m_editorLayer, Object);
}
}
}
}
if ( v11 < (char *)++arr )
break;
}
}
}
}
EditorUI::selectObjects(a1, v7, 0);
}
}