From 2126cedb7d9f7cea03a73dbc50204422e128c170 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Mon, 1 Aug 2022 05:00:06 +0300 Subject: [PATCH] Prevent Movies_Morrowind_Logo video from pausing sounds (bug #6049) Fix custom decoder tracks update (bug #6109) --- CHANGELOG.md | 2 ++ apps/openmw/engine.cpp | 2 +- apps/openmw/mwbase/windowmanager.hpp | 2 +- apps/openmw/mwgui/windowmanagerimp.cpp | 4 ++-- apps/openmw/mwgui/windowmanagerimp.hpp | 2 +- apps/openmw/mwsound/soundmanagerimp.cpp | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 168d03310a..cd3af98a9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ Bug #5978: NPCs and Creatures talk to and headtrack a player character with a 75% chameleon effect or more Bug #5989: Simple water isn't affected by texture filter settings Bug #6037: Launcher: Morrowind content language cannot be set to English + Bug #6049: Main Theme on OpenMW should begin on the second video like Vanilla. Bug #6051: NaN water height in ESM file is not handled gracefully Bug #6054: Hotkey items can be equipped while in ready to attack stance Bug #6066: Addtopic "return" does not work from within script. No errors thrown @@ -58,6 +59,7 @@ Bug #6087: Bound items added directly to the inventory disappear if their corresponding spell effect ends Bug #6101: Disarming trapped unlocked owned objects isn't considered a crime Bug #6107: Fatigue is incorrectly recalculated when fortify effect is applied or removed + Bug #6109: Crash when playing a custom made menu_background file Bug #6115: Showmap overzealous matching Bug #6118: Creature landing sound counts as a footstep Bug #6123: NPC with broken script freezes the game on hello diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 9e6643a577..af7d22dc90 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -1069,7 +1069,7 @@ void OMW::Engine::go() mSoundManager->playTitleMusic(); const std::string& logo = Fallback::Map::getString("Movies_Morrowind_Logo"); if (!logo.empty()) - mWindowManager->playVideo(logo, true); + mWindowManager->playVideo(logo, /*allowSkipping*/true, /*overrideSounds*/false); } else { diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index a65ccd6932..2d3be688b6 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -107,7 +107,7 @@ namespace MWBase /// @note This method will block until the video finishes playing /// (and will continually update the window while doing so) - virtual void playVideo(const std::string& name, bool allowSkipping) = 0; + virtual void playVideo(const std::string& name, bool allowSkipping, bool overrideSounds = true) = 0; virtual void setNewGame(bool newgame) = 0; diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 60dd282d1c..e8b92eaae6 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -1811,7 +1811,7 @@ namespace MWGui && (!isGuiMode() || (mGuiModes.size() == 1 && (getMode() == GM_MainMenu || getMode() == GM_Rest))); } - void WindowManager::playVideo(const std::string &name, bool allowSkipping) + void WindowManager::playVideo(const std::string &name, bool allowSkipping, bool overrideSounds) { mVideoWidget->playVideo("video\\" + name); @@ -1836,7 +1836,7 @@ namespace MWGui bool cursorWasVisible = mCursorVisible; setCursorVisible(false); - if (mVideoWidget->hasAudioStream()) + if (overrideSounds && mVideoWidget->hasAudioStream()) MWBase::Environment::get().getSoundManager()->pauseSounds(MWSound::VideoPlayback, ~MWSound::Type::Movie & MWSound::Type::Mask ); diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 6ff99665c2..117733d061 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -148,7 +148,7 @@ namespace MWGui /// @note This method will block until the video finishes playing /// (and will continually update the window while doing so) - void playVideo(const std::string& name, bool allowSkipping) override; + void playVideo(const std::string& name, bool allowSkipping, bool overrideSounds = true) override; /// Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this. void setKeyFocusWidget (MyGUI::Widget* widget) override; diff --git a/apps/openmw/mwsound/soundmanagerimp.cpp b/apps/openmw/mwsound/soundmanagerimp.cpp index 3ee76326f4..eab1ff59da 100644 --- a/apps/openmw/mwsound/soundmanagerimp.cpp +++ b/apps/openmw/mwsound/soundmanagerimp.cpp @@ -983,7 +983,7 @@ namespace MWSound } TrackList::iterator trkiter = mActiveTracks.begin(); - for(;trkiter != mActiveTracks.end();++trkiter) + while (trkiter != mActiveTracks.end()) { Stream *sound = trkiter->get(); if(!mOutput->isStreamPlaying(sound))