mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 14:19:41 +00:00
Fix for "GlobalMap trying to erase an inactive camera" spam in main menu
This commit is contained in:
parent
e046119487
commit
ce0d93caed
2 changed files with 28 additions and 4 deletions
|
@ -63,17 +63,31 @@ namespace
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CameraUpdateCallback(osg::Camera* cam, MWRender::GlobalMap* parent)
|
CameraUpdateCallback(osg::Camera* cam, MWRender::GlobalMap* parent)
|
||||||
: mCamera(cam), mParent(parent)
|
: mRendered(false)
|
||||||
|
, mCamera(cam)
|
||||||
|
, mParent(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
||||||
{
|
{
|
||||||
mParent->markForRemoval(mCamera);
|
if (mRendered)
|
||||||
|
{
|
||||||
|
mCamera->setNodeMask(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
traverse(node, nv);
|
traverse(node, nv);
|
||||||
|
|
||||||
|
if (!mRendered)
|
||||||
|
{
|
||||||
|
mRendered = true;
|
||||||
|
mParent->markForRemoval(mCamera);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool mRendered;
|
||||||
osg::ref_ptr<osg::Camera> mCamera;
|
osg::ref_ptr<osg::Camera> mCamera;
|
||||||
MWRender::GlobalMap* mParent;
|
MWRender::GlobalMap* mParent;
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,13 +30,22 @@ namespace
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CameraUpdateCallback(osg::Camera* cam, MWRender::LocalMap* parent)
|
CameraUpdateCallback(osg::Camera* cam, MWRender::LocalMap* parent)
|
||||||
: mCamera(cam), mParent(parent)
|
: mRendered(false)
|
||||||
|
, mCamera(cam)
|
||||||
|
, mParent(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void operator()(osg::Node*, osg::NodeVisitor*)
|
virtual void operator()(osg::Node*, osg::NodeVisitor*)
|
||||||
{
|
{
|
||||||
mParent->markForRemoval(mCamera);
|
if (mRendered)
|
||||||
|
mCamera->setNodeMask(0);
|
||||||
|
|
||||||
|
if (!mRendered)
|
||||||
|
{
|
||||||
|
mRendered = true;
|
||||||
|
mParent->markForRemoval(mCamera);
|
||||||
|
}
|
||||||
|
|
||||||
// Note, we intentionally do not traverse children here. The map camera's scene data is the same as the master camera's,
|
// Note, we intentionally do not traverse children here. The map camera's scene data is the same as the master camera's,
|
||||||
// so it has been updated already.
|
// so it has been updated already.
|
||||||
|
@ -44,6 +53,7 @@ namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool mRendered;
|
||||||
osg::ref_ptr<osg::Camera> mCamera;
|
osg::ref_ptr<osg::Camera> mCamera;
|
||||||
MWRender::LocalMap* mParent;
|
MWRender::LocalMap* mParent;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue