//
// CreateParticlePopup::update from 0x9c0710 to 0x9c091c (524 bytes)
//
// 2 xrefs:
// > ??> @ 0x42b58
// > ??> @ 0x11c85f8
//
// 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 CreateParticlePopup::update(CreateParticlePopup *a1, float a2)
{
float v4; // s0
float v5; // s9
float m_respawnResult; // s1
cocos2d::CCParticleSystemQuad *v7; // x0
float v8; // s8
cocos2d::CCParticleSystemQuad *v9; // x0
float m_fRespawn; // s3
unsigned __int64 v11; // x1
float m_fRespawnVar; // s2
cocos2d::CCLabelBMFont *m_perfLogLabel; // x20
cocos2d::CCParticleSystemQuad *m_particle; // x0
unsigned int (__fastcall *getParticleCount)(cocos2d::CCParticleSystem *__hidden); // x1
void (__fastcall *setString)(cocos2d::CCLabelBMFont *__hidden, const unsigned __int8 *); // x21
unsigned int ParticleDrawCost; // w0
cocos2d::CCString *v18; // x0
const char *CString; // x0
char *v20; // [xsp+40h] [xbp+40h]
__int64 v21; // [xsp+48h] [xbp+48h]
if ( a1->m_perfLogEnabled )
{
v4 = a2 + a1->m_perfLogElapsed;
if ( v4 >= 0.1 )
{
m_perfLogLabel = a1->m_perfLogLabel;
m_particle = a1->m_particle;
getParticleCount = m_particle->getParticleCount;
setString = m_perfLogLabel->setString;
a1->m_perfLogElapsed = 0.0;
v20 = (char *)getParticleCount(m_particle);
v21 = a1->m_particle->getTotalParticles(a1->m_particle);
ParticleDrawCost = cocos2d::CCParticleSystem::getParticleDrawCost(a1->m_particle);
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i/%i\n%i",
v20,
v21,
ParticleDrawCost);
CString = cocos2d::CCString::getCString(v18);
setString(m_perfLogLabel, (const unsigned __int8 *)CString);
}
else
{
a1->m_perfLogElapsed = v4;
}
}
v5 = a1->m_particle->getDuration(a1->m_particle);
if ( v5 >= 0.0 )
{
m_respawnResult = a1->m_respawnResult;
a1->m_elapsed = a1->m_elapsed + a2;
if ( m_respawnResult < 0.0 )
{
v7 = a1->m_particle;
m_fRespawn = v7->m_fRespawn;
v11 = 214013 * qword_1243D50 + 2531011;
qword_1243D50 = v11;
m_fRespawnVar = v7->m_fRespawnVar;
if ( (float)(m_fRespawn
+ (float)((float)((float)((float)((float)((v11 >> 16) & 0x7FFF) / 32767.0) * 2.0) + -1.0)
* m_fRespawnVar)) <= 0.0 )
{
a1->m_respawnResult = 0.0;
}
else
{
qword_1243D50 = 214013 * v11 + 2531011;
a1->m_respawnResult = m_fRespawn
+ (float)(m_fRespawnVar
* (float)((float)((float)((float)(((unsigned __int64)qword_1243D50 >> 16) & 0x7FFF)
/ 32767.0)
* 2.0)
+ -1.0));
}
}
else
{
v7 = a1->m_particle;
}
v8 = v7->getLife(v7);
if ( a1->m_elapsed > (float)(v5
+ (float)((float)(v8 + a1->m_particle->getLifeVar(a1->m_particle)) + a1->m_respawnResult)) )
{
v9 = a1->m_particle;
a1->m_respawnResult = -1.0;
a1->m_elapsed = 0.0;
cocos2d::CCParticleSystem::resetSystem(v9);
}
}
}