From 6202b4eca93bc7db9df0768d3d6da110ec5a9e66 Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Tue, 7 Aug 2018 19:17:38 +0400 Subject: [PATCH] Do not touch GUI modes when taking screenshots (bug #4528) --- apps/openmw/mwgui/loadingscreen.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp index 3df482d68..28f4b8890 100644 --- a/apps/openmw/mwgui/loadingscreen.cpp +++ b/apps/openmw/mwgui/loadingscreen.cpp @@ -170,12 +170,18 @@ namespace MWGui // We are already using node masks to avoid the scene from being updated/rendered, but node masks don't work for computeBound() mViewer->getSceneData()->setComputeBoundingSphereCallback(new DontComputeBoundCallback); + mShowWallpaper = visible && (MWBase::Environment::get().getStateManager()->getState() + == MWBase::StateManager::State_NoGame); + + if (!visible) + { + draw(); + return; + } + mVisible = visible; mLoadingBox->setVisible(mVisible); - mShowWallpaper = mVisible && (MWBase::Environment::get().getStateManager()->getState() - == MWBase::StateManager::State_NoGame); - setVisible(true); if (mShowWallpaper) @@ -184,9 +190,6 @@ namespace MWGui } MWBase::Environment::get().getWindowManager()->pushGuiMode(mShowWallpaper ? GM_LoadingWallpaper : GM_Loading); - - if (!mVisible) - draw(); } void LoadingScreen::loadingOff()