//
// cocos2d::CCTMXTiledMap::layerNamed from 0x100518ba0 to 0x100518c6d (205 bytes)
//
// 0 xrefs:
//
// 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
//
cocos2d::CCTMXLayer *__fastcall cocos2d::CCTMXTiledMap::layerNamed(cocos2d::CCTMXTiledMap *a1, const char *a2)
{
cocos2d::CCArray *m_pChildren; // rax
cocos2d::ccArray *data; // rax
const void **arr; // r13
const void **v5; // r14
void *v6; // rax
cocos2d::CCTMXLayer *v7; // r12
m_pChildren = a1->m_pChildren;
if ( m_pChildren )
{
data = m_pChildren->data;
if ( data->num )
{
arr = (const void **)data->arr;
v5 = &arr[data->num - 1];
do
{
if ( !*arr )
break;
v6 = __dynamic_cast(
*arr,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCTMXLayer,
0);
if ( v6 )
{
v7 = (cocos2d::CCTMXLayer *)v6;
if ( (*((_BYTE *)v6 + 408) & 1) != 0 )
{
if ( !strcmp(*((const char **)v6 + 53), a2) )
return v7;
}
else if ( !strcmp((const char *)v6 + 409, a2) )
{
return v7;
}
}
++arr;
}
while ( arr <= v5 );
}
}
return nullptr;
}