//
// GameManager::fadeInMusic from 0x415684 to 0x415710 (140 bytes)
//
// 11 xrefs:
// > GameManager::fadeInMenuMusic @ 0x416912
// > SecretLayer::init @ 0x5feaea
// > GJShopLayer::onBack @ 0x6114fa
// > SecretLayer2::init @ 0x61f33e
// > SecretLayer3::init @ 0x61fd88
// > SecretLayer4::init @ 0x622bfa
// > LevelAreaInnerLayer::tryResumeTowerMusic @ 0x6a4378
// > LevelAreaLayer::init @ 0x6a4a66
// > SecretRewardsLayer::init @ 0x6ce01a
// > SecretLayer5::init @ 0x6e5c28
// > SecretLayer6::init @ 0x6e65dc
//
// 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:47:40 +0000
//
FMODAudioEngine *__fastcall GameManager::fadeInMusic(FMODAudioEngine *result, unsigned __int8 *a2)
{
int v2; // r4
int v4; // r4
FMODAudioEngine *v5; // r7
int v6; // r3
_BOOL4 isMusicPlaying; // r7
FMODAudioEngine *v8; // r8
int v9[3]; // [sp+8h] [bp-10h] BYREF
v2 = *a2;
if ( (v2 & 1) != 0 )
v4 = *((_DWORD *)a2 + 1);
else
v4 = v2 >> 1;
if ( v4 )
{
v5 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(result);
std::string::basic_string(v9, (int)a2);
isMusicPlaying = FMODAudioEngine::isMusicPlaying(v5, (unsigned __int8 *)v9, 0, v6);
result = (FMODAudioEngine *)std::string::~string((int)v9);
if ( !isMusicPlaying )
{
v8 = (FMODAudioEngine *)FMODAudioEngine::sharedEngine(result);
std::string::basic_string(v9, (int)a2);
FMODAudioEngine::playMusic(v8, (int)v9, 1, 1.0, 0);
return (FMODAudioEngine *)std::string::~string((int)v9);
}
}
return result;
}