//
// GJBaseGameLayer::canProcessSFX from 0x100205f9c to 0x100206164 (456 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x100206944
//
// 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
//
bool __fastcall GJBaseGameLayer::canProcessSFX(
GJBaseGameLayer *a1,
SFXTriggerState *a2,
std::unordered_map *a3,
std::unordered_map *a4,
std::vector *a5)
{
int UniqueSFXID; // w23
SFXTriggerGameObject *m_sfxTriggerGameObject; // x8
int v11; // w9
float m_minInterval; // s8
double m_unkDouble1; // d9
GJBaseGameLayer *v14; // x0
SFXTriggerState *v15; // x22
float v16; // s0
int m_unkInt2; // w23
float v18; // s8
int v20; // [xsp+0h] [xbp-50h] BYREF
int *v21; // [xsp+8h] [xbp-48h] BYREF
UniqueSFXID = SFXTriggerGameObject::getUniqueSFXID(a2->m_sfxTriggerGameObject);
m_sfxTriggerGameObject = a2->m_sfxTriggerGameObject;
v11 = UniqueSFXID;
if ( !UniqueSFXID )
v11 = -m_sfxTriggerGameObject->m_uniqueID;
v20 = v11;
m_minInterval = m_sfxTriggerGameObject->m_minInterval;
if ( m_minInterval > 0.0 )
{
if ( sub_100018814(a4, &v20) )
{
m_unkDouble1 = a2->m_unkDouble1;
v21 = &v20;
if ( m_unkDouble1 - *((float *)sub_10001D150((unsigned __int64)a4, &v20, (__int64)&unk_10063A31C, &v21) + 5) < a2->m_sfxTriggerGameObject->m_minInterval )
return 0;
}
}
if ( UniqueSFXID && sub_100018814(a3, &v20) )
{
v21 = &v20;
v14 = (GJBaseGameLayer *)sub_10001D150((unsigned __int64)a3, &v20, (__int64)&unk_10063A31C, &v21);
v15 = &a5->__begin_[v14->m_uReference];
if ( a2->m_sfxTriggerGameObject->m_override )
{
v15->m_processed = 1;
goto LABEL_12;
}
if ( !v15->m_processed )
{
v16 = a2->m_unkDouble1;
GJBaseGameLayer::processSFXState(v14, v15, nullptr, 0, v16);
if ( !v15->m_processed )
return 0;
}
}
LABEL_12:
m_unkInt2 = a2->m_unkInt2;
v21 = &v20;
*((_DWORD *)sub_10001D150((unsigned __int64)a3, &v20, (__int64)&unk_10063A31C, &v21) + 5) = m_unkInt2;
if ( m_minInterval > 0.0 )
{
v18 = a2->m_unkDouble1;
v21 = &v20;
*((float *)sub_10001D150((unsigned __int64)a4, &v20, (__int64)&unk_10063A31C, &v21) + 5) = v18;
}
return 1;
}