mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-02 03:06:41 +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;
|
||||
}
|
||||
|
||||
// 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()
|
||||
{
|
||||
// clear any unused entries
|
||||
|
@ -164,9 +166,13 @@ ViewData *ViewDataMap::getViewData(osg::Object *viewer, const osg::Vec3f& viewPo
|
|||
}
|
||||
else if (!mostSuitableView)
|
||||
{
|
||||
if (vd->getWorldUpdateRevision() != mWorldUpdateRevision)
|
||||
{
|
||||
vd->setWorldUpdateRevision(mWorldUpdateRevision);
|
||||
vd->clear();
|
||||
}
|
||||
vd->setViewPoint(viewPoint);
|
||||
vd->setActiveGrid(activeGrid);
|
||||
vd->setWorldUpdateRevision(mWorldUpdateRevision);
|
||||
needsUpdate = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue