//
// GameManager::fadeInMusic from 0x320c0c to 0x320c90 (132 bytes)
//
// 11 xrefs:
// > GameManager::fadeInMenuMusic @ 0x323fde
// > SecretLayer::init @ 0x4cb21e
// > GJShopLayer::onBack @ 0x4e1ce2
// > SecretLayer2::init @ 0x4ee66e
// > SecretLayer3::init @ 0x4ef084
// > SecretLayer4::init @ 0x4f1a1a
// > LevelAreaInnerLayer::tryResumeTowerMusic @ 0x56b548
// > LevelAreaLayer::init @ 0x56c832
// > SecretRewardsLayer::init @ 0x585f32
// > SecretLayer5::init @ 0x59ee02
// > SecretLayer6::init @ 0x59f7ee
//
// 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
//
int __fastcall GameManager::fadeInMusic(int a1, _DWORD *a2, int a3, int a4)
{
FMODAudioEngine *v5; // r7
_BOOL4 isMusicPlaying; // r7
int result; // r0
FMODAudioEngine *v8; // r8
_DWORD v9[2]; // [sp+8h] [bp-8h] BYREF
v9[0] = a3;
v9[1] = a4;
if ( *(_DWORD *)(*a2 - 12) )
{
v5 = FMODAudioEngine::sharedEngine();
sub_775C20(v9, a2);
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v5, (int)v9);
result = sub_774008(v9);
if ( !isMusicPlaying )
{
v8 = FMODAudioEngine::sharedEngine();
sub_775C20(v9, a2);
FMODAudioEngine::playMusic((FMOD::Channel *)v8, (int)v9, 1, 1.0, 0);
return sub_774008(v9);
}
}
return result;
}