//
// cocos2d::CCParticleSystemQuad::initTexCoordsWithRect from 0x7e6520 to 0x7e6684 (356 bytes)
//
// 2 xrefs:
// > cocos2d::CCParticleSystemQuad::updateTexCoords @ 0x7e6692
// > cocos2d::CCParticleSystemQuad::setTextureWithRect @ 0x7e69a6
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:00:54 +0000
//
int __fastcall cocos2d::CCParticleSystemQuad::initTexCoordsWithRect(
cocos2d::CCParticleSystemQuad *this,
const cocos2d::CCRect *a2)
{
float *v4; // r0
float v5; // s14
float v6; // s15
float v7; // s18
cocos2d::CCDirector *v8; // r0
float v9; // r0
float v10; // s17
float v11; // s18
cocos2d::CCDirector *v12; // r0
float v13; // r0
float v14; // s16
float v15; // s17
cocos2d::CCDirector *v16; // r0
float v17; // r0
float v18; // s19
float v19; // s16
cocos2d::CCDirector *v20; // r0
float v21; // r0
int v22; // r0
float v23; // s17
float v24; // s15
unsigned int v25; // r2
float v26; // s18
float v27; // s19
float v28; // s16
float v29; // s17
int v30; // r0
unsigned int v31; // r1
int result; // r0
float v33; // [sp+Ch] [bp-14h] BYREF
float v34; // [sp+10h] [bp-10h]
float v35; // [sp+14h] [bp-Ch]
float v36; // [sp+18h] [bp-8h]
v4 = cocos2d::CCRect::operator=((float *)this + 179, (float *)a2);
v5 = *((float *)a2 + 3);
if ( v5 <= 0.0 )
v6 = 1.0;
else
v6 = *((float *)a2 + 2);
if ( v5 > 0.0 )
v6 = v6 / v5;
*((float *)this + 183) = v6;
v7 = *(float *)a2;
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v4);
v9 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v8));
v10 = *((float *)a2 + 1);
v11 = v7 * v9;
v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v9));
v13 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v12));
v14 = *((float *)a2 + 2);
v15 = v10 * v13;
v16 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v13));
v17 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v16));
v18 = *((float *)a2 + 3);
v19 = v14 * v17;
v20 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v17));
v21 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v20));
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v33, v11, v15, v19, v18 * v21);
v22 = *((_DWORD *)this + 146);
v23 = *((float *)a2 + 2);
v24 = *((float *)a2 + 3);
if ( v22 )
{
v23 = (float)(unsigned int)(*(int (__fastcall **)(int))(*(_DWORD *)v22 + 44))(v22);
v24 = (float)(unsigned int)(*(int (__fastcall **)(_DWORD))(**((_DWORD **)this + 146) + 48))(*((_DWORD *)this + 146));
}
v25 = *((_DWORD *)this + 89);
v26 = v33 / v23;
v27 = v34 / v24;
v28 = (float)(v33 / v23) + (float)(v35 / v23);
v29 = (float)(v34 / v24) + (float)(v36 / v24);
if ( v25 )
{
v30 = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(v25 + 268) + 56))(*(_DWORD *)(v25 + 268));
v25 = *((_DWORD *)this + 90);
v31 = *((_DWORD *)this + 145) + v25;
}
else
{
v30 = *((_DWORD *)this + 175);
v31 = *((_DWORD *)this + 145);
}
for ( result = v30 + 96 * v25 + 16; ; *(float *)(result - 44) = v27 )
{
result += 96;
if ( v25 >= v31 )
break;
*(float *)(result - 72) = v26;
++v25;
*(float *)(result - 68) = v29;
*(float *)(result - 24) = v28;
*(float *)(result - 20) = v29;
*(float *)(result - 96) = v26;
*(float *)(result - 92) = v27;
*(float *)(result - 48) = v28;
}
return result;
}