mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Merge pull request #2191 from akortunov/viewer
Do not store Viewer reference in the ViewData
This commit is contained in:
commit
368d1f9d25
@ -118,7 +118,6 @@ ViewData *ViewDataMap::getViewData(osg::Object *viewer)
|
||||
if (found == mViews.end())
|
||||
{
|
||||
ViewData* vd = createOrReuseView();
|
||||
vd->setViewer(viewer);
|
||||
mViews[viewer] = vd;
|
||||
return vd;
|
||||
}
|
||||
@ -148,7 +147,6 @@ void ViewDataMap::clearUnusedViews(unsigned int frame)
|
||||
ViewData* vd = it->second;
|
||||
if (vd->getFrameLastUsed() + 2 < frame)
|
||||
{
|
||||
vd->setViewer(nullptr);
|
||||
vd->clear();
|
||||
mUnusedViews.push_back(vd);
|
||||
mViews.erase(it++);
|
||||
|
@ -44,9 +44,6 @@ namespace Terrain
|
||||
|
||||
Entry& getEntry(unsigned int i);
|
||||
|
||||
osg::Object* getViewer() const { return mViewer.get(); }
|
||||
void setViewer(osg::Object* viewer) { mViewer = viewer; }
|
||||
|
||||
unsigned int getFrameLastUsed() const { return mFrameLastUsed; }
|
||||
|
||||
/// @return Have any nodes changed since the last frame
|
||||
@ -62,7 +59,6 @@ namespace Terrain
|
||||
unsigned int mNumEntries;
|
||||
unsigned int mFrameLastUsed;
|
||||
bool mChanged;
|
||||
osg::ref_ptr<osg::Object> mViewer;
|
||||
osg::Vec3f mEyePoint;
|
||||
bool mHasEyePoint;
|
||||
};
|
||||
@ -85,7 +81,7 @@ namespace Terrain
|
||||
private:
|
||||
std::list<ViewData> mViewVector;
|
||||
|
||||
typedef std::map<osg::Object*, ViewData*> Map;
|
||||
typedef std::map<osg::ref_ptr<osg::Object>, ViewData*> Map;
|
||||
Map mViews;
|
||||
|
||||
std::deque<ViewData*> mUnusedViews;
|
||||
|
Loading…
Reference in New Issue
Block a user