//
// GJBaseGameLayer::refreshKeyframeAnims from 0x1001e1f28 to 0x1001e20ec (452 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::updateSpecialGroupData @ 0x1001dfc14
// > LevelEditorLayer::init @ 0x100357740
//
// 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 GJBaseGameLayer::refreshKeyframeAnims(GJBaseGameLayer *a1)
{
cocos2d::CCDictionary *v2; // x20
cocos2d::CCArray *m_objects; // x8
cocos2d::ccArray *data; // x9
__int64 num; // x8
cocos2d::CCObject **arr; // x23
unsigned __int64 v7; // x24
cocos2d::CCObject *v8; // x21
cocos2d::CCObject *v9; // x22
cocos2d::CCArray *v10; // x21
__int64 v11; // x22
__int64 v12; // x0
cocos2d::CCObject *v13; // x24
__int64 v14; // x25
__int64 v15; // x0
cocos2d::CCDictionary::removeAllObjects(a1->m_keyframeGroups);
a1->m_keyframeGroup = 0;
v2 = cocos2d::CCDictionary::create();
m_objects = a1->m_objects;
if ( m_objects )
{
data = m_objects->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
v7 = (unsigned __int64)&arr[num - 1];
do
{
v8 = *arr;
if ( !*arr )
break;
if ( v8[18].m_uReference == 3032 )
{
v9 = cocos2d::CCDictionary::objectForKey(v2, (int)v8[33].m_uID);
if ( !v9 )
{
v9 = (cocos2d::CCObject *)sub_10024A15C(0);
((void (__fastcall *)(cocos2d::CCObject *, _QWORD))v9->setTag)(v9, v8[33].m_uID);
cocos2d::CCDictionary::setObject(v2, v9, (int)v8[33].m_uID);
}
sub_10024A2D0(v9, v8);
}
++arr;
}
while ( (unsigned __int64)arr <= v7 );
}
}
v10 = cocos2d::CCDictionary::allKeys(v2);
qsort(v10->data->arr, v10->data->num, 8u, (int (__cdecl *)(const void *, const void *))sub_1001D9B6C);
if ( (unsigned int)sub_10024A36C(v10) )
{
v11 = 0;
do
{
v12 = sub_10024A388(v10, v11);
v13 = cocos2d::CCDictionary::objectForKey(v2, *(int *)(v12 + 56));
qsort(
v13[1].~CCObject_0,
(size_t)v13[1].copyWithZone,
8u,
(int (__cdecl *)(const void *, const void *))sub_1001D9B54);
((void (__fastcall *)(cocos2d::CCObject *, _QWORD))v13->setTag)(v13, (unsigned int)a1->m_keyframeGroup);
cocos2d::CCDictionary::setObject(a1->m_keyframeGroups, v13, a1->m_keyframeGroup);
if ( (unsigned int)sub_10024A36C(v13) )
{
v14 = 0;
do
{
v15 = sub_10024A388(v13, v14);
*(_DWORD *)(v15 + 1856) = a1->m_keyframeGroup;
*(_DWORD *)(v15 + 1860) = v14;
v14 = (unsigned int)(v14 + 1);
}
while ( (unsigned int)v14 < (unsigned int)sub_10024A36C(v13) );
}
++a1->m_keyframeGroup;
v11 = (unsigned int)(v11 + 1);
}
while ( (unsigned int)v11 < (unsigned int)sub_10024A36C(v10) );
}
}