]> git.mxchange.org Git - simgear.git/commitdiff
Modified Files:
authorfrohlich <frohlich>
Sun, 12 Nov 2006 10:32:42 +0000 (10:32 +0000)
committerfrohlich <frohlich>
Sun, 12 Nov 2006 10:32:42 +0000 (10:32 +0000)
animation.cxx animation.hxx: Fix crash on A-10 load

simgear/scene/model/animation.cxx
simgear/scene/model/animation.hxx

index 47bee355cd18f3214edbe2a5feb3e98c5ea6ab69..7cc25afcd92a4faa16a7b9d5f548eea0b50e9c27 100644 (file)
@@ -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<osg::Material*> materialList;
+  std::vector<osg::ref_ptr<osg::Material> > 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<osg::Material*>::iterator i;
+  std::vector<osg::ref_ptr<osg::Material> >::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];
index fefe4872f9f2131d61b566acd0ef730d7407068d..504210811ba17d08d898daf0a2f48e832920fdf0 100644 (file)
@@ -519,7 +519,7 @@ private:
     SGPropertyNode_ptr _shi_prop;
     SGPropertyNode_ptr _thresh_prop;
     SGPropertyNode_ptr _tex_prop;
-    std::vector<osg::Material*> _materialList;
+    std::vector<osg::ref_ptr<osg::Material> > _materialList;
     osg::ref_ptr<osg::AlphaFunc> _alphaFunc;
     osg::ref_ptr<osg::Texture2D> _texture2D;