//
// cocos2d::CCTileMapAtlas::updateAtlasValueAt from 0xb3e178 to 0xb3e3f0 (632 bytes)
//
// 3 xrefs:
// > cocos2d::CCTileMapAtlas::setTile @ 0xb3e4fc
// > cocos2d::CCTileMapAtlas::updateAtlasValues @ 0xb3e634
// > ??> @ 0x69798
//
// 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::CCTileMapAtlas::updateAtlasValueAt(
cocos2d::CCTileMapAtlas *a1,
const cocos2d::CCPoint *a2,
const cocos2d::ccColor3B *a3,
unsigned int a4)
{
cocos2d::ccV3F_C4B_T2F_Quad *v6; // x26
unsigned int r; // w27
int x; // w23
unsigned int m_uItemsPerRow; // w21
int y; // w24
cocos2d::ccV3F_C4B_T2F_Quad *v11; // x19
cocos2d::CCTexture2D *v12; // x0
unsigned int v13; // w22
float v14; // s10
cocos2d::CCTexture2D *v15; // x0
float v16; // s11
float m_uItemWidth; // s8
cocos2d::CCDirector *v18; // x0
float v19; // s8
float m_uItemHeight; // s9
cocos2d::CCDirector *v21; // x0
float ContentScaleFactor; // s0
unsigned int v23; // w1
float v24; // s0
unsigned int v25; // w2
float v26; // s7
GLfloat v27; // s3
GLfloat v28; // s0
GLfloat v29; // s2
GLfloat v30; // s1
GLfloat v31; // s7
GLfloat v32; // s5
GLubyte v33; // w3
GLubyte displayedOpacity; // w0
cocos2d::CCTextureAtlas *m_pTextureAtlas; // x0
cocos2d::CCTextureAtlas_vtbl *v36; // x2
unsigned int v37; // w1
a1->m_pTextureAtlas->getCapacity(a1->m_pTextureAtlas);
v6 = a1->m_pTextureAtlas->getQuads(a1->m_pTextureAtlas);
r = a3->r;
x = (int)a2->x;
m_uItemsPerRow = a1->m_uItemsPerRow;
y = (int)a2->y;
v11 = &v6[a4];
v12 = a1->m_pTextureAtlas->getTexture(a1->m_pTextureAtlas);
v13 = a4 + 1;
v14 = (float)v12->getPixelsWide(v12);
v15 = a1->m_pTextureAtlas->getTexture(a1->m_pTextureAtlas);
v16 = (float)v15->getPixelsHigh(v15);
m_uItemWidth = (float)a1->m_uItemWidth;
v18 = cocos2d::CCDirector::sharedDirector();
v19 = m_uItemWidth * cocos2d::CCDirector::getContentScaleFactor(v18);
m_uItemHeight = (float)a1->m_uItemHeight;
v21 = cocos2d::CCDirector::sharedDirector();
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v21);
v23 = a1->m_uItemHeight;
v24 = m_uItemHeight * ContentScaleFactor;
v25 = a1->m_uItemWidth;
v26 = v24 / v16;
v11->bl.vertices.y = (float)(y * v23);
v11->br.vertices.y = (float)(y * v23);
v27 = (float)(x * v25 + v25);
v28 = (float)((float)(int)(r / m_uItemsPerRow) * v24) / v16;
v29 = (float)(y * v23 + v23);
v11->bl.vertices.x = (float)(x * v25);
v11->bl.vertices.z = 0.0;
v11->br.vertices.x = v27;
v30 = (float)((float)(r % m_uItemsPerRow) * v19) / v14;
v11->br.vertices.z = 0.0;
v31 = v26 + v28;
v11->tl.texCoords.v = v28;
v11->tr.texCoords.v = v28;
v11->bl.texCoords.v = v31;
v32 = (float)(v19 / v14) + v30;
v11->tl.texCoords.u = v30;
v11->bl.texCoords.u = v30;
v11->br.texCoords.v = v31;
v11->tr.texCoords.u = v32;
v11->br.texCoords.u = v32;
v11->tl.vertices.x = (float)(x * v25);
v11->tl.vertices.y = v29;
v11->tl.vertices.z = 0.0;
v11->tr.vertices.x = v27;
v11->tr.vertices.y = v29;
v11->tr.vertices.z = 0.0;
v33 = a1->_displayedColor.r;
LOBYTE(v25) = a1->_displayedColor.g;
LOBYTE(v23) = a1->_displayedColor.b;
displayedOpacity = a1->_displayedOpacity;
v11->tr.colors.a = displayedOpacity;
v11->tr.colors.r = v33;
v11->tr.colors.g = v25;
v11->tr.colors.b = v23;
v11->tl.colors.r = v33;
v11->tl.colors.g = v25;
v11->tl.colors.b = v23;
v11->tl.colors.a = displayedOpacity;
v11->br.colors.r = v33;
v11->br.colors.a = displayedOpacity;
v11->bl.colors.r = v33;
v11->bl.colors.a = displayedOpacity;
v11->br.colors.g = v25;
v11->br.colors.b = v23;
v11->bl.colors.g = v25;
v11->bl.colors.b = v23;
m_pTextureAtlas = a1->m_pTextureAtlas;
v36 = m_pTextureAtlas->__vftable;
m_pTextureAtlas->m_bDirty = 1;
v37 = v36->getTotalQuads(m_pTextureAtlas);
if ( v37 < v13 )
cocos2d::CCTextureAtlas::increaseTotalQuadsWith(a1->m_pTextureAtlas, v13 - v37);
}