//
// cocos2d::CCTMXLayer::setupTiles from 0x1800ad270 to 0x1800ad3c5 (341 bytes)
//
// 6 xrefs:
// > cocos2d::CCTMXTiledMap::buildWithMapInfo @ 0x1800adf9c
// > cocos2d::CCTMXTiledMap::parseLayer @ 0x1800ae49d
// > ??> @ 0x180140610
// > ??> @ 0x180140620
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b825c
//
// 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 __fastcall cocos2d::CCTMXLayer::setupTiles(cocos2d::CCTMXLayer *this)
{
cocos2d::CCTexture2D *v2; // rax
struct cocos2d::CCSize *ContentSizeInPixels; // rax
cocos2d::CCTexture2D *v4; // rax
int v5; // ebp
float v6; // xmm6_4
float v7; // xmm2_4
int v8; // edi
float v9; // xmm1_4
unsigned int v10; // esi
struct cocos2d::CCPoint *v11; // rax
unsigned int v12; // eax
float v13; // [rsp+50h] [rbp+8h] BYREF
v2 = (cocos2d::CCTexture2D *)((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pobTextureAtlas->getTexture)(this->m_pobTextureAtlas);
ContentSizeInPixels = (struct cocos2d::CCSize *)cocos2d::CCTexture2D::getContentSizeInPixels(v2);
cocos2d::CCSize::operator=((_DWORD *)(*((_QWORD *)this + 48) + 144LL), ContentSizeInPixels);
v4 = (cocos2d::CCTexture2D *)((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pobTextureAtlas->getTexture)(this->m_pobTextureAtlas);
cocos2d::CCTexture2D::setAliasTexParameters(v4);
cocos2d::CCTMXLayer::parseInternalProperties(this);
v5 = 0;
if ( *((float *)this + 91) > 0.0 )
{
v6 = 0.0;
do
{
v7 = *((float *)this + 90);
v8 = 0;
if ( v7 > 0.0 )
{
v9 = 0.0;
do
{
v10 = *(_DWORD *)(*((_QWORD *)this + 47) + 4LL * (unsigned int)(int)(float)((float)(v6 * v7) + v9));
if ( v10 )
{
v11 = (struct cocos2d::CCPoint *)kmVec2Fill(&v13, v9, v6);
cocos2d::CCTMXLayer::appendTileForGID(this, v10, v11);
v12 = v10;
if ( v10 >= *((_DWORD *)this + 111) )
v12 = *((_DWORD *)this + 111);
*((_DWORD *)this + 111) = v12;
if ( v10 <= *((_DWORD *)this + 112) )
v10 = *((_DWORD *)this + 112);
*((_DWORD *)this + 112) = v10;
}
v7 = *((float *)this + 90);
v9 = (float)++v8;
}
while ( v7 > (float)v8 );
}
v6 = (float)++v5;
}
while ( *((float *)this + 91) > (float)v5 );
}
}