mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-06 09:39:49 +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:
parent
cf3a20b595
commit
9446cece62
@ -40,6 +40,7 @@ namespace MWGui
|
|||||||
, mLoadingOnTime(0.0)
|
, mLoadingOnTime(0.0)
|
||||||
, mImportantLabel(false)
|
, mImportantLabel(false)
|
||||||
, mVisible(false)
|
, mVisible(false)
|
||||||
|
, mNestedLoadingCount(0)
|
||||||
, mProgress(0)
|
, mProgress(0)
|
||||||
, mShowWallpaper(true)
|
, mShowWallpaper(true)
|
||||||
{
|
{
|
||||||
@ -163,11 +164,12 @@ namespace MWGui
|
|||||||
|
|
||||||
void LoadingScreen::loadingOn(bool visible)
|
void LoadingScreen::loadingOn(bool visible)
|
||||||
{
|
{
|
||||||
mLoadingOnTime = mTimer.time_m();
|
|
||||||
// Early-out if already on
|
// Early-out if already on
|
||||||
if (mMainWidget->getVisible())
|
if (mNestedLoadingCount++ > 0 && mMainWidget->getVisible())
|
||||||
return;
|
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
|
// 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()
|
// 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);
|
mViewer->getSceneData()->setComputeBoundingSphereCallback(new DontComputeBoundCallback);
|
||||||
@ -200,6 +202,8 @@ namespace MWGui
|
|||||||
|
|
||||||
void LoadingScreen::loadingOff()
|
void LoadingScreen::loadingOff()
|
||||||
{
|
{
|
||||||
|
if (--mNestedLoadingCount > 0)
|
||||||
|
return;
|
||||||
mLoadingBox->setVisible(true); // restore
|
mLoadingBox->setVisible(true); // restore
|
||||||
|
|
||||||
if (mLastRenderTime < mLoadingOnTime)
|
if (mLastRenderTime < mLoadingOnTime)
|
||||||
|
@ -66,6 +66,7 @@ namespace MWGui
|
|||||||
bool mImportantLabel;
|
bool mImportantLabel;
|
||||||
|
|
||||||
bool mVisible;
|
bool mVisible;
|
||||||
|
int mNestedLoadingCount;
|
||||||
|
|
||||||
size_t mProgress;
|
size_t mProgress;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user