//
// GJBaseGameLayer::activateSFXEditTrigger from 0x5b1a1c to 0x5b1bca (430 bytes)
//
// 4 xrefs:
// > LevelEditorLayer::activateTriggerEffect @ 0x467b98
// > EffectGameObject::triggerObject @ 0x4f5350
// > GJBaseGameLayer::processQueuedAudioTriggers @ 0x5b1c2c
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x5b3bf4
//
// 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 11:53:33 +0000
//
void __fastcall GJBaseGameLayer::activateSFXEditTrigger(GJBaseGameLayer *this, SFXTriggerGameObject *a2)
{
GJBaseGameLayer *v2; // r4
int v3; // r5
SFXTriggerGameObject **v4; // r3
int v5; // r1
GJBaseGameLayer *v6; // r6
_DWORD *v7; // r2
int *v8; // r5
_DWORD *i; // r5
signed int v10; // r1
FMODAudioEngine *v11; // r0
unsigned int v12; // r2
_DWORD *v13; // r0
int v14; // r3
int v15; // t1
int **v16; // r0
int *v17; // r6
int *v18; // [sp+4h] [bp-28h]
int *v19; // [sp+8h] [bp-24h]
SFXTriggerGameObject *v20; // [sp+Ch] [bp-20h] BYREF
unsigned int v21[2]; // [sp+10h] [bp-1Ch] BYREF
_DWORD *v22; // [sp+18h] [bp-14h] BYREF
_DWORD v23[2]; // [sp+1Ch] [bp-10h] BYREF
v2 = this;
v20 = a2;
if ( *((_BYTE *)this + 10785) || !*((_BYTE *)this + 10784) )
{
if ( *((_BYTE *)this + 11568) )
{
(*(void (__fastcall **)(GJBaseGameLayer *, SFXTriggerGameObject *))(*(_DWORD *)this + 760))(this, v20);
}
else
{
v3 = *((unsigned __int8 *)this + 1439);
if ( *((_BYTE *)this + 1439) )
{
v4 = *((SFXTriggerGameObject ***)this + 361);
if ( v4 == *((SFXTriggerGameObject ***)this + 362) )
{
std::vector::__push_back_slow_path(
(_DWORD *)this + 360,
&v20);
}
else
{
if ( v4 )
*v4 = v20;
*((_DWORD *)this + 361) += 4;
}
}
else
{
v5 = *((_DWORD *)v20 + 439);
if ( v5 > 0 )
{
this = GJBaseGameLayer::getGroup(this, v5);
v6 = this;
if ( this )
{
this = (GJBaseGameLayer *)cocos2d::CCArray::count(this);
if ( this )
{
v7 = *((_DWORD **)v6 + 13);
v23[0] = v3;
v23[1] = v3;
v22 = v23;
if ( *v7 )
{
v8 = (int *)v7[3];
v18 = &v8[*v7 - 1];
while ( v8 <= v18 )
{
v15 = *v8++;
v14 = v15;
if ( !v15 )
break;
if ( *(_DWORD *)(v14 + 892) == 3602 )
{
v21[0] = *(_DWORD *)(v14 + 780);
v16 = (int **)std::unordered_map>::operator[]((int)v2 + 1288, v21);
v17 = *v16;
v19 = v16[1];
while ( v17 != v19 )
{
std::__tree::__emplace_unique_key_args((int)v21, (int)&v22, v17, v17);
++v17;
}
}
}
}
for ( i = v22; i != v23; i = std::__tree_next *>(i) )
{
if ( !*((_BYTE *)v20 + 1776) )
GJBaseGameLayer::applySFXEditTrigger(v2, i[4], *((unsigned __int8 *)v20 + 1776), v20);
if ( *((int *)v20 + 321) > 0 )
GJBaseGameLayer::addProximityVolumeEffect((int **)v2, i[4], 0, v20);
}
this = (GJBaseGameLayer *)std::__tree::~__tree((int)&v22);
}
}
}
v10 = *((_DWORD *)v20 + 437);
if ( v10 > 0 )
{
if ( !*((_BYTE *)v20 + 1776) )
GJBaseGameLayer::applySFXEditTrigger(v2, v10, 1, v20);
if ( *((int *)v20 + 321) > 0 )
this = GJBaseGameLayer::addProximityVolumeEffect((int **)v2, *((_DWORD *)v20 + 437), 1, v20);
}
if ( *((int *)v20 + 427) > 0 )
{
v11 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(this);
v13 = FMODAudioEngine::channelIDForUniqueID(v11, *((_DWORD *)v20 + 427), v12);
if ( !*((_BYTE *)v20 + 1776) )
GJBaseGameLayer::applySFXEditTrigger(v2, (unsigned int)v13, *((unsigned __int8 *)v20 + 1776), v20);
}
}
}
}
}