//
// cocos2d::CCParticleSystemQuad::updateQuadWithParticle from 0xb02bcc to 0xb02f74 (936 bytes)
//
// 13 xrefs:
// > ??> @ 0x88a10
// > ??> @ 0x1212400
// > ??> @ 0x1212ab0
// > ??> @ 0x1213160
// > ??> @ 0x1213810
// > ??> @ 0x1213ec0
// > ??> @ 0x1214570
// > ??> @ 0x1214c20
// > ??> @ 0x12152d0
// > ??> @ 0x1215980
// > ??> @ 0x1216030
// > ??> @ 0x12166e0
// > ??> @ 0x12178a0
//
// 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::updateQuadWithParticle(
cocos2d::CCParticleSystemQuad *a1,
cocos2d::sCCParticle *a2,
const cocos2d::CCPoint *a3)
{
cocos2d::CCParticleBatchNode *m_pBatchNode; // x0
__int64 v5; // x0
cocos2d::ccV3F_C4B_T2F_Quad *v6; // x0
float y; // s1
float radialAccel; // s2
float v9; // s0
GLubyte v10; // w4
GLubyte v11; // w6
GLubyte v12; // w5
float b; // s1
GLubyte v14; // w3
float timeToLive; // s0
float tangentialAccel; // s2
float m_uOpacity; // s1
float rotation; // s2
float v19; // s0
float v20; // s0
float v21; // s1
float v22; // s4
float x; // s2
int v24; // w1
int v25; // w2
bool v26; // cc
unsigned int v27; // w4
unsigned int v28; // w1
float v29; // s1
unsigned int v30; // w2
float v31; // s3
float v32; // s7
float v33; // s6
float v34; // s4
GLfloat v35; // s2
GLfloat v36; // s3
GLfloat v37; // s1
GLfloat v38; // s0
const cocos2d::CCPoint *v39; // [xsp+20h] [xbp+20h]
cocos2d::sCCParticle *v40; // [xsp+28h] [xbp+28h]
m_pBatchNode = a1->m_pBatchNode;
if ( m_pBatchNode )
{
v39 = a3;
v40 = a2;
v5 = (__int64)m_pBatchNode->m_pTextureAtlas->getQuads(m_pBatchNode->m_pTextureAtlas);
a2 = v40;
a3 = v39;
v6 = (cocos2d::ccV3F_C4B_T2F_Quad *)(v5 + 96LL * (LODWORD(v40->modeA.dir.x) + a1->m_uAtlasIndex));
}
else
{
v6 = &a1->m_pQuads[a1->cocos2d::CCParticleSystem::m_uParticleIdx];
}
if ( a1->m_bOpacityModifyRGB )
{
y = a2->modeA.dir.y;
radialAccel = a2->modeA.radialAccel;
v9 = (float)a1->m_uOpacity * a2->color.a;
if ( y < radialAccel || (y = a2->timeToLive, radialAccel = a2->modeA.tangentialAccel, y < radialAccel) )
v9 = v9 * (float)(y / radialAccel);
v10 = (unsigned int)v9;
v11 = (unsigned int)(float)(v9 * a2->color.r);
a1->m_tQuadColor.r = v11;
v12 = (unsigned int)(float)(v9 * a2->color.g);
a1->m_tQuadColor.g = v12;
b = a2->color.b;
a1->m_tQuadColor.a = v10;
v14 = (unsigned int)(float)(v9 * b);
a1->m_tQuadColor.b = v14;
}
else
{
timeToLive = a2->modeA.dir.y;
tangentialAccel = a2->modeA.radialAccel;
m_uOpacity = (float)a1->m_uOpacity;
if ( timeToLive < tangentialAccel
|| (timeToLive = a2->timeToLive, tangentialAccel = a2->modeA.tangentialAccel, timeToLive < tangentialAccel) )
{
m_uOpacity = m_uOpacity * (float)(timeToLive / tangentialAccel);
}
v11 = (unsigned int)(float)(m_uOpacity * a2->color.r);
a1->m_tQuadColor.r = v11;
v12 = (unsigned int)(float)(m_uOpacity * a2->color.g);
a1->m_tQuadColor.g = v12;
v14 = (unsigned int)(float)(m_uOpacity * a2->color.b);
a1->m_tQuadColor.b = v14;
v10 = (unsigned int)(float)(m_uOpacity * a2->color.a);
a1->m_tQuadColor.a = v10;
}
v6->bl.colors.r = v11;
v6->bl.colors.g = v12;
v6->bl.colors.b = v14;
v6->bl.colors.a = v10;
v6->br.colors.r = a1->m_tQuadColor.r;
v6->br.colors.g = a1->m_tQuadColor.g;
v6->br.colors.b = a1->m_tQuadColor.b;
v6->br.colors.a = a1->m_tQuadColor.a;
v6->tl.colors.r = a1->m_tQuadColor.r;
v6->tl.colors.g = a1->m_tQuadColor.g;
v6->tl.colors.b = a1->m_tQuadColor.b;
v6->tl.colors.a = a1->m_tQuadColor.a;
v6->tr.colors.r = a1->m_tQuadColor.r;
v6->tr.colors.g = a1->m_tQuadColor.g;
v6->tr.colors.b = a1->m_tQuadColor.b;
v6->tr.colors.a = a1->m_tQuadColor.a;
rotation = a2->rotation;
v19 = a2->size * 0.5;
if ( rotation != 0.0 )
{
v20 = -v19;
v21 = 360.0 - rotation;
v22 = a3->y;
x = a3->x;
v24 = (__int16)(int)v21;
if ( v24 <= 270 )
v25 = (__int16)(v24 + 90);
else
v25 = (__int16)(v24 - 270);
v26 = v25 <= 180;
v25 = (unsigned __int8)v25;
if ( v26 )
{
if ( (unsigned __int8)v25 > 0x5Au )
v25 = (unsigned __int8)(-76 - v25);
v26 = v24 <= 180;
v28 = (unsigned __int8)(int)v21;
v29 = v20 * flt_F199A0[v25];
if ( !v26 )
goto LABEL_17;
}
else
{
v27 = (unsigned __int8)(v25 + 76);
if ( v27 > 0x5A )
v27 = (unsigned __int8)(104 - v25);
v26 = v24 <= 180;
v28 = (unsigned __int8)(int)v21;
v29 = v20 * (float)-flt_F199A0[v27];
if ( !v26 )
{
LABEL_17:
v30 = (unsigned __int8)(v28 + 76);
if ( v30 > 0x5A )
v30 = (unsigned __int8)(104 - v28);
v31 = -flt_F199A0[v30];
LABEL_20:
v32 = v29 - (float)(v20 * v31);
v33 = v29 + (float)(v20 * v31);
v6->bl.vertices.x = v32 + x;
v6->bl.vertices.y = v33 + v22;
v6->br.vertices.x = x - v33;
v6->br.vertices.y = v22 + v32;
v6->tl.vertices.x = x + v33;
v6->tl.vertices.y = v22 - v32;
v6->tr.vertices.x = x - v32;
v6->tr.vertices.y = v22 - v33;
return;
}
}
if ( v28 > 0x5A )
v28 = (unsigned __int8)(-76 - v28);
v31 = flt_F199A0[v28];
goto LABEL_20;
}
v34 = a3->y;
v35 = a3->x - v19;
v36 = v34 - v19;
v37 = v19 + a3->x;
v38 = v19 + v34;
v6->bl.vertices.x = v35;
v6->bl.vertices.y = v36;
v6->br.vertices.x = v37;
v6->br.vertices.y = v36;
v6->tl.vertices.x = v35;
v6->tl.vertices.y = v38;
v6->tr.vertices.x = v37;
v6->tr.vertices.y = v38;
}