|
|
@ -11,7 +11,7 @@
|
|
|
|
// resource
|
|
|
|
// resource
|
|
|
|
#include <components/misc/stringops.hpp>
|
|
|
|
#include <components/misc/stringops.hpp>
|
|
|
|
#include <components/misc/resourcehelpers.hpp>
|
|
|
|
#include <components/misc/resourcehelpers.hpp>
|
|
|
|
#include <components/resource/texturemanager.hpp>
|
|
|
|
#include <components/resource/imagemanager.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
// skel
|
|
|
|
// skel
|
|
|
|
#include <osgAnimation/MorphGeometry>
|
|
|
|
#include <osgAnimation/MorphGeometry>
|
|
|
@ -343,7 +343,7 @@ namespace NifOsg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Node> load(Nif::NIFFilePtr nif, Resource::TextureManager* textureManager)
|
|
|
|
osg::ref_ptr<osg::Node> load(Nif::NIFFilePtr nif, Resource::ImageManager* textureManager)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (nif->numRoots() < 1)
|
|
|
|
if (nif->numRoots() < 1)
|
|
|
|
nif->fail("Found no root nodes");
|
|
|
|
nif->fail("Found no root nodes");
|
|
|
@ -369,7 +369,7 @@ namespace NifOsg
|
|
|
|
return created;
|
|
|
|
return created;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void applyNodeProperties(const Nif::Node *nifNode, osg::Node *applyTo, SceneUtil::CompositeStateSetUpdater* composite, Resource::TextureManager* textureManager, std::vector<int>& boundTextures, int animflags)
|
|
|
|
void applyNodeProperties(const Nif::Node *nifNode, osg::Node *applyTo, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* textureManager, std::vector<int>& boundTextures, int animflags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const Nif::PropertyList& props = nifNode->props;
|
|
|
|
const Nif::PropertyList& props = nifNode->props;
|
|
|
|
for (size_t i = 0; i <props.length();++i)
|
|
|
|
for (size_t i = 0; i <props.length();++i)
|
|
|
@ -440,7 +440,7 @@ namespace NifOsg
|
|
|
|
return lod;
|
|
|
|
return lod;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Node> handleNode(const Nif::Node* nifNode, osg::Group* parentNode, Resource::TextureManager* textureManager,
|
|
|
|
osg::ref_ptr<osg::Node> handleNode(const Nif::Node* nifNode, osg::Group* parentNode, Resource::ImageManager* textureManager,
|
|
|
|
std::vector<int> boundTextures, int animflags, int particleflags, bool skipMeshes, TextKeyMap* textKeys, osg::Node* rootNode=NULL)
|
|
|
|
std::vector<int> boundTextures, int animflags, int particleflags, bool skipMeshes, TextKeyMap* textKeys, osg::Node* rootNode=NULL)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
osg::ref_ptr<osg::Group> node = new osg::MatrixTransform(nifNode->trafo.toMatrix());
|
|
|
|
osg::ref_ptr<osg::Group> node = new osg::MatrixTransform(nifNode->trafo.toMatrix());
|
|
|
@ -682,7 +682,7 @@ namespace NifOsg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void handleTextureControllers(const Nif::Property *texProperty, SceneUtil::CompositeStateSetUpdater* composite, Resource::TextureManager* textureManager, osg::StateSet *stateset, int animflags)
|
|
|
|
void handleTextureControllers(const Nif::Property *texProperty, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* textureManager, osg::StateSet *stateset, int animflags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (Nif::ControllerPtr ctrl = texProperty->controller; !ctrl.empty(); ctrl = ctrl->next)
|
|
|
|
for (Nif::ControllerPtr ctrl = texProperty->controller; !ctrl.empty(); ctrl = ctrl->next)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1244,7 +1244,7 @@ namespace NifOsg
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void handleProperty(const Nif::Property *property,
|
|
|
|
void handleProperty(const Nif::Property *property,
|
|
|
|
osg::Node *node, SceneUtil::CompositeStateSetUpdater* composite, Resource::TextureManager* textureManager, std::vector<int>& boundTextures, int animflags)
|
|
|
|
osg::Node *node, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* textureManager, std::vector<int>& boundTextures, int animflags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (property->recType)
|
|
|
|
switch (property->recType)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1543,7 +1543,7 @@ namespace NifOsg
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Node> Loader::load(Nif::NIFFilePtr file, Resource::TextureManager* textureManager)
|
|
|
|
osg::ref_ptr<osg::Node> Loader::load(Nif::NIFFilePtr file, Resource::ImageManager* textureManager)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LoaderImpl impl(file->getFilename());
|
|
|
|
LoaderImpl impl(file->getFilename());
|
|
|
|
return impl.load(file, textureManager);
|
|
|
|
return impl.load(file, textureManager);
|
|
|
|