//
// cocos2d::CCTMXLayer::removeTileAt from 0x5f7f4e to 0x5f8000 (178 bytes)
//
// 1 xrefs:
// > cocos2d::CCTMXLayer::setTileGID @ 0x5f803e
//
// 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::CCTMXLayer::removeTileAt(cocos2d::CCTMXLayer *a1, const cocos2d::CCPoint *a2)
{
unsigned int v4; // r5
unsigned int v5; // r0
unsigned int v6; // r6
cocos2d::CCNode *v7; // r1
cocos2d::CCArray *m_pChildren; // r0
cocos2d::CCArray *v9; // r3
cocos2d::ccArray *data; // r2
int v11; // r3
cocos2d::CCObject **arr; // r2
cocos2d::CCObject **v13; // r3
int v14; // r0
int v15; // t1
unsigned int v16; // r1
if ( cocos2d::CCTMXLayer::tileGIDAt(a1, a2) )
{
v4 = (unsigned int)(float)(a2->x
+ (float)(a2->y
* *(float *)&a1[1].cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable));
v5 = cocos2d::CCTMXLayer::atlasIndexForExistantZ(a1, v4);
*(_DWORD *)(a1[1].m_uReference + 4 * v4) = 0;
v6 = v5;
cocos2d::ccCArrayRemoveValueAtIndex((unsigned int *)LODWORD(a1[1].m_fScaleX), v5);
v7 = a1->getChildByTag(a1, v4);
if ( v7 )
{
cocos2d::CCSpriteBatchNode::removeChild(a1, v7, 1);
}
else
{
cocos2d::CCTextureAtlas::removeQuadAtIndex(a1->m_pobTextureAtlas, v6);
m_pChildren = a1->m_pChildren;
if ( m_pChildren )
{
if ( cocos2d::CCArray::count(m_pChildren) )
{
v9 = a1->m_pChildren;
if ( v9 )
{
data = v9->data;
if ( data->num )
{
v11 = data->num + 0x40000000;
arr = data->arr;
v13 = &arr[v11 - 1];
while ( arr <= v13 )
{
v15 = (int)*arr++;
v14 = v15;
if ( !v15 )
break;
v16 = *(_DWORD *)(v14 + 288);
if ( v16 >= v6 )
*(_DWORD *)(v14 + 288) = v16 - 1;
}
}
}
}
}
}
}
}