diff --git a/components/nifosg/controller.cpp b/components/nifosg/controller.cpp index ef3157773..0e1f15f0f 100644 --- a/components/nifosg/controller.cpp +++ b/components/nifosg/controller.cpp @@ -433,9 +433,12 @@ void FlipController::operator() (osg::Node* node, osg::NodeVisitor* nv) { osg::StateSet* stateset = node->getStateSet(); int curTexture = int(getInputValue(nv) / mDelta) % mTextures.size(); - osg::Texture2D* tex = dynamic_cast(stateset->getAttribute(osg::StateAttribute::TEXTURE)); + osg::Texture2D* tex = dynamic_cast(stateset->getTextureAttribute(mTexSlot, osg::StateAttribute::TEXTURE)); if (tex) tex->setImage(mTextures[curTexture].get()); + else + std::cout << "FlipController: can't find target slot" << std::endl; + } traverse(node, nv); } diff --git a/components/nifosg/controller.hpp b/components/nifosg/controller.hpp index 17bf3ae75..c6ef74d2a 100644 --- a/components/nifosg/controller.hpp +++ b/components/nifosg/controller.hpp @@ -259,7 +259,6 @@ namespace NifOsg virtual void operator() (osg::Node* node, osg::NodeVisitor* nv); }; - // untested class FlipController : public osg::NodeCallback, public Controller { private: diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index ea59b9bd2..d05758f2e 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -1260,14 +1260,12 @@ namespace NifOsg } else if (i == Nif::NiTexturingProperty::DarkTexture) { - // untested osg::TexEnv* texEnv = new osg::TexEnv; texEnv->setMode(osg::TexEnv::MODULATE); stateset->setTextureAttributeAndModes(i, texEnv, osg::StateAttribute::ON); } else if (i == Nif::NiTexturingProperty::DetailTexture) { - // untested osg::TexEnvCombine* texEnv = new osg::TexEnvCombine; texEnv->setScale_RGB(2.f); texEnv->setCombine_Alpha(GL_MODULATE);