//
// LevelBrowserLayer::onFavorites from 0x6eca9c to 0x6ecbf0 (340 bytes)
//
// 3 xrefs:
// > ??> @ 0x76f08
// > LevelBrowserLayer::init @ 0x6ebf38
// > ??> @ 0x122bf68
//
// 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 LevelBrowserLayer::onFavorites(LevelBrowserLayer *a1, cocos2d::CCObject *a2)
{
SearchType v3; // w1
GJSearchObject *v4; // x21
GJSearchObject *m_searchObject; // x1
void *v6; // x0
cocos2d::CCDirector *v7; // x20
cocos2d::CCScene *v8; // x0
cocos2d::CCTransitionFade *v9; // x0
unsigned int *v10; // x2
int v11; // w1
__int64 v12; // [xsp+40h] [xbp+40h] BYREF
a1->setKeypadEnabled(a1, 0);
a1->setKeyboardEnabled(a1, 0);
v4 = (GJSearchObject *)GJSearchObject::create((GJSearchObject *)((char *)&qword_60 + 4), v3);
m_searchObject = a1->m_searchObject;
if ( m_searchObject )
{
v4->m_folder = m_searchObject->m_folder;
sub_D18D28(&v12, &m_searchObject->m_searchQuery);
sub_D18EA8(&v4->m_searchQuery, &v12);
v6 = (void *)(v12 - 24);
if ( (__int64 *)(v12 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v12 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
}
else
{
v11 = *(_DWORD *)(v12 - 8);
*(_DWORD *)(v12 - 8) = v11 - 1;
}
if ( v11 <= 0 )
operator delete(v6);
}
}
v7 = cocos2d::CCDirector::sharedDirector();
v8 = LevelBrowserLayer::scene(v4);
v9 = cocos2d::CCTransitionFade::create(0.5, v8);
cocos2d::CCDirector::replaceScene(v7, v9);
}