interpolate without values is used to abort interpolating -> no warning

This commit is contained in:
Thomas Geymayer 2013-07-04 19:46:27 +02:00
parent 92f363926e
commit 948db69cc9
2 changed files with 4 additions and 9 deletions

View File

@ -193,12 +193,6 @@ namespace simgear
SG_LOG(SG_GENERAL, SG_WARN, "interpolate: sizes do not match"); SG_LOG(SG_GENERAL, SG_WARN, "interpolate: sizes do not match");
size_t num_values = std::min(values.size(), deltas.size()); 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; PropertyInterpolatorRef first_interp, cur_interp;
for(size_t i = 0; i < num_values; ++i) for(size_t i = 0; i < num_values; ++i)
{ {

View File

@ -76,14 +76,15 @@ namespace simgear
const std::string& easing ); const std::string& easing );
/** /**
* Add animation of the given property from current its current value to * Add animation of the given property from its current value to the
* the target value of the interpolator. * 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 prop Property to be interpolated
* @param interp Interpolator used for interpolation * @param interp Interpolator used for interpolation
*/ */
bool interpolate( SGPropertyNode* prop, bool interpolate( SGPropertyNode* prop,
PropertyInterpolatorRef interp ); PropertyInterpolatorRef interp = 0 );
bool interpolate( SGPropertyNode* prop, bool interpolate( SGPropertyNode* prop,
const std::string& type, const std::string& type,