//
// GameObject::createAndAddParticle from 0x644788 to 0x6448f4 (364 bytes)
//
// 42 xrefs:
// > GameObject::commonInteractiveSetup @ 0x6485d4
// > GameObject::customSetup @ 0x64eba8
// > GameObject::customSetup @ 0x64ee94
// > GameObject::customSetup @ 0x64efd0
// > GameObject::customSetup @ 0x64f178
// > GameObject::customSetup @ 0x64f528
// > GameObject::customSetup @ 0x64f650
// > GameObject::customSetup @ 0x64fd00
// > GameObject::customSetup @ 0x64ff18
// > GameObject::customSetup @ 0x6501dc
// > GameObject::customSetup @ 0x6503e4
// > GameObject::customSetup @ 0x65056c
// > GameObject::customSetup @ 0x6506ec
// > GameObject::customSetup @ 0x6507f8
// > GameObject::customSetup @ 0x6509ec
// > GameObject::customSetup @ 0x650aac
// > GameObject::customSetup @ 0x650ba0
// > GameObject::customSetup @ 0x650c10
// > GameObject::customSetup @ 0x650c80
// > GameObject::customSetup @ 0x650cf0
// > GameObject::customSetup @ 0x650df0
// > GameObject::customSetup @ 0x650ecc
// > GameObject::customSetup @ 0x650f2c
// > GameObject::customSetup @ 0x65101c
// > GameObject::customSetup @ 0x65112c
// > GameObject::customSetup @ 0x6511bc
// > GameObject::customSetup @ 0x651510
// > GameObject::customSetup @ 0x651824
// > GameObject::customSetup @ 0x65191c
// > GameObject::customSetup @ 0x6519c4
// > GameObject::customSetup @ 0x651a5c
// > GameObject::customSetup @ 0x651b10
// > GameObject::customSetup @ 0x651bb4
// > GameObject::customSetup @ 0x651c48
// > GameObject::customSetup @ 0x651d38
// > GameObject::customSetup @ 0x651dd0
// > EnhancedGameObject::updateUserCoin @ 0x652794
// > EnhancedGameObject::customSetup @ 0x652ca0
// > EnhancedGameObject::customSetup @ 0x6532c0
// > EnhancedGameObject::customSetup @ 0x6539d0
// > EndPortalObject::init @ 0x789bf0
// > ??> @ 0x4b4c8
//
// 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
//
cocos2d::CCParticleSystemQuad *GameObject::createAndAddParticle(
GameObject *a1,
int a2,
const char *a3,
int a4,
cocos2d::tCCPositionType a5)
{
GameManager *v10; // x0
cocos2d::CCParticleSystemQuad *Particle; // x20
GameManager *v12; // x0
void *v13; // x0
cocos2d::CCParticleSystemQuad *result; // x0
unsigned int *v15; // x2
int v16; // w1
__int64 v17; // [xsp+60h] [xbp+60h] BYREF
if ( !GameManager::sharedState()->m_playLayer || a1->m_hasNoParticles )
return nullptr;
v10 = GameManager::sharedState();
Particle = GJBaseGameLayer::createParticle(v10->m_playLayer, a2, a3, a4, a5);
v12 = GameManager::sharedState();
GJBaseGameLayer::getParticleKey(v12->m_playLayer, a2, a3, a4, a5);
sub_D163D4(&a1->m_particleString, &v17);
v13 = (void *)(v17 - 24);
if ( (__int64 *)(v17 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v17 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *(_DWORD *)(v17 - 8);
*(_DWORD *)(v17 - 8) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v13);
}
result = Particle;
a1->m_hasParticles = 1;
return result;
}