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