Prevented the launch sound from getting stopped when running in the background on game launch

This commit is contained in:
Leon Styhre 2025-03-16 22:02:31 +01:00
parent 6f0b77b88f
commit e625998387

View file

@ -1061,7 +1061,12 @@ void ViewController::launch(FileData* game)
// During this time period, all user input is blocked.
setAnimation(new LambdaAnimation([](float t) {}, duration), 0, [this, game] {
game->launchGame();
#if defined(__ANDROID__)
AudioManager::getInstance().stop();
#else
if (!Settings::getInstance()->getBool("RunInBackground"))
AudioManager::getInstance().stop();
#endif
// If the launch screen is disabled then this will do nothing.
mWindow->closeLaunchScreen();
onFileChanged(game, true);