Add my copyright to files I've modified.
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_subtract.cpp
index 94e564a..81fca92 100644 (file)
@@ -6,6 +6,7 @@
 **
 **     \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
@@ -78,6 +79,10 @@ synfig::ValueNode_Subtract::ValueNode_Subtract(const ValueBase &value):
                set_link("lhs",ValueNode_Const::create(value.get(Real())));
                set_link("rhs",ValueNode_Const::create(Real(0)));
                break;
+       case ValueBase::TYPE_TIME:
+               set_link("lhs",ValueNode_Const::create(value.get(Time())));
+               set_link("rhs",ValueNode_Const::create(Time(0)));
+               break;
        case ValueBase::TYPE_VECTOR:
                set_link("lhs",ValueNode_Const::create(value.get(Vector())));
                set_link("rhs",ValueNode_Const::create(Vector(0,0)));
@@ -175,6 +180,8 @@ synfig::ValueNode_Subtract::operator()(Time t)const
        }
        case ValueBase::TYPE_REAL:
                return ((*ref_a)(t).get(Vector::value_type())-(*ref_b)(t).get(Vector::value_type()))*(*scalar)(t).get(Real());
+       case ValueBase::TYPE_TIME:
+               return ((*ref_a)(t).get(Time())-(*ref_b)(t).get(Time()))*(*scalar)(t).get(Real());
        case ValueBase::TYPE_VECTOR:
                return ((*ref_a)(t).get(Vector())-(*ref_b)(t).get(Vector()))*(*scalar)(t).get(Real());
        default:
@@ -253,7 +260,6 @@ ValueNode_Subtract::link_name(int i)const
 int
 ValueNode_Subtract::get_link_index_from_name(const String &name)const
 {
-       printf("%s:%d link_index_from_name\n", __FILE__, __LINE__);
        if(name=="lhs") return 0;
        if(name=="rhs") return 1;
        if(name=="scalar") return 2;
@@ -279,5 +285,6 @@ ValueNode_Subtract::check_type(ValueBase::Type type)
                || type==ValueBase::TYPE_COLOR
                || type==ValueBase::TYPE_INTEGER
                || type==ValueBase::TYPE_REAL
+               || type==ValueBase::TYPE_TIME
                || type==ValueBase::TYPE_VECTOR;
 }