mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Use osgDB::SharedStateManager for sharing of StateSets across NIF files
This commit is contained in:
parent
1c151f2f0a
commit
6199c0bbc5
@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
#include <osgUtil/IncrementalCompileOperation>
|
#include <osgUtil/IncrementalCompileOperation>
|
||||||
|
|
||||||
|
#include <osgDB/SharedStateManager>
|
||||||
|
#include <osgDB/Registry>
|
||||||
|
|
||||||
#include <components/nifosg/nifloader.hpp>
|
#include <components/nifosg/nifloader.hpp>
|
||||||
#include <components/nif/niffile.hpp>
|
#include <components/nif/niffile.hpp>
|
||||||
|
|
||||||
@ -103,6 +106,9 @@ namespace Resource
|
|||||||
NifOsg::Loader loader;
|
NifOsg::Loader loader;
|
||||||
osg::ref_ptr<osg::Node> loaded = loader.load(Nif::NIFFilePtr(new Nif::NIFFile(file, normalized)), mTextureManager);
|
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)
|
if (mIncrementalCompileOperation)
|
||||||
mIncrementalCompileOperation->add(loaded);
|
mIncrementalCompileOperation->add(loaded);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user