//
// cocos2d::CCLabelAtlas::updateAtlasValues from 0x5caeaa to 0x5cb09e (500 bytes)
//
// 0 xrefs:
//
// 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::CCLabelAtlas::updateAtlasValues(cocos2d::CCLabelAtlas *a1)
{
stl::StringData::Internal *m_data; // r8
int v3; // r9
cocos2d::CCTexture2D *v4; // r4
float v5; // s19
unsigned int v6; // r0
unsigned int m_uItemWidth; // s16
float v8; // s20
cocos2d::CCDirector *v9; // r0
int ContentScaleFactor; // r0
unsigned int m_uItemHeight; // s17
float v12; // s18
cocos2d::CCDirector *v13; // r0
float v14; // r0
float v15; // s16
float v16; // s17
unsigned int v17; // r6
cocos2d::ccV3F_C4B_T2F_Quad *i; // r4
unsigned int m_uItemsPerRow; // r11
unsigned int v20; // r10
unsigned int v21; // r3
int v22; // r2
unsigned int v23; // r3
GLfloat v24; // s15
GLfloat v25; // s18
GLfloat v26; // s14
unsigned int v27; // s14
GLfloat v28; // s21
GLfloat v29; // s14
GLubyte r; // r0
GLubyte g; // r1
cocos2d::CCTextureAtlas *m_pTextureAtlas; // r0
unsigned int v33; // r0
m_data = a1->m_sString.m_data.m_data;
v3 = *((_DWORD *)m_data - 3);
v4 = a1->m_pTextureAtlas->getTexture(a1->m_pTextureAtlas);
v5 = (float)v4->getPixelsWide(v4);
v6 = v4->getPixelsHigh(v4);
m_uItemWidth = a1->m_uItemWidth;
v8 = (float)v6;
v9 = cocos2d::CCDirector::sharedDirector();
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v9);
m_uItemHeight = a1->m_uItemHeight;
v12 = *(float *)&ContentScaleFactor;
v13 = cocos2d::CCDirector::sharedDirector();
v14 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v13));
if ( a1->m_bIgnoreContentScaleFactor )
{
v15 = (float)a1->m_uItemWidth;
v16 = (float)a1->m_uItemHeight;
}
else
{
v15 = (float)m_uItemWidth * v12;
v16 = (float)m_uItemHeight * v14;
}
v17 = 0;
a1->m_pTextureAtlas->getCapacity(a1->m_pTextureAtlas);
for ( i = a1->m_pTextureAtlas->getQuads(a1->m_pTextureAtlas); ; i[-1].br.colors.a = v23 )
{
++i;
if ( v17 == v3 )
break;
m_uItemsPerRow = a1->m_uItemsPerRow;
v20 = (unsigned __int8)(*((_BYTE *)m_data + v17) - a1->m_uMapStartChar);
v21 = a1->m_uItemWidth;
i[-1].bl.vertices.y = 0.0;
i[-1].bl.vertices.z = 0.0;
v22 = v21 * v17;
i[-1].br.vertices.y = 0.0;
i[-1].br.vertices.z = 0.0;
++v17;
v23 = v22 + v21;
v24 = (float)((float)(int)(v20 / m_uItemsPerRow) * v16) / v8;
i[-1].tl.texCoords.v = v24;
i[-1].tr.texCoords.v = v24;
v25 = (float)((float)(v20 % m_uItemsPerRow) * v15) / v5;
v26 = v24 + (float)(v16 / v8);
i[-1].tl.texCoords.u = v25;
i[-1].bl.texCoords.u = v25;
i[-1].bl.texCoords.v = v26;
i[-1].br.texCoords.v = v26;
i[-1].bl.vertices.x = (float)(unsigned int)v22;
i[-1].tl.vertices.x = (float)(unsigned int)v22;
v27 = a1->m_uItemHeight;
i[-1].tl.vertices.z = 0.0;
i[-1].tr.vertices.z = 0.0;
v28 = v25 + (float)(v15 / v5);
i[-1].tr.texCoords.u = v28;
i[-1].br.texCoords.u = v28;
v29 = (float)v27;
i[-1].br.vertices.x = (float)v23;
i[-1].tr.vertices.x = (float)v23;
i[-1].tl.vertices.y = v29;
i[-1].tr.vertices.y = v29;
LOBYTE(v23) = a1->_displayedOpacity;
r = a1->_displayedColor.r;
g = a1->_displayedColor.g;
LOBYTE(v22) = a1->_displayedColor.b;
i[-1].tl.colors.r = r;
i[-1].tl.colors.g = g;
i[-1].tl.colors.b = v22;
i[-1].tl.colors.a = v23;
i[-1].tr.colors.r = r;
i[-1].tr.colors.g = g;
i[-1].tr.colors.b = v22;
i[-1].tr.colors.a = v23;
i[-1].bl.colors.r = r;
i[-1].bl.colors.g = g;
i[-1].bl.colors.b = v22;
i[-1].bl.colors.a = v23;
i[-1].br.colors.r = r;
i[-1].br.colors.g = g;
i[-1].br.colors.b = v22;
}
if ( v17 )
{
m_pTextureAtlas = a1->m_pTextureAtlas;
m_pTextureAtlas->m_bDirty = 1;
v33 = m_pTextureAtlas->getTotalQuads(m_pTextureAtlas);
if ( v17 > v33 )
cocos2d::CCTextureAtlas::increaseTotalQuadsWith(a1->m_pTextureAtlas, v17 - v33);
}
}