//
// cocos2d::CCTMXTiledMap::buildWithMapInfo from 0xb3a72c to 0xb3a93c (528 bytes)
//
// 3 xrefs:
// > cocos2d::CCTMXTiledMap::initWithTMXFile @ 0xb3a98c
// > cocos2d::CCTMXTiledMap::initWithXML @ 0xb3aa74
// > ??> @ 0xa4ec8
//
// 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 *v4; // x0
cocos2d::CCArray *v5; // x0
cocos2d::CCObject *v6; // x0
cocos2d::CCDictionary *v7; // x0
cocos2d::CCObject *v8; // x0
cocos2d::CCDictionary *TileProperties; // x0
cocos2d::CCArray *v10; // x0
cocos2d::CCArray *v11; // x20
cocos2d::ccArray *data; // x0
cocos2d::CCObject **arr; // x20
cocos2d::CCObject **v14; // x22
cocos2d::CCObject *v15; // x1
int v16; // w25
cocos2d::CCTMXLayer *v17; // x26
__int64 v18; // x26
const cocos2d::CCSize *v19; // x0
float width; // s1
float height; // s0
cocos2d::CCTMXTiledMap_vtbl *v22; // x2
cocos2d::CCSize v23; // [xsp+50h] [xbp+50h] BYREF
cocos2d::CCSize::operator=(
(cocos2d::CCSize *)(&a1->m_bUnkBool2 + 3),
(float *)&a2[1].cocos2d::CCObject::cocos2d::CCCopying::__vftable + 1);
cocos2d::CCSize::operator=((cocos2d::CCSize *)((char *)&a1[1].__vftable + 4), (float *)&a2[1].m_nLuaID);
v4 = *(cocos2d::CCObject **)&a1[1].m_nTag;
a1[1].m_nLuaID = (int)a2[1].cocos2d::CCObject::cocos2d::CCCopying::__vftable;
if ( v4 )
cocos2d::CCObject::release(v4);
v5 = a2->getObjectGroups(a2);
*(_QWORD *)&a1[1].m_nTag = v5;
if ( v5 )
cocos2d::CCObject::retain(v5);
v6 = *(cocos2d::CCObject **)&a1[1].m_uAutoReleaseCount;
if ( v6 )
cocos2d::CCObject::release(v6);
v7 = a2->getProperties(a2);
*(_QWORD *)&a1[1].m_uAutoReleaseCount = v7;
if ( v7 )
cocos2d::CCObject::retain(v7);
v8 = *(cocos2d::CCObject **)&a1[1].m_uIndexInArray;
if ( v8 )
cocos2d::CCObject::release(v8);
TileProperties = cocos2d::CCTMXMapInfo::getTileProperties(a2);
*(_QWORD *)&a1[1].m_uIndexInArray = TileProperties;
if ( TileProperties )
cocos2d::CCObject::retain(TileProperties);
v10 = a2->getLayers(a2);
v11 = v10;
if ( v10 )
{
if ( (unsigned int)cocos2d::CCArray::count(v10) )
{
data = v11->data;
if ( data->num )
{
arr = data->arr;
v14 = &arr[data->num - 1];
if ( arr <= v14 )
{
v15 = *arr;
v16 = 0;
if ( *arr )
{
if ( LOBYTE(v15[1].m_uIndexInArray) )
goto LABEL_23;
while ( v14 >= ++arr )
{
v15 = *arr;
if ( !*arr )
break;
if ( LOBYTE(v15[1].m_uIndexInArray) )
{
LABEL_23:
v17 = cocos2d::CCTMXTiledMap::parseLayer(a1, (cocos2d::CCTMXLayerInfo *)v15, a2);
a1->addChild_1(a1, v17, v16, v16);
v18 = (__int64)v17->getContentSize(v17);
v19 = a1->getContentSize(a1);
cocos2d::CCSize::CCSize(&v23, v19);
width = *(float *)v18;
if ( v23.width >= *(float *)v18 )
width = v23.width;
height = *(float *)(v18 + 4);
v23.width = width;
if ( v23.height >= height )
height = v23.height;
v22 = a1->__vftable;
++v16;
v23.height = height;
v22->setContentSize(a1, &v23);
}
}
}
}
}
}
}
}