//
// cocos2d::CCTMXTiledMap::buildWithMapInfo from 0x8050dc to 0x80523e (354 bytes)
//
// 2 xrefs:
// > cocos2d::CCTMXTiledMap::initWithTMXFile @ 0x80526e
// > cocos2d::CCTMXTiledMap::initWithXML @ 0x8052dc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:01:23 +0000
//
cocos2d::CCArray *__fastcall cocos2d::CCTMXTiledMap::buildWithMapInfo(
cocos2d::CCTMXTiledMap *this,
cocos2d::CCTMXMapInfo *a2)
{
_DWORD *v4; // r0
int v5; // r0
_DWORD *v6; // r0
int v7; // r0
_DWORD *v8; // r0
int TileProperties; // r0
cocos2d::CCArray *result; // r0
cocos2d::CCArray *v11; // r6
_DWORD *v12; // r2
cocos2d::CCTMXLayerInfo **v13; // r6
int v14; // r8
cocos2d::CCTMXLayerInfo **v15; // r7
cocos2d::CCTMXLayerInfo *v16; // r1
cocos2d::CCTMXLayerInfo *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 v24; // s15
int (__fastcall *v25)(cocos2d::CCTMXTiledMap *, float *); // r3
float v26; // s15
float v27; // [sp+4h] [bp-10h] BYREF
float v28; // [sp+8h] [bp-Ch]
cocos2d::CCSize::operator=((float *)this + 66, (float *)a2 + 15);
cocos2d::CCSize::operator=((float *)this + 68, (float *)a2 + 17);
v4 = *((_DWORD **)this + 71);
*((_DWORD *)this + 70) = *((_DWORD *)a2 + 14);
if ( v4 )
cocos2d::CCObject::release(v4);
v5 = (*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)a2 + 56))(a2);
*((_DWORD *)this + 71) = v5;
if ( v5 )
cocos2d::CCObject::retain(v5);
v6 = *((_DWORD **)this + 72);
if ( v6 )
cocos2d::CCObject::release(v6);
v7 = (*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)a2 + 64))(a2);
*((_DWORD *)this + 72) = v7;
if ( v7 )
cocos2d::CCObject::retain(v7);
v8 = *((_DWORD **)this + 73);
if ( v8 )
cocos2d::CCObject::release(v8);
TileProperties = cocos2d::CCTMXMapInfo::getTileProperties(a2);
*((_DWORD *)this + 73) = TileProperties;
if ( TileProperties )
cocos2d::CCObject::retain(TileProperties);
result = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCTMXMapInfo *))(*(_DWORD *)a2 + 40))(a2);
v11 = result;
if ( result )
{
result = (cocos2d::CCArray *)cocos2d::CCArray::count(result);
if ( result )
{
v12 = *((_DWORD **)v11 + 13);
if ( *v12 )
{
v13 = (cocos2d::CCTMXLayerInfo **)v12[3];
v14 = 0;
v15 = &v13[*v12] + 0x3FFFFFFF;
while ( v13 <= v15 )
{
v17 = *v13++;
v16 = v17;
if ( !v17 )
break;
if ( *((_BYTE *)v16 + 80) )
{
v18 = cocos2d::CCTMXTiledMap::parseLayer(this, v16, a2);
v19 = v14;
v20 = v14++;
v21 = v18;
(*(void (__fastcall **)(cocos2d::CCTMXTiledMap *, cocos2d::CCTMXLayer *, int, int))(*(_DWORD *)this + 236))(
this,
v18,
v19,
v20);
v22 = (*(int (__fastcall **)(cocos2d::CCTMXLayer *))(*(_DWORD *)v21 + 164))(v21);
v23 = (const cocos2d::CCSize *)(*(int (__fastcall **)(cocos2d::CCTMXTiledMap *))(*(_DWORD *)this + 164))(this);
cocos2d::CCSize::CCSize(&v27, v23);
v24 = *(float *)v22;
v25 = *(int (__fastcall **)(cocos2d::CCTMXTiledMap *, float *))(*(_DWORD *)this + 160);
if ( v27 >= *(float *)v22 )
v24 = v27;
v27 = v24;
v26 = *(float *)(v22 + 4);
if ( v28 >= v26 )
v26 = v28;
v28 = v26;
result = (cocos2d::CCArray *)v25(this, &v27);
}
}
}
}
}
return result;
}