//
// cocos2d::CCParticleSystemQuad::initTexCoordsWithRect from 0x5ddd08 to 0x5dde4e (326 bytes)
//
// 2 xrefs:
// > cocos2d::CCParticleSystemQuad::updateTexCoords @ 0x5dde5e
// > cocos2d::CCParticleSystemQuad::setTextureWithRect @ 0x5de156
//
// 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; // s18
cocos2d::CCDirector *v5; // r0
float v6; // r0
float y; // s17
float v8; // s18
cocos2d::CCDirector *v9; // r0
float v10; // r0
float width; // s16
float v12; // s17
cocos2d::CCDirector *v13; // r0
float v14; // r0
float height; // s19
float v16; // s16
cocos2d::CCDirector *v17; // r0
float v18; // r0
cocos2d::CCTexture2D *m_pTexture; // r0
float v20; // s17
float v21; // s15
cocos2d::CCParticleBatchNode *m_pBatchNode; // r2
float v23; // s18
float v24; // s19
float v25; // s16
float v26; // s17
cocos2d::ccV3F_C4B_T2F_Quad *m_pQuads; // r0
unsigned int m_uTotalParticles; // r1
int i; // r0
cocos2d::CCRect v30; // [sp+Ch] [bp-14h] BYREF
cocos2d::CCRect::operator=(&a1->m_tTextureRect, &a2->origin.x);
x = a2->origin.x;
v5 = cocos2d::CCDirector::sharedDirector();
v6 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v5));
y = a2->origin.y;
v8 = x * v6;
v9 = cocos2d::CCDirector::sharedDirector();
v10 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v9));
width = a2->size.width;
v12 = y * v10;
v13 = cocos2d::CCDirector::sharedDirector();
v14 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v13));
height = a2->size.height;
v16 = width * v14;
v17 = cocos2d::CCDirector::sharedDirector();
v18 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v17));
cocos2d::CCRect::CCRect(&v30, v8, v12, v16, height * v18);
m_pTexture = a1->m_pTexture;
v20 = a2->size.width;
v21 = a2->size.height;
if ( m_pTexture )
{
v20 = (float)m_pTexture->getPixelsWide(m_pTexture);
v21 = (float)a1->m_pTexture->getPixelsHigh(a1->m_pTexture);
}
m_pBatchNode = a1->m_pBatchNode;
v23 = v30.origin.x / v20;
v24 = v30.origin.y / v21;
v25 = (float)(v30.origin.x / v20) + (float)(v30.size.width / v20);
v26 = (float)(v30.origin.y / v21) + (float)(v30.size.height / v21);
if ( m_pBatchNode )
{
m_pQuads = m_pBatchNode->m_pTextureAtlas->getQuads(m_pBatchNode->m_pTextureAtlas);
m_pBatchNode = (cocos2d::CCParticleBatchNode *)a1->m_uAtlasIndex;
m_uTotalParticles = (unsigned int)m_pBatchNode + a1->m_uTotalParticles;
}
else
{
m_pQuads = a1->m_pQuads;
m_uTotalParticles = a1->m_uTotalParticles;
}
for ( i = (int)&m_pQuads[(_DWORD)m_pBatchNode].tl.texCoords; ; *(float *)(i - 44) = v24 )
{
i += 96;
if ( (unsigned int)m_pBatchNode >= m_uTotalParticles )
break;
*(float *)(i - 72) = v23;
m_pBatchNode = (cocos2d::CCParticleBatchNode *)((char *)m_pBatchNode + 1);
*(float *)(i - 68) = v26;
*(float *)(i - 24) = v25;
*(float *)(i - 20) = v26;
*(float *)(i - 96) = v23;
*(float *)(i - 92) = v24;
*(float *)(i - 48) = v25;
}
}