mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-19 19:11:32 +00:00
fixes enable and disable commands (#3186)
This PR fixes a recent regression concerning enable and disable commands with object paging. In addition, we add a necessary comment to avoid such issues in the future.
This commit is contained in:
parent
f70a154195
commit
41318a585f
1 changed files with 7 additions and 1 deletions
|
@ -74,6 +74,8 @@ const osg::Vec3f& ViewData::getViewPoint() const
|
||||||
return mViewPoint;
|
return mViewPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: As a performance optimisation, we cache mRenderingNodes from previous frames here.
|
||||||
|
// If this cache becomes invalid (e.g. through mWorldUpdateRevision), we need to use clear() instead of reset().
|
||||||
void ViewData::reset()
|
void ViewData::reset()
|
||||||
{
|
{
|
||||||
// clear any unused entries
|
// clear any unused entries
|
||||||
|
@ -164,9 +166,13 @@ ViewData *ViewDataMap::getViewData(osg::Object *viewer, const osg::Vec3f& viewPo
|
||||||
}
|
}
|
||||||
else if (!mostSuitableView)
|
else if (!mostSuitableView)
|
||||||
{
|
{
|
||||||
|
if (vd->getWorldUpdateRevision() != mWorldUpdateRevision)
|
||||||
|
{
|
||||||
|
vd->setWorldUpdateRevision(mWorldUpdateRevision);
|
||||||
|
vd->clear();
|
||||||
|
}
|
||||||
vd->setViewPoint(viewPoint);
|
vd->setViewPoint(viewPoint);
|
||||||
vd->setActiveGrid(activeGrid);
|
vd->setActiveGrid(activeGrid);
|
||||||
vd->setWorldUpdateRevision(mWorldUpdateRevision);
|
|
||||||
needsUpdate = true;
|
needsUpdate = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue