1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-29 18:32:36 +00:00

Issue #5468: Apparently this was always a problem but OP made "nested loading" more visible. This should resolve nested loading correctly.

This commit is contained in:
Bret Curtis 2020-06-18 13:23:39 +02:00
parent cf3a20b595
commit 9446cece62
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;