Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_cos.cpp
index 167a761..f3e4793 100644 (file)
@@ -6,7 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-**     Copyright (c) 2007 Chris Moore
+**     Copyright (c) 2007, 2008 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
@@ -86,11 +86,13 @@ ValueNode_Cos::~ValueNode_Cos()
 ValueBase
 ValueNode_Cos::operator()(Time t)const
 {
+       if (getenv("SYNFIG_DEBUG_VALUENODE_OPERATORS"))
+               printf("%s:%d operator()\n", __FILE__, __LINE__);
+
        return
                Angle::cos(
                        (*angle_)(t).get(Angle())
-               ).get() * (*amp_)(t).get(Real())
-       ;
+               ).get() * (*amp_)(t).get(Real());
 }
 
 
@@ -122,6 +124,7 @@ ValueNode_Cos::set_link_vfunc(int i,ValueNode::Handle value)
        case 0: CHECK_TYPE_AND_SET_VALUE(angle_, ValueBase::TYPE_ANGLE);
        case 1: CHECK_TYPE_AND_SET_VALUE(amp_,   ValueBase::TYPE_REAL);
        }
+
        return false;
 }
 
@@ -130,10 +133,11 @@ ValueNode_Cos::get_link_vfunc(int i)const
 {
        assert(i>=0 && i<link_count());
 
-       if(i==0)
-               return angle_;
-       if(i==1)
-               return amp_;
+       switch(i)
+       {
+       case 0: return angle_;
+       case 1: return amp_;
+       }
 
        return 0;
 }
@@ -149,10 +153,12 @@ ValueNode_Cos::link_name(int i)const
 {
        assert(i>=0 && i<link_count());
 
-       if(i==0)
-               return "angle";
-       if(i==1)
-               return "amp";
+       switch(i)
+       {
+       case 0: return "angle";
+       case 1: return "amp";
+       }
+
        return String();
 }
 
@@ -161,20 +167,20 @@ ValueNode_Cos::link_local_name(int i)const
 {
        assert(i>=0 && i<link_count());
 
-       if(i==0)
-               return _("Angle");
-       if(i==1)
-               return _("Amplitude");
+       switch(i)
+       {
+       case 0: return _("Angle");
+       case 1: return _("Amplitude");
+       }
+
        return String();
 }
 
 int
 ValueNode_Cos::get_link_index_from_name(const String &name)const
 {
-       if(name=="angle")
-               return 0;
-       if(name=="amp")
-               return 1;
+       if(name=="angle")       return 0;
+       if(name=="amp")         return 1;
 
        throw Exception::BadLinkName(name);
 }