//
// cocos2d::CCParticleSystemQuad::initTexCoordsWithRect from 0xb03320 to 0xb034dc (444 bytes)
//
// 3 xrefs:
// > cocos2d::CCParticleSystemQuad::updateTexCoords @ 0xb034e8
// > cocos2d::CCParticleSystemQuad::setTextureWithRect @ 0xb03a30
// > ??> @ 0x45048
//
// 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::CCParticleSystemQuad::initTexCoordsWithRect(cocos2d::CCParticleSystemQuad *a1, const cocos2d::CCRect *a2)
{
float x; // s10
cocos2d::CCDirector *v5; // x0
float ContentScaleFactor; // s0
float y; // s8
float v8; // s10
cocos2d::CCDirector *v9; // x0
float v10; // s0
float width; // s9
cocos2d::CCDirector *v12; // x0
float v13; // s0
float height; // s8
cocos2d::CCDirector *v15; // x0
float v16; // s0
cocos2d::CCTexture2D *m_pTexture; // x0
float v18; // s9
float v19; // s1
cocos2d::CCParticleBatchNode *m_pBatchNode; // x0
float v21; // s10
float v22; // s11
float v23; // s8
float v24; // s9
cocos2d::ccV3F_C4B_T2F_Quad *m_pQuads; // x0
unsigned int m_uAtlasIndex; // w1
unsigned int m_uTotalParticles; // w2
unsigned __int64 v28; // x2
cocos2d::ccTex2F *p_texCoords; // x1
cocos2d::ccTex2F *v30; // x0
float v31; // [xsp+50h] [xbp+50h]
float v32; // [xsp+60h] [xbp+60h]
cocos2d::CCRect v33; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCRect::operator=(&a1->m_tTextureRect, (float *)&a2->origin);
x = a2->origin.x;
v5 = cocos2d::CCDirector::sharedDirector();
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v5);
y = a2->origin.y;
v8 = x * ContentScaleFactor;
v9 = cocos2d::CCDirector::sharedDirector();
v10 = cocos2d::CCDirector::getContentScaleFactor(v9);
width = a2->size.width;
v31 = y * v10;
v12 = cocos2d::CCDirector::sharedDirector();
v13 = cocos2d::CCDirector::getContentScaleFactor(v12);
height = a2->size.height;
v32 = width * v13;
v15 = cocos2d::CCDirector::sharedDirector();
v16 = cocos2d::CCDirector::getContentScaleFactor(v15);
cocos2d::CCRect::CCRect(&v33, v8, v31, v32, height * v16);
m_pTexture = a1->m_pTexture;
v18 = a2->size.width;
v19 = a2->size.height;
if ( m_pTexture )
{
v18 = (float)m_pTexture->getPixelsWide(m_pTexture);
v19 = (float)a1->m_pTexture->getPixelsHigh(a1->m_pTexture);
}
m_pBatchNode = a1->m_pBatchNode;
v21 = v33.origin.x / v18;
v22 = v33.origin.y / v19;
v23 = (float)(v33.size.width / v18) + (float)(v33.origin.x / v18);
v24 = (float)(v33.size.height / v19) + (float)(v33.origin.y / v19);
if ( m_pBatchNode )
{
m_pQuads = m_pBatchNode->m_pTextureAtlas->getQuads(m_pBatchNode->m_pTextureAtlas);
m_uAtlasIndex = a1->m_uAtlasIndex;
m_uTotalParticles = m_uAtlasIndex + a1->m_uTotalParticles;
}
else
{
m_pQuads = a1->m_pQuads;
m_uAtlasIndex = 0;
m_uTotalParticles = a1->m_uTotalParticles;
}
if ( m_uAtlasIndex < m_uTotalParticles )
{
v28 = m_uTotalParticles - 1 - m_uAtlasIndex + (unsigned __int64)m_uAtlasIndex;
p_texCoords = &m_pQuads[m_uAtlasIndex].tl.texCoords;
v30 = &m_pQuads[v28 + 1].tl.texCoords;
do
{
p_texCoords[3].u = v21;
p_texCoords += 12;
p_texCoords[-9].v = v24;
p_texCoords[-3].u = v23;
p_texCoords[-3].v = v24;
p_texCoords[-12].u = v21;
p_texCoords[-12].v = v22;
p_texCoords[-6].u = v23;
p_texCoords[-6].v = v22;
}
while ( p_texCoords != v30 );
}
}