From 474cd1e55546da94fc56b6af187fdbeefa3d80ca Mon Sep 17 00:00:00 2001 From: dooglus Date: Sat, 5 Jan 2008 23:18:28 +0000 Subject: [PATCH] Use a real type, not integer, for the "Duplicate" layer's index parameter. git-svn-id: http://svn.voria.com/code@1271 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/layer_duplicate.cpp | 2 +- synfig-core/trunk/src/synfig/layer_duplicate.h | 2 +- .../trunk/src/synfig/valuenode_duplicate.cpp | 22 +++++++++++----------- synfig-core/trunk/src/synfig/valuenode_duplicate.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/synfig-core/trunk/src/synfig/layer_duplicate.cpp b/synfig-core/trunk/src/synfig/layer_duplicate.cpp index 202a754..cb6ccb4 100644 --- a/synfig-core/trunk/src/synfig/layer_duplicate.cpp +++ b/synfig-core/trunk/src/synfig/layer_duplicate.cpp @@ -63,7 +63,7 @@ SYNFIG_LAYER_SET_CVS_ID(Layer_Duplicate,"$Id$"); Layer_Duplicate::Layer_Duplicate(): Layer_Composite(1.0,Color::BLEND_COMPOSITE) { - LinkableValueNode* index_value_node = ValueNode_Duplicate::create(int(3)); + LinkableValueNode* index_value_node = ValueNode_Duplicate::create(Real(3)); connect_dynamic_param("index", index_value_node); } diff --git a/synfig-core/trunk/src/synfig/layer_duplicate.h b/synfig-core/trunk/src/synfig/layer_duplicate.h index 4daf5a6..bbe2cde 100644 --- a/synfig-core/trunk/src/synfig/layer_duplicate.h +++ b/synfig-core/trunk/src/synfig/layer_duplicate.h @@ -40,7 +40,7 @@ class Layer_Duplicate : public synfig::Layer_Composite SYNFIG_LAYER_MODULE_EXT private: - mutable int index; + mutable Real index; mutable Time time_cur; public: diff --git a/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp b/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp index b5b899b..2b67c3e 100644 --- a/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_duplicate.cpp @@ -58,10 +58,10 @@ ValueNode_Duplicate::ValueNode_Duplicate(const ValueBase::Type &x): ValueNode_Duplicate::ValueNode_Duplicate(const ValueBase &x): LinkableValueNode(x.get_type()) { - set_link("from", ValueNode_Const::create(int(1))); - set_link("to", ValueNode_Const::create(x.get(int()))); - set_link("step", ValueNode_Const::create(int(1))); - index = 1; + set_link("from", ValueNode_Const::create(Real(1.0))); + set_link("to", ValueNode_Const::create(x.get(Real()))); + set_link("step", ValueNode_Const::create(Real(1.0))); + index = 1.0; } ValueNode_Duplicate* @@ -148,16 +148,16 @@ ValueNode_Duplicate::get_link_index_from_name(const String &name)const void ValueNode_Duplicate::reset_index(Time t)const { - int from = (*from_)(t).get(int()); + Real from = (*from_)(t).get(Real()); index = from; } bool ValueNode_Duplicate::step(Time t)const { - int from = (*from_)(t).get(int()); - int to = (*to_ )(t).get(int()); - int step = (*step_)(t).get(int()); + Real from = (*from_)(t).get(Real()); + Real to = (*to_ )(t).get(Real()); + Real step = (*step_)(t).get(Real()); if (step == 0) return false; @@ -178,9 +178,9 @@ ValueNode_Duplicate::step(Time t)const int ValueNode_Duplicate::count_steps(Time t)const { - int from = (*from_)(t).get(int()); - int to = (*to_ )(t).get(int()); - int step = (*step_)(t).get(int()); + Real from = (*from_)(t).get(Real()); + Real to = (*to_ )(t).get(Real()); + Real step = (*step_)(t).get(Real()); if (step == 0) return 1; diff --git a/synfig-core/trunk/src/synfig/valuenode_duplicate.h b/synfig-core/trunk/src/synfig/valuenode_duplicate.h index 5dc8693..c55a90d 100644 --- a/synfig-core/trunk/src/synfig/valuenode_duplicate.h +++ b/synfig-core/trunk/src/synfig/valuenode_duplicate.h @@ -41,7 +41,7 @@ class ValueNode_Duplicate : public LinkableValueNode ValueNode::RHandle from_; ValueNode::RHandle to_; ValueNode::RHandle step_; - mutable int index; + mutable Real index; public: typedef etl::handle Handle; -- 2.7.4