1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-04 03:40:14 +00:00

Merge branch '5468_progress_caption_overlapping' into 'master'

Issue #5468: Apparently this was always a problem but OP made "nested loading"...

See merge request OpenMW/openmw!228
This commit is contained in:
Andrei Kortunov 2020-06-18 16:27:06 +00:00
commit 142a9e772b
2 changed files with 7 additions and 2 deletions

View File

@ -40,6 +40,7 @@ namespace MWGui
, mLoadingOnTime(0.0)
, mImportantLabel(false)
, mVisible(false)
, mNestedLoadingCount(0)
, mProgress(0)
, mShowWallpaper(true)
{
@ -163,11 +164,12 @@ namespace MWGui
void LoadingScreen::loadingOn(bool visible)
{
mLoadingOnTime = mTimer.time_m();
// Early-out if already on
if (mMainWidget->getVisible())
if (mNestedLoadingCount++ > 0 && mMainWidget->getVisible())
return;
mLoadingOnTime = mTimer.time_m();
// Assign dummy bounding sphere callback to avoid the bounding sphere of the entire scene being recomputed after each frame of loading
// 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);
@ -200,6 +202,8 @@ namespace MWGui
void LoadingScreen::loadingOff()
{
if (--mNestedLoadingCount > 0)
return;
mLoadingBox->setVisible(true); // restore
if (mLastRenderTime < mLoadingOnTime)

View File

@ -66,6 +66,7 @@ namespace MWGui
bool mImportantLabel;
bool mVisible;
int mNestedLoadingCount;
size_t mProgress;