//
// cocos2d::CCTMXLayer::removeTileAt from 0x804af6 to 0x804ba8 (178 bytes)
//
// 1 xrefs:
// > cocos2d::CCTMXLayer::setTileGID @ 0x804be6
//
// 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::CCTMXLayer::removeTileAt(unsigned int **this, const cocos2d::CCPoint *a2)
{
cocos2d::CCArray **result; // r0
unsigned int v5; // r5
unsigned int v6; // r0
unsigned int v7; // r6
cocos2d::CCNode *v8; // r1
int v9; // r3
_DWORD *v10; // r2
int v11; // r3
cocos2d::CCArray ***v12; // r2
cocos2d::CCArray ***v13; // r3
cocos2d::CCArray **v14; // t1
cocos2d::CCArray *v15; // r1
result = (cocos2d::CCArray **)cocos2d::CCTMXLayer::tileGIDAt((cocos2d::CCTMXLayer *)this, a2);
if ( result )
{
v5 = (unsigned int)(float)(*(float *)a2 + (float)(*((float *)a2 + 1) * *((float *)this + 72)));
v6 = cocos2d::CCTMXLayer::atlasIndexForExistantZ((cocos2d::CCTMXLayer *)this, v5);
(*(this + 76))[v5] = 0;
v7 = v6;
cocos2d::ccCArrayRemoveValueAtIndex(*(this + 89), v6);
v8 = (cocos2d::CCNode *)((int (__fastcall *)(unsigned int **, unsigned int))(*this)[60])(this, v5);
if ( v8 )
{
return cocos2d::CCSpriteBatchNode::removeChild((cocos2d::CCArray **)this, v8, 1);
}
else
{
cocos2d::CCTextureAtlas::removeQuadAtIndex(*(this + 67), v7);
result = (cocos2d::CCArray **)*(this + 48);
if ( result )
{
result = (cocos2d::CCArray **)cocos2d::CCArray::count((cocos2d::CCArray *)result);
if ( result )
{
v9 = (int)*(this + 48);
if ( v9 )
{
v10 = *(_DWORD **)(v9 + 52);
if ( *v10 )
{
v11 = *v10 + 0x40000000;
v12 = (cocos2d::CCArray ***)v10[3];
v13 = &v12[v11 - 1];
while ( v12 <= v13 )
{
v14 = *v12++;
result = v14;
if ( !v14 )
break;
v15 = result[72];
if ( (unsigned int)v15 >= v7 )
result[72] = (cocos2d::CCArray *)((char *)v15 - 1);
}
}
}
}
}
}
}
return result;
}