]> git.mxchange.org Git - simgear.git/commitdiff
Updates to the alpha-test animation class
authorehofman <ehofman>
Thu, 8 Jan 2004 10:25:23 +0000 (10:25 +0000)
committerehofman <ehofman>
Thu, 8 Jan 2004 10:25:23 +0000 (10:25 +0000)
simgear/scene/model/animation.cxx
simgear/scene/model/animation.hxx
simgear/scene/model/model.cxx

index 30e5d16af523b33e0fd994af4c5afe06938150d9..67c69cb08d8b3d7fdf1470a2bb9a944bf2ae15d2 100644 (file)
@@ -872,10 +872,8 @@ SGTexMultipleAnimation::update()
 // Implementation of SGAlphaTestAnimation
 ////////////////////////////////////////////////////////////////////////
 
-SGAlphaTestAnimation::SGAlphaTestAnimation (SGPropertyNode *prop_root,
-                                    SGPropertyNode_ptr props)
-  : SGAnimation(props, new ssgBranch),
-    _done(false)
+SGAlphaTestAnimation::SGAlphaTestAnimation(SGPropertyNode_ptr props)
+  : SGAnimation(props, new ssgBranch)
 {
   _alpha_clamp = props->getFloatValue("alpha-factor", 0.0);
 }
@@ -884,12 +882,9 @@ SGAlphaTestAnimation::~SGAlphaTestAnimation ()
 {
 }
 
-void SGAlphaTestAnimation::update()
+void SGAlphaTestAnimation::init()
 {
-  if (!_done) {
-    _done = true;
-    setAlphaClampToBranch(_branch,_alpha_clamp);
-  }
+  setAlphaClampToBranch(_branch,_alpha_clamp);
 }
 
 void SGAlphaTestAnimation::setAlphaClampToBranch(ssgBranch *b, float clamp)
index d5063feb221e30803ef6f9929e301c478ac6b1eb..3c73eb4775f29f6b0eb9c5a992ca7b0748d9e651 100644 (file)
@@ -387,10 +387,9 @@ private:
 class SGAlphaTestAnimation : public SGAnimation
 {
 public:
-  SGAlphaTestAnimation (SGPropertyNode *prop_root,
-                        SGPropertyNode_ptr props);
+  SGAlphaTestAnimation(SGPropertyNode_ptr props);
   virtual ~SGAlphaTestAnimation ();
-  virtual void update();
+  virtual void init();
 private:
   void setAlphaClampToBranch(ssgBranch *b, float clamp);
   bool _done;
index 96ebebaa1846e2dd5c9652ae7e932f0f929a9580..c2fdbb1cf18d7003f7b770d1dc3528bb3ede7985 100644 (file)
@@ -131,7 +131,7 @@ sgMakeAnimation( ssgBranch * model,
   } else if (!strcmp("blend", type)) {
     animation = new SGBlendAnimation(prop_root, node);
   } else if (!strcmp("alpha-test", type)) {
-    animation = new SGAlphaTestAnimation(prop_root, node);
+    animation = new SGAlphaTestAnimation(node);
   } else {
     animation = new SGNullAnimation(node);
     SG_LOG(SG_INPUT, SG_WARN, "Unknown animation type " << type);