From: frohlich Date: Sun, 12 Nov 2006 10:32:42 +0000 (+0000) Subject: Modified Files: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d54aea0036b94ebedae7264ababc314a1a54167d;p=simgear.git Modified Files: animation.cxx animation.hxx: Fix crash on A-10 load --- diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index 47bee355..7cc25afc 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -1052,6 +1052,7 @@ void SGAlphaTestAnimation::init() alphaFunc->setReferenceValue(_alpha_clamp); stateSet->setAttribute(alphaFunc); stateSet->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON); + stateSet->setMode(GL_BLEND, osg::StateAttribute::ON); stateSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); } @@ -1307,7 +1308,6 @@ public: } void cloneMaterial(osg::StateSet* stateSet) { - osg::StateAttribute* stateAttr; stateAttr = stateSet->getAttribute(osg::StateAttribute::MATERIAL); if (!stateAttr) @@ -1321,7 +1321,7 @@ public: } stateSet->setAttribute(material); } - std::vector materialList; + std::vector > materialList; }; void SGMaterialAnimation::cloneMaterials(osg::Group *b) @@ -1333,9 +1333,9 @@ void SGMaterialAnimation::cloneMaterials(osg::Group *b) void SGMaterialAnimation::setMaterialBranch(osg::Group *b) { - std::vector::iterator i; + std::vector >::iterator i; for (i = _materialList.begin(); i != _materialList.end(); ++i) { - osg::Material* material = *i; + osg::Material* material = i->get(); if (_update & DIFFUSE) { osg::Vec4 v = _diff.rgba(); float alpha = material->getDiffuse(osg::Material::FRONT_AND_BACK)[3]; diff --git a/simgear/scene/model/animation.hxx b/simgear/scene/model/animation.hxx index fefe4872..50421081 100644 --- a/simgear/scene/model/animation.hxx +++ b/simgear/scene/model/animation.hxx @@ -519,7 +519,7 @@ private: SGPropertyNode_ptr _shi_prop; SGPropertyNode_ptr _thresh_prop; SGPropertyNode_ptr _tex_prop; - std::vector _materialList; + std::vector > _materialList; osg::ref_ptr _alphaFunc; osg::ref_ptr _texture2D;