//
// cocos2d::CCTileMapAtlas::updateAtlasValueAt from 0x1800ab5d0 to 0x1800ab8b5 (741 bytes)
//
// 4 xrefs:
// > cocos2d::CCTileMapAtlas::setTile @ 0x1800ab55c
// > cocos2d::CCTileMapAtlas::updateAtlasValues @ 0x1800ab993
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b807c
//
// 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::CCTileMapAtlas::updateAtlasValueAt(
cocos2d::CCTileMapAtlas *this,
const struct cocos2d::CCPoint *a2,
const struct cocos2d::_ccColor3B *a3,
unsigned int a4)
{
__int64 v7; // r15
__int64 v8; // rax
int x; // esi
__int64 v10; // r14
int y; // ebp
__int64 v12; // rax
float v13; // xmm6_4
__int64 v14; // rax
float v15; // xmm7_4
cocos2d::CCDirector *v16; // rax
float v17; // xmm8_4
cocos2d::CCDirector *v18; // rax
float v19; // xmm2_4
float v20; // xmm1_4
float v21; // xmm0_4
float v22; // xmm8_4
float v23; // xmm2_4
signed int v24; // eax
signed int v25; // eax
signed int v26; // eax
signed int v27; // ecx
unsigned int v28; // eax
int v29; // [rsp+98h] [rbp+20h]
v7 = a4;
((void (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pTextureAtlas->getCapacity)(this->m_pTextureAtlas);
v8 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pTextureAtlas->getQuads)(this->m_pTextureAtlas);
x = (int)a2->x;
v10 = v8 + 96 * v7;
y = (int)a2->y;
LODWORD(a2) = a3->r;
LODWORD(a3) = this->m_uItemsPerRow;
v12 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pTextureAtlas->getTexture)(this->m_pTextureAtlas);
v13 = (float)(*(int (__fastcall **)(__int64))(*(_QWORD *)v12 + 80LL))(v12);
v14 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pTextureAtlas->getTexture)(this->m_pTextureAtlas);
v15 = (float)(*(int (__fastcall **)(__int64))(*(_QWORD *)v14 + 88LL))(v14);
v16 = cocos2d::CCDirector::sharedDirector();
v17 = cocos2d::CCDirector::getContentScaleFactor(v16) * (float)(int)this->m_uItemWidth;
v18 = cocos2d::CCDirector::sharedDirector();
v19 = cocos2d::CCDirector::getContentScaleFactor(v18) * (float)(int)this->m_uItemHeight;
v20 = (float)((float)(int)((unsigned int)a2 % (unsigned int)a3) * v17) / v13;
v21 = (float)((float)(int)((unsigned int)a2 / (unsigned int)a3) * v19) / v15;
v22 = (float)(v17 / v13) + v20;
*(float *)(v10 + 16) = v20;
v23 = (float)(v19 / v15) + v21;
*(float *)(v10 + 20) = v21;
*(float *)(v10 + 68) = v21;
*(float *)(v10 + 40) = v20;
*(float *)(v10 + 64) = v22;
*(float *)(v10 + 44) = v23;
*(float *)(v10 + 92) = v23;
*(float *)(v10 + 88) = v22;
*(float *)(v10 + 24) = (float)(this->m_uItemWidth * x);
v24 = this->m_uItemHeight * y;
*(_DWORD *)(v10 + 32) = 0;
*(float *)(v10 + 28) = (float)v24;
*(float *)(v10 + 72) = (float)(this->m_uItemWidth * (x + 1));
v25 = this->m_uItemHeight * y;
*(_DWORD *)(v10 + 80) = 0;
*(float *)(v10 + 76) = (float)v25;
*(float *)v10 = (float)(this->m_uItemWidth * x);
v26 = this->m_uItemHeight * (y + 1);
*(_DWORD *)(v10 + 8) = 0;
*(float *)(v10 + 4) = (float)v26;
*(float *)(v10 + 48) = (float)(this->m_uItemWidth * (x + 1));
v27 = this->m_uItemHeight * (y + 1);
*(_DWORD *)(v10 + 56) = 0;
*(float *)(v10 + 52) = (float)v27;
*(cocos2d::ccColor3B *)&v29 = this->_displayedColor;
HIBYTE(v29) = this->_displayedOpacity;
*(_DWORD *)(v10 + 60) = v29;
*(_DWORD *)(v10 + 12) = v29;
*(_DWORD *)(v10 + 84) = v29;
*(_DWORD *)(v10 + 36) = v29;
this->m_pTextureAtlas->m_bDirty = 1;
v28 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pTextureAtlas->getTotalQuads)(this->m_pTextureAtlas);
if ( (int)v7 + 1 > v28 )
cocos2d::CCTextureAtlas::increaseTotalQuadsWith(this->m_pTextureAtlas, v7 - v28 + 1);
}