mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40: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
@ -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…
x
Reference in New Issue
Block a user