//
// cocos2d::CCTMXLayer::removeTileAt from 0x1800b03e0 to 0x1800b0531 (337 bytes)
//
// 6 xrefs:
// > cocos2d::CCTMXLayer::setTileGID @ 0x1800b06ce
// > ??> @ 0x18014982c
// > ??> @ 0x180149840
// > ??> @ 0x180149850
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c2454
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 11:22:19 +0000
//
void __fastcall cocos2d::CCTMXLayer::removeTileAt(cocos2d::CCTMXLayer *this, const struct cocos2d::CCPoint *a2)
{
float v3; // xmm0_4
const void **v4; // rdx
unsigned __int64 v5; // rsi
struct cocos2d::CCNode *v6; // rax
cocos2d::CCArray *v7; // rcx
__int64 v8; // rax
unsigned int *v9; // rcx
__int64 v10; // rax
__int64 *v11; // rcx
__int64 *i; // r8
__int64 v13; // rdx
unsigned int v14; // eax
int Key; // [rsp+40h] [rbp+8h] BYREF
v3 = (float)(*((float *)this + 90) * *((float *)a2 + 1)) + *(float *)a2;
if ( (*(_DWORD *)(*((_QWORD *)this + 47) + 4LL * (int)v3) & 0x1FFFFFFF) != 0 )
{
v4 = *((const void ***)this + 59);
Key = (int)v3;
v5 = ((unsigned __int64)bsearch(
&Key,
v4[2],
*(unsigned int *)v4,
8u,
(_CoreCrtNonSecureSearchSortCompareFunction)CompareFunction)
- *(_QWORD *)(*((_QWORD *)this + 59) + 16LL)) >> 3;
*(_DWORD *)(*((_QWORD *)this + 47) + 4LL * (unsigned int)(int)v3) = 0;
sub_1800A2010(*((_QWORD *)this + 59), (unsigned int)v5);
v6 = (struct cocos2d::CCNode *)(*(__int64 (__fastcall **)(cocos2d::CCTMXLayer *, _QWORD))(*(_QWORD *)this + 472LL))(
this,
(unsigned int)(int)v3);
if ( v6 )
{
cocos2d::CCSpriteBatchNode::removeChild(this, v6, 1);
}
else
{
cocos2d::CCTextureAtlas::removeQuadAtIndex(*((cocos2d::CCTextureAtlas **)this + 41), v5);
v7 = *((cocos2d::CCArray **)this + 26);
if ( v7 )
{
if ( (unsigned int)cocos2d::CCArray::count(v7) )
{
v8 = *((_QWORD *)this + 26);
if ( v8 )
{
v9 = *(unsigned int **)(v8 + 56);
v10 = *v9;
if ( (_DWORD)v10 )
{
v11 = *((__int64 **)v9 + 2);
for ( i = &v11[v10 - 1]; v11 <= i; ++v11 )
{
v13 = *v11;
if ( !*v11 )
break;
v14 = *(_DWORD *)(v13 + 360);
if ( v14 >= (unsigned int)v5 )
*(_DWORD *)(v13 + 360) = v14 - 1;
}
}
}
}
}
}
}
}