//
// GJBaseGameLayer::activateSongTrigger from 0x14034b7c0 to 0x14034ba0e (590 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::processQueuedAudioTriggers @ 0x140345b85
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x14034db88
// > LevelEditorLayer::activateTriggerEffect @ 0x1403fbe58
// > EffectGameObject::triggerObject @ 0x140648e30
// > ??> @ 0x140920054
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:30:44 +0000
//
// Hidden C++ exception states: #wind=5
void __fastcall GJBaseGameLayer::activateSongTrigger(__int64 a1, __int64 a2)
{
unsigned int v4; // esi
int v5; // ebx
_QWORD *v6; // rcx
__int64 v7; // rcx
void **v8; // r14
float v9; // xmm2_4
char v10; // r8
__int64 v11; // r9
int v12; // [rsp+58h] [rbp-60h]
_BYTE v13[32]; // [rsp+80h] [rbp-38h] BYREF
_BYTE *v14; // [rsp+C0h] [rbp+8h] BYREF
void *v15; // [rsp+D0h] [rbp+18h]
if ( *(_BYTE *)(a1 + 13025) || !*(_BYTE *)(a1 + 13024) )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1368LL))(a1);
if ( !*(_BYTE *)(a1 + 14436) )
{
if ( *(_BYTE *)(a1 + 2215) )
{
v14 = (_BYTE *)a2;
sub_1400BD3C0((const void **)(a1 + 2216), (__int64 *)&v14);
}
else
{
v4 = *(_DWORD *)(a2 + 2060);
v5 = ~v4;
if ( *(_BYTE *)(a2 + 2058) )
{
v6 = (_QWORD *)qword_14090BF60;
if ( !qword_14090BF60 )
{
v14 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
v6 = (_QWORD *)qword_14090BF60;
}
FMODAudioEngine::activateQueuedMusic(v6, v5);
}
else
{
if ( !qword_14090BF60 )
{
v14 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v14);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
}
v14 = v13;
v7 = qword_14090C070;
if ( !qword_14090C070 )
{
v15 = operator new(0x3D0u);
qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v15);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);
v7 = qword_14090C070;
}
v8 = (void **)MusicDownloadManager::pathForSong(v7, v13, *(unsigned int *)(a2 + 1888));
if ( !qword_14090BF60 )
{
v15 = operator new(0x8A8u);
qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v15);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);
}
v9 = FMODAudioEngine::pitchForIdx(*(_DWORD *)(a2 + 1900));
FMODAudioEngine::queueStartMusic(
v11,
v8,
v9,
0.0,
*(_DWORD *)(a2 + 1908),
*(_BYTE *)(a2 + 1930),
*(_DWORD *)(a2 + 1912),
*(_DWORD *)(a2 + 1920),
*(_DWORD *)(a2 + 1916),
*(_DWORD *)(a2 + 1924),
v5,
v12,
v4,
v10,
*(_BYTE *)(a2 + 1932));
}
}
}
}
}