1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00

FlipController fix, DetailTexture & DarkTexture tested

This commit is contained in:
scrawl 2015-03-25 00:54:45 +01:00
parent b072e803ce
commit 20866b44f7
3 changed files with 4 additions and 4 deletions

View File

@ -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<osg::Texture2D*>(stateset->getAttribute(osg::StateAttribute::TEXTURE));
osg::Texture2D* tex = dynamic_cast<osg::Texture2D*>(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);
}

View File

@ -259,7 +259,6 @@ namespace NifOsg
virtual void operator() (osg::Node* node, osg::NodeVisitor* nv);
};
// untested
class FlipController : public osg::NodeCallback, public Controller
{
private:

View File

@ -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);