mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
Loop title screen music (bug #4896)
This commit is contained in:
parent
0ab0e6ef93
commit
abae35e88b
@ -40,6 +40,7 @@
|
|||||||
Bug #4876: AI ratings handling inconsistencies
|
Bug #4876: AI ratings handling inconsistencies
|
||||||
Bug #4877: Startup script executes only on a new game start
|
Bug #4877: Startup script executes only on a new game start
|
||||||
Bug #4888: Global variable stray explicit reference calls break script compilation
|
Bug #4888: Global variable stray explicit reference calls break script compilation
|
||||||
|
Bug #4896: Title screen music doesn't loop
|
||||||
Bug #4911: Editor: QOpenGLContext::swapBuffers() warning with Qt5
|
Bug #4911: Editor: QOpenGLContext::swapBuffers() warning with Qt5
|
||||||
Bug #4916: Specular power (shininess) material parameter is ignored when shaders are used.
|
Bug #4916: Specular power (shininess) material parameter is ignored when shaders are used.
|
||||||
Feature #2229: Improve pathfinding AI
|
Feature #2229: Improve pathfinding AI
|
||||||
|
@ -706,16 +706,10 @@ void OMW::Engine::go()
|
|||||||
{
|
{
|
||||||
// start in main menu
|
// start in main menu
|
||||||
mEnvironment.getWindowManager()->pushGuiMode (MWGui::GM_MainMenu);
|
mEnvironment.getWindowManager()->pushGuiMode (MWGui::GM_MainMenu);
|
||||||
try
|
mEnvironment.getSoundManager()->playTitleMusic();
|
||||||
{
|
std::string logo = mFallbackMap["Movies_Morrowind_Logo"];
|
||||||
// Is there an ini setting for this filename or something?
|
if (!logo.empty())
|
||||||
mEnvironment.getSoundManager()->streamMusic("Special/morrowind title.mp3");
|
mEnvironment.getWindowManager()->playVideo(logo, true);
|
||||||
|
|
||||||
std::string logo = mFallbackMap["Movies_Morrowind_Logo"];
|
|
||||||
if (!logo.empty())
|
|
||||||
mEnvironment.getWindowManager()->playVideo(logo, true);
|
|
||||||
}
|
|
||||||
catch (...) {}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -89,6 +89,9 @@ namespace MWBase
|
|||||||
///< Start playing music from the selected folder
|
///< Start playing music from the selected folder
|
||||||
/// \param name of the folder that contains the playlist
|
/// \param name of the folder that contains the playlist
|
||||||
|
|
||||||
|
virtual void playTitleMusic() = 0;
|
||||||
|
///< Start playing title music
|
||||||
|
|
||||||
virtual void say(const MWWorld::ConstPtr &reference, const std::string& filename) = 0;
|
virtual void say(const MWWorld::ConstPtr &reference, const std::string& filename) = 0;
|
||||||
///< Make an actor say some text.
|
///< Make an actor say some text.
|
||||||
/// \param filename name of a sound file in "Sound/" in the data directory.
|
/// \param filename name of a sound file in "Sound/" in the data directory.
|
||||||
|
@ -471,6 +471,36 @@ namespace MWSound
|
|||||||
startRandomTitle();
|
startRandomTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SoundManager::playTitleMusic()
|
||||||
|
{
|
||||||
|
if (mCurrentPlaylist == "Title")
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (mMusicFiles.find("Title") == mMusicFiles.end())
|
||||||
|
{
|
||||||
|
std::vector<std::string> filelist;
|
||||||
|
const std::map<std::string, VFS::File*>& index = mVFS->getIndex();
|
||||||
|
// Is there an ini setting for this filename or something?
|
||||||
|
std::string filename = "music/special/morrowind title.mp3";
|
||||||
|
auto found = index.find(filename);
|
||||||
|
if (found != index.end())
|
||||||
|
{
|
||||||
|
filelist.emplace_back(found->first);
|
||||||
|
mMusicFiles["Title"] = filelist;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log(Debug::Warning) << "Title music not found";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mMusicFiles["Title"].empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
mCurrentPlaylist = "Title";
|
||||||
|
startRandomTitle();
|
||||||
|
}
|
||||||
|
|
||||||
void SoundManager::say(const MWWorld::ConstPtr &ptr, const std::string &filename)
|
void SoundManager::say(const MWWorld::ConstPtr &ptr, const std::string &filename)
|
||||||
{
|
{
|
||||||
@ -1122,10 +1152,10 @@ namespace MWSound
|
|||||||
if(!mOutput->isInitialized())
|
if(!mOutput->isInitialized())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
updateSounds(duration);
|
||||||
if (MWBase::Environment::get().getStateManager()->getState()!=
|
if (MWBase::Environment::get().getStateManager()->getState()!=
|
||||||
MWBase::StateManager::State_NoGame)
|
MWBase::StateManager::State_NoGame)
|
||||||
{
|
{
|
||||||
updateSounds(duration);
|
|
||||||
updateRegionSound(duration);
|
updateRegionSound(duration);
|
||||||
updateWaterSound(duration);
|
updateWaterSound(duration);
|
||||||
}
|
}
|
||||||
|
@ -168,6 +168,9 @@ namespace MWSound
|
|||||||
///< Start playing music from the selected folder
|
///< Start playing music from the selected folder
|
||||||
/// \param name of the folder that contains the playlist
|
/// \param name of the folder that contains the playlist
|
||||||
|
|
||||||
|
virtual void playTitleMusic();
|
||||||
|
///< Start playing title music
|
||||||
|
|
||||||
virtual void say(const MWWorld::ConstPtr &reference, const std::string& filename);
|
virtual void say(const MWWorld::ConstPtr &reference, const std::string& filename);
|
||||||
///< Make an actor say some text.
|
///< Make an actor say some text.
|
||||||
/// \param filename name of a sound file in "Sound/" in the data directory.
|
/// \param filename name of a sound file in "Sound/" in the data directory.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user