// // LevelTools::sortChannelOrderObjects from 0x606400 to 0x606748 (840 bytes) // // 6 xrefs: // > LevelTools::sortSpeedObjects @ 0x6067a4 // > LevelTools::sortSpeedObjects @ 0x6068e0 // > LevelTools::sortSpeedObjects @ 0x606ad0 // > LevelEditorLayer::updateGameObjects @ 0x67b694 // > GJBaseGameLayer::orderSpawnObjects @ 0x869884 // > @ 0x9ab00 // // 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 LevelTools::sortChannelOrderObjects(cocos2d::CCArray *a1, cocos2d::CCDictionary *a2, bool a3) { cocos2d::CCDictionary *v5; // x22 cocos2d::ccArray *data; // x1 unsigned int v7; // w19 cocos2d::CCArray *v8; // x20 intptr_t v9; // x26 cocos2d::CCObject *v10; // x3 intptr_t v11; // x1 int v12; // w26 cocos2d::CCObject *v13; // x0 cocos2d::CCObject **arr; // x19 __int64 v15; // x0 char *v16; // x24 cocos2d::CCObject *v17; // x20 cocos2d::ccArray *v18; // x1 __int64 v19; // x0 cocos2d::CCObject *v20; // x25 intptr_t m_uAutoReleaseCount; // x27 cocos2d::CCArray *v22; // x20 unsigned int v23; // w19 unsigned int v24; // w1 __int64 v25; // x0 cocos2d::CCArray *v26; // x0 intptr_t m_unknown5; // x27 int ObjectDirection; // w28 __int64 v29; // x20 _BOOL4 v30; // [xsp+6Ch] [xbp+6Ch] v30 = a3; if ( !a1 ) return; v5 = cocos2d::CCDictionary::create(); data = a1->data; if ( !data->num || (arr = data->arr, v15 = 8LL * data->num - 8, v16 = (char *)arr + v15, arr > (cocos2d::CCObject **)((char *)arr + v15)) ) { if ( a2 ) goto LABEL_4; goto LABEL_39; } v17 = *arr; if ( !*arr ) { if ( a2 ) { do { LABEL_26: v20 = *arr; if ( !*arr ) break; m_uAutoReleaseCount = (int)v20[31].m_uAutoReleaseCount; v22 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a2, m_uAutoReleaseCount); if ( !v22 ) { v22 = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr); cocos2d::CCDictionary::setObject(a2, v22, m_uAutoReleaseCount); } ++arr; cocos2d::CCArray::addObject(v22, v20); } while ( v16 >= (char *)arr ); goto LABEL_4; } goto LABEL_39; } if ( HIDWORD(v17[18].__vftable) == 2900 ) goto LABEL_35; while ( v16 >= (char *)++arr ) { v17 = *arr; if ( !*arr ) break; if ( HIDWORD(v17[18].__vftable) == 2900 ) { LABEL_35: if ( LOBYTE(v17[32].m_uOrderOfArrival) ) { m_unknown5 = v17[32].m_unknown5; if ( !cocos2d::CCDictionary::objectForKey(v5, m_unknown5) ) { ObjectDirection = GameObject::getObjectDirection((GameObject *)v17); v29 = operator new(0x40u); cocos2d::CCObject::CCObject((cocos2d::CCObject *)v29); *(_DWORD *)(v29 + 56) = ObjectDirection; *(_QWORD *)v29 = &off_1148430; cocos2d::CCObject::autorelease((cocos2d::CCObject *)v29); cocos2d::CCDictionary::setObject(v5, (cocos2d::CCObject *)v29, m_unknown5); } } } } if ( !a2 ) LABEL_39: a2 = cocos2d::CCDictionary::create(); v18 = a1->data; if ( v18->num ) { arr = v18->arr; v19 = 8LL * v18->num - 8; v16 = (char *)arr + v19; if ( arr <= (cocos2d::CCObject **)((char *)arr + v19) ) goto LABEL_26; } LABEL_4: v7 = 0; v8 = cocos2d::CCDictionary::allKeys(a2); if ( (unsigned int)cocos2d::CCArray::count(v8) ) { do { v9 = *(int *)(cocos2d::CCArray::objectAtIndex(v8, v7) + 56); v10 = cocos2d::CCDictionary::objectForKey(v5, v9); v11 = v9; if ( v10 ) { v12 = (int)v10[1].__vftable; v13 = cocos2d::CCDictionary::objectForKey(a2, v11); switch ( v12 ) { case 2: ++v7; qsort( v13[1].~CCObject_0, (size_t)v13[1].copyWithZone, 8u, (int (*)(const void *, const void *))compOrderYInv); continue; case 3: ++v7; qsort( v13[1].~CCObject_0, (size_t)v13[1].copyWithZone, 8u, (int (*)(const void *, const void *))compOrderXInv); continue; case 1: ++v7; qsort(v13[1].~CCObject_0, (size_t)v13[1].copyWithZone, 8u, (int (*)(const void *, const void *))compOrderY); continue; } } else { v13 = cocos2d::CCDictionary::objectForKey(a2, v9); } ++v7; qsort(v13[1].~CCObject_0, (size_t)v13[1].copyWithZone, 8u, (int (*)(const void *, const void *))compOrder); } while ( v7 < (unsigned int)cocos2d::CCArray::count(v8) ); } if ( v30 ) { v23 = 0; cocos2d::CCArray::removeAllObjects(a1); LevelTools::moveTriggerObjectsToArray(a1, a2, 0); while ( v23 < (unsigned int)cocos2d::CCArray::count(v8) ) { v24 = v23++; v25 = cocos2d::CCArray::objectAtIndex(v8, v24); v26 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(a2, *(int *)(v25 + 56)); cocos2d::CCArray::addObjectsFromArray(a1, v26); } } }
GD Web Decomp Icon

GD Web Decomp

Raw Source