//
// GJBaseGameLayer::createCustomParticle from 0x484230 to 0x484414 (484 bytes)
//
// 0 xrefs:
//
// 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 *__fastcall GJBaseGameLayer::createCustomParticle(
_DWORD *a1,
char **a2,
const cocos2d::ParticleStruct *a3,
int a4,
char a5)
{
cocos2d::CCDictionary *v9; // r8
cocos2d::CCArray *v10; // r4
cocos2d::CCArray *v11; // r0
void (__fastcall *setTag)(cocos2d::CCObject *__hidden, int); // r3
unsigned int v13; // r0
unsigned int v14; // r1
unsigned int v15; // r11
_DWORD **v16; // r0
_DWORD *inserted; // r0
int v18; // r11
cocos2d::CCArray *v19; // r0
int v20; // r5
cocos2d::CCObject *v21; // r11
_DWORD *v23; // r0
cocos2d::CCParticleSystemQuad *v24; // r5
int v25; // [sp+8h] [bp-1Ch]
std::string v26; // [sp+18h] [bp-Ch] BYREF
v9 = (cocos2d::CCDictionary *)a1[2699];
sub_776584((int)&v26, *a2);
v10 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v9, &v26);
v11 = (cocos2d::CCArray *)sub_774008(&v26);
if ( v10 )
{
if ( a4 <= 0 )
goto LABEL_10;
}
else if ( a5 )
{
if ( a4 <= 0 )
{
v24 = GameToolbox::particleFromStruct(a3, nullptr, 1);
v24->setTag(v24, 0);
cocos2d::CCParticleSystem::stopSystem(v24);
v24->setVisible(v24, 0);
return v24;
}
}
else
{
v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(v11);
setTag = v10->setTag;
++a1[2696];
((void (__fastcall *)(cocos2d::CCArray *))setTag)(v10);
v13 = v10->getTag(v10);
v14 = a1[2702];
v15 = v13;
v26.m_data.m_data = (stl::StringData::Internal *)v13;
v25 = v13 % v14;
v16 = sub_46C90C(a1 + 2701, v13 % v14, &v26);
if ( !v16 || (inserted = *v16) == nullptr )
{
v23 = (_DWORD *)operator new(0xCu);
*v23 = 0;
v23[1] = v15;
v23[2] = &unk_ACDDA8;
inserted = std::_Hashtable,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::_M_insert_unique_node(
(int)(a1 + 2701),
v25,
v15,
v23);
}
sub_775D40(inserted + 2, a2);
v18 = a1[2699];
sub_776584((int)&v26, *a2);
cocos2d::CCDictionary::setObject(v18, v10);
v19 = (cocos2d::CCArray *)sub_774008(&v26);
v20 = a1[2708];
v21 = (cocos2d::CCObject *)cocos2d::CCArray::create(v19);
sub_776584((int)&v26, *a2);
cocos2d::CCDictionary::setObject(v20, v21);
sub_774008(&v26);
if ( a4 <= 0 )
{
v24 = GameToolbox::particleFromStruct(a3, nullptr, 1);
v24->setTag(v24, 0);
cocos2d::CCParticleSystem::stopSystem(v24);
v24->setVisible(v24, 0);
LABEL_11:
cocos2d::CCArray::addObject(v10, v24);
v24->m_nCustomParticleIndex = v10->getTag(v10);
return v24;
}
}
if ( cocos2d::CCArray::count(v10) >= (unsigned int)a4 )
return nullptr;
LABEL_10:
v24 = GameToolbox::particleFromStruct(a3, nullptr, 1);
v24->setTag(v24, 0);
cocos2d::CCParticleSystem::stopSystem(v24);
v24->setVisible(v24, 0);
if ( !a5 )
goto LABEL_11;
return v24;
}