forked from mirror/openmw-tes3mp
Use osgDB::SharedStateManager for sharing of StateSets across NIF files
This commit is contained in:
parent
1c151f2f0a
commit
6199c0bbc5
1 changed files with 6 additions and 0 deletions
|
@ -8,6 +8,9 @@
|
|||
|
||||
#include <osgUtil/IncrementalCompileOperation>
|
||||
|
||||
#include <osgDB/SharedStateManager>
|
||||
#include <osgDB/Registry>
|
||||
|
||||
#include <components/nifosg/nifloader.hpp>
|
||||
#include <components/nif/niffile.hpp>
|
||||
|
||||
|
@ -103,6 +106,9 @@ namespace Resource
|
|||
NifOsg::Loader loader;
|
||||
osg::ref_ptr<osg::Node> loaded = loader.load(Nif::NIFFilePtr(new Nif::NIFFile(file, normalized)), mTextureManager);
|
||||
|
||||
osgDB::Registry::instance()->getOrCreateSharedStateManager()->share(loaded.get());
|
||||
// TODO: run SharedStateManager::prune on unload
|
||||
|
||||
if (mIncrementalCompileOperation)
|
||||
mIncrementalCompileOperation->add(loaded);
|
||||
|
||||
|
|
Loading…
Reference in a new issue