mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Pause menu video playback when OpenMW is minimized
This commit is contained in:
parent
b29d89bd6a
commit
1667b11564
5 changed files with 22 additions and 6 deletions
|
@ -230,6 +230,7 @@
|
|||
Bug #8364: Crash when clicking scrollbar without handle (divide by zero)
|
||||
Bug #8378: Korean bitmap fonts are unusable
|
||||
Bug #8439: Creatures without models can crash the game
|
||||
Bug #8441: Freeze when using video main menu replacers
|
||||
Feature #1415: Infinite fall failsafe
|
||||
Feature #2566: Handle NAM9 records for manual cell references
|
||||
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking
|
||||
|
|
|
@ -363,7 +363,7 @@ namespace MWBase
|
|||
void windowVisibilityChange(bool visible) override = 0;
|
||||
void windowResized(int x, int y) override = 0;
|
||||
void windowClosed() override = 0;
|
||||
virtual bool isWindowVisible() = 0;
|
||||
virtual bool isWindowVisible() const = 0;
|
||||
|
||||
virtual void watchActor(const MWWorld::Ptr& ptr) = 0;
|
||||
virtual MWWorld::Ptr getWatchedActor() const = 0;
|
||||
|
|
|
@ -29,11 +29,26 @@ namespace MWGui
|
|||
{
|
||||
Misc::FrameRateLimiter frameRateLimiter
|
||||
= Misc::makeFrameRateLimiter(MWBase::Environment::get().getFrameRateLimit());
|
||||
const MWBase::WindowManager& windowManager = *MWBase::Environment::get().getWindowManager();
|
||||
bool paused = false;
|
||||
while (mRunning)
|
||||
{
|
||||
// If finished playing, start again
|
||||
if (!mVideo->update())
|
||||
mVideo->playVideo("video\\menu_background.bik");
|
||||
if (windowManager.isWindowVisible())
|
||||
{
|
||||
if (paused)
|
||||
{
|
||||
mVideo->resume();
|
||||
paused = false;
|
||||
}
|
||||
// If finished playing, start again
|
||||
if (!mVideo->update())
|
||||
mVideo->playVideo("video\\menu_background.bik");
|
||||
}
|
||||
else if (!paused)
|
||||
{
|
||||
paused = true;
|
||||
mVideo->pause();
|
||||
}
|
||||
frameRateLimiter.limit();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1218,7 +1218,7 @@ namespace MWGui
|
|||
// TODO: check if any windows are now off-screen and move them back if so
|
||||
}
|
||||
|
||||
bool WindowManager::isWindowVisible()
|
||||
bool WindowManager::isWindowVisible() const
|
||||
{
|
||||
return mWindowVisible;
|
||||
}
|
||||
|
|
|
@ -290,7 +290,7 @@ namespace MWGui
|
|||
void windowVisibilityChange(bool visible) override;
|
||||
void windowResized(int x, int y) override;
|
||||
void windowClosed() override;
|
||||
bool isWindowVisible() override;
|
||||
bool isWindowVisible() const override;
|
||||
|
||||
void watchActor(const MWWorld::Ptr& ptr) override;
|
||||
MWWorld::Ptr getWatchedActor() const override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue