]> git.mxchange.org Git - simgear.git/commitdiff
interpolate without values is used to abort interpolating -> no warning
authorThomas Geymayer <tomgey@gmail.com>
Thu, 4 Jul 2013 17:46:27 +0000 (19:46 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Thu, 4 Jul 2013 17:46:27 +0000 (19:46 +0200)
simgear/props/PropertyInterpolationMgr.cxx
simgear/props/PropertyInterpolationMgr.hxx

index 0ec4ad79b3796e08903856e1650f05d8fe18fb06..ad8060e2f59f8d3bb0413cd23e5ba4dad5cc5d34 100644 (file)
@@ -193,12 +193,6 @@ namespace simgear
       SG_LOG(SG_GENERAL, SG_WARN, "interpolate: sizes do not match");
 
     size_t num_values = std::min(values.size(), deltas.size());
-    if( !num_values )
-    {
-      SG_LOG(SG_GENERAL, SG_WARN, "interpolate: no values");
-      return false;
-    }
-
     PropertyInterpolatorRef first_interp, cur_interp;
     for(size_t i = 0; i < num_values; ++i)
     {
index 446fad9490063200409795cfe845e86ea93cb45e..efd907d9a4317383bc3d9a43ba6f6d120c6223a0 100644 (file)
@@ -76,14 +76,15 @@ namespace simgear
                           const std::string& easing );
 
       /**
-       * Add animation of the given property from current its current value to
-       * the target value of the interpolator.
+       * Add animation of the given property from its current value to the
+       * target value of the interpolator. If no interpolator is given any
+       * existing animation of the given property is aborted.
        *
        * @param prop    Property to be interpolated
        * @param interp  Interpolator used for interpolation
        */
       bool interpolate( SGPropertyNode* prop,
-                        PropertyInterpolatorRef interp );
+                        PropertyInterpolatorRef interp  = 0 );
 
       bool interpolate( SGPropertyNode* prop,
                         const std::string& type,