From: dooglus Date: Tue, 18 Sep 2007 21:04:25 +0000 (+0000) Subject: Initialise a sine valuenode from its parent. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=740253c894f69f0f4244119dce8818caee470942;p=synfig.git Initialise a sine valuenode from its parent. git-svn-id: http://svn.voria.com/code@716 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/valuenode_sine.cpp b/synfig-core/trunk/src/synfig/valuenode_sine.cpp index d3dec4e..21a960f 100644 --- a/synfig-core/trunk/src/synfig/valuenode_sine.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_sine.cpp @@ -49,26 +49,32 @@ using namespace synfig; /* === M E T H O D S ======================================================= */ -ValueNode_Sine::ValueNode_Sine(const ValueBase::Type &x): - LinkableValueNode(x) +ValueNode_Sine::ValueNode_Sine(const ValueBase &value): + LinkableValueNode(value.get_type()) { - switch(x) + switch(value.get_type()) { case ValueBase::TYPE_REAL: - set_link("angle",ValueNode_Const::create(Angle::zero())); - set_link("amp",ValueNode_Const::create(Real(1))); + set_link("angle",ValueNode_Const::create(Angle::deg(90))); + set_link("amp",ValueNode_Const::create(value.get(Real()))); break; default: - throw Exception::BadType(ValueBase::type_name(x)); + throw Exception::BadType(ValueBase::type_name(value.get_type())); } DCAST_HACK_ENABLE(); } +LinkableValueNode* +ValueNode_Sine::create_new()const +{ + return new ValueNode_Sine(get_type()); +} + ValueNode_Sine* ValueNode_Sine::create(const ValueBase &x) { - return new ValueNode_Sine(x.get_type()); + return new ValueNode_Sine(x); } ValueNode_Sine::~ValueNode_Sine() @@ -174,9 +180,3 @@ ValueNode_Sine::get_link_index_from_name(const String &name)const throw Exception::BadLinkName(name); } - -LinkableValueNode* -ValueNode_Sine::create_new()const -{ - return new ValueNode_Sine(get_type()); -} diff --git a/synfig-core/trunk/src/synfig/valuenode_sine.h b/synfig-core/trunk/src/synfig/valuenode_sine.h index d4704de..bd0669b 100644 --- a/synfig-core/trunk/src/synfig/valuenode_sine.h +++ b/synfig-core/trunk/src/synfig/valuenode_sine.h @@ -40,7 +40,7 @@ class ValueNode_Sine : public LinkableValueNode ValueNode::RHandle angle_; ValueNode::RHandle amp_; - ValueNode_Sine(const ValueBase::Type &x); + ValueNode_Sine(const ValueBase &value); public: