From cd5e440642c9a5b3389d5e1d34fdb956fb636be7 Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Fri, 14 Sep 2018 22:35:57 +0200 Subject: [PATCH] Play music during game start and loading screens --- src/engine/GameSession.cpp | 1 + src/target/REGoth.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/engine/GameSession.cpp b/src/engine/GameSession.cpp index b035d02b..04a62741 100644 --- a/src/engine/GameSession.cpp +++ b/src/engine/GameSession.cpp @@ -157,6 +157,7 @@ void GameSession::switchToWorld(const std::string& worldFile) auto strippedWorldName = Utils::uppered(Utils::stripExtension(worldFile)); engine->getHud().getLoadingScreen().reset("LOADING_" + strippedWorldName + ".TGA"); engine->getHud().getLoadingScreen().setHidden(false); + engine->getAudioWorld().playMusicTheme("SYS_Loading"); auto& session = engine->getSession(); auto oldWorld = engine->getMainWorld(); diff --git a/src/target/REGoth.cpp b/src/target/REGoth.cpp index f530716c..2a0501e1 100644 --- a/src/target/REGoth.cpp +++ b/src/target/REGoth.cpp @@ -107,6 +107,11 @@ void REGoth::init(int _argc, char** _argv) { menuMain.onCustomAction("NEW_GAME"); } + else + { + m_pEngine->getAudioWorld().playMusicTheme("SYS_Menu"); + m_pEngine->getAudioWorld().playSound("GAMESTART"); + } m_timeOffset = bx::getHPCounter();