//
// cocos2d::CCTMXTiledMap::buildWithMapInfo from 0x5f84f4 to 0x5f8656 (354 bytes)
//
// 2 xrefs:
// > cocos2d::CCTMXTiledMap::initWithTMXFile @ 0x5f8686
// > cocos2d::CCTMXTiledMap::initWithXML @ 0x5f86f4
//
// 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 cocos2d::CCTMXTiledMap::buildWithMapInfo(cocos2d::CCTMXTiledMap *a1, cocos2d::CCTMXMapInfo *a2)
{
cocos2d::CCObject *m_uAutoReleaseCount; // r0
cocos2d::CCArray *v5; // r0
cocos2d::CCObject *m_eObjType; // r0
cocos2d::CCDictionary *v7; // r0
cocos2d::CCObject *m_uIndexInArray; // r0
cocos2d::CCDictionary *TileProperties; // r0
cocos2d::CCArray *v10; // r0
cocos2d::CCArray *v11; // r6
cocos2d::ccArray *data; // r2
cocos2d::CCObject **arr; // r6
int v14; // r8
cocos2d::CCObject **v15; // r7
int v16; // r1
int v17; // t1
cocos2d::CCTMXLayer *v18; // r0
int v19; // r2
int v20; // r3
cocos2d::CCTMXLayer *v21; // r11
int v22; // r11
const cocos2d::CCSize *v23; // r0
float width; // s15
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r3
float height; // s15
cocos2d::CCSize v27; // [sp+4h] [bp-10h] BYREF
cocos2d::CCSize::operator=((cocos2d::CCSize *)&a1[1], (float *)&a2[1].m_uID);
cocos2d::CCSize::operator=((cocos2d::CCSize *)&a1[1].m_nLuaID, (float *)&a2[1].m_nTag);
m_uAutoReleaseCount = (cocos2d::CCObject *)a1[1].m_uAutoReleaseCount;
a1[1].m_uReference = (unsigned int)a2[1].cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( m_uAutoReleaseCount )
cocos2d::CCObject::release(m_uAutoReleaseCount);
v5 = a2->getObjectGroups(a2);
a1[1].m_uAutoReleaseCount = (unsigned int)v5;
if ( v5 )
cocos2d::CCObject::retain(v5);
m_eObjType = (cocos2d::CCObject *)a1[1].m_eObjType;
if ( m_eObjType )
cocos2d::CCObject::release(m_eObjType);
v7 = a2->getProperties(a2);
a1[1].m_eObjType = (cocos2d::CCObjectType)v7;
if ( v7 )
cocos2d::CCObject::retain(v7);
m_uIndexInArray = (cocos2d::CCObject *)a1[1].m_uIndexInArray;
if ( m_uIndexInArray )
cocos2d::CCObject::release(m_uIndexInArray);
TileProperties = cocos2d::CCTMXMapInfo::getTileProperties(a2);
a1[1].m_uIndexInArray = (int)TileProperties;
if ( TileProperties )
cocos2d::CCObject::retain(TileProperties);
v10 = a2->getLayers(a2);
v11 = v10;
if ( v10 )
{
if ( cocos2d::CCArray::count(v10) )
{
data = v11->data;
if ( data->num )
{
arr = data->arr;
v14 = 0;
v15 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v15 )
{
v17 = (int)*arr++;
v16 = v17;
if ( !v17 )
break;
if ( *(_BYTE *)(v16 + 72) )
{
v18 = cocos2d::CCTMXTiledMap::parseLayer(a1, (cocos2d::CCTMXLayerInfo *)v16, a2);
v19 = v14;
v20 = v14++;
v21 = v18;
a1->addChild_1(a1, v18, v19, v20);
v22 = (int)v21->getContentSize(v21);
v23 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize(&v27, v23);
width = *(float *)v22;
setContentSize = a1->setContentSize;
if ( v27.width >= *(float *)v22 )
width = v27.width;
v27.width = width;
height = *(float *)(v22 + 4);
if ( v27.height >= height )
height = v27.height;
v27.height = height;
setContentSize(a1, &v27);
}
}
}
}
}
}