Use a real type, not integer, for the "Duplicate" layer's index parameter.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 5 Jan 2008 23:18:28 +0000 (23:18 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 5 Jan 2008 23:18:28 +0000 (23:18 +0000)
git-svn-id: http://svn.voria.com/code@1271 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/layer_duplicate.cpp
synfig-core/trunk/src/synfig/layer_duplicate.h
synfig-core/trunk/src/synfig/valuenode_duplicate.cpp
synfig-core/trunk/src/synfig/valuenode_duplicate.h

index 202a754..cb6ccb4 100644 (file)
@@ -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);
 }
 
index 4daf5a6..bbe2cde 100644 (file)
@@ -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:
index b5b899b..2b67c3e 100644 (file)
@@ -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;
 
index 5dc8693..c55a90d 100644 (file)
@@ -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<ValueNode_Duplicate> Handle;