X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_timedswap.cpp;h=c444fdabc0b6f1bf231d92bda06870e6ad1a1a5b;hb=71f558fb16eaaacd692807b902429e6a249c1540;hp=c0011ea115a0ad280312697db37e9224f0520bb4;hpb=24a04c6ee533b747f8ff6b128c86c6a01f390a88;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp b/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp index c0011ea..c444fda 100644 --- a/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_timedswap.cpp @@ -1,11 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file valuenode_timedswap.cpp -** \brief Template File +** \brief Implementation of the "Timed Swap" valuenode conversion. ** ** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -34,6 +35,7 @@ #include "valuenode_const.h" #include #include "color.h" +#include #endif @@ -81,7 +83,7 @@ ValueNode_TimedSwap::ValueNode_TimedSwap(const ValueBase &value): set_link("after",ValueNode_Const::create(value.get(Vector()))); break; default: - throw Exception::BadType(ValueBase::type_name(get_type())); + throw Exception::BadType(ValueBase::type_local_name(get_type())); } set_link("time",ValueNode_Const::create(Time(2))); @@ -219,7 +221,7 @@ synfig::ValueNode_TimedSwap::operator()(Time t)const { float a=(float)(*after)(t).get(int()); float b=(float)(*before)(t).get(int()); - return static_cast((b-a)*amount+a+0.5f); + return round_to_int((b-a)*amount+a); } case ValueBase::TYPE_REAL: { @@ -256,7 +258,8 @@ synfig::ValueNode_TimedSwap::operator()(Time t)const bool ValueNode_TimedSwap::set_link_vfunc(int i,ValueNode::Handle x) { - assert(i>=0 && i<4); + assert(i>=0 && i=0 && i<4); + assert(i>=0 && i=0 && i<4); + assert(i>=0 && i=0 && i<4); + assert(i>=0 && i