1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 19:45:40 +00:00

Do not use playlist for title music

This commit is contained in:
Andrei Kortunov 2023-09-14 09:17:59 +04:00
parent 655c4442bc
commit ebb75008f8
2 changed files with 15 additions and 10 deletions

View file

@ -913,7 +913,13 @@ void OMW::Engine::go()
{
// start in main menu
mWindowManager->pushGuiMode(MWGui::GM_MainMenu);
mSoundManager->playPlaylist("Title");
std::string titlefile = "music/special/morrowind title.mp3";
if (mVFS->exists(titlefile))
mSoundManager->streamMusic(titlefile, MWSound::MusicType::Special);
else
Log(Debug::Warning) << "Title music not found";
std::string_view logo = Fallback::Map::getString("Movies_Morrowind_Logo");
if (!logo.empty())
mWindowManager->playVideo(logo, /*allowSkipping*/ true, /*overrideSounds*/ false);

View file

@ -132,15 +132,6 @@ namespace MWSound
Log(Debug::Info) << stream.str();
}
// TODO: dehardcode this
std::vector<std::string> titleMusic;
std::string_view titlefile = "music/special/morrowind title.mp3";
if (mVFS->exists(titlefile))
titleMusic.emplace_back(titlefile);
else
Log(Debug::Warning) << "Title music not found";
mMusicFiles["Title"] = titleMusic;
}
SoundManager::~SoundManager()
@ -1143,6 +1134,14 @@ namespace MWSound
if (!mOutput->isInitialized() || mPlaybackPaused)
return;
MWBase::StateManager::State state = MWBase::Environment::get().getStateManager()->getState();
if (state == MWBase::StateManager::State_NoGame && !isMusicPlaying())
{
std::string titlefile = "music/special/morrowind title.mp3";
if (mVFS->exists(titlefile))
streamMusic(titlefile, MWSound::MusicType::Special);
}
updateSounds(duration);
if (MWBase::Environment::get().getStateManager()->getState() != MWBase::StateManager::State_NoGame)
{