projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid warning.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
synfig
/
valuenode_add.cpp
diff --git
a/synfig-core/trunk/src/synfig/valuenode_add.cpp
b/synfig-core/trunk/src/synfig/valuenode_add.cpp
index
93dd3c3
..
366b325
100644
(file)
--- a/
synfig-core/trunk/src/synfig/valuenode_add.cpp
+++ b/
synfig-core/trunk/src/synfig/valuenode_add.cpp
@@
-35,6
+35,7
@@
#include "valuenode_const.h"
#include <stdexcept>
#include "color.h"
#include "valuenode_const.h"
#include <stdexcept>
#include "color.h"
+#include "gradient.h"
#include "vector.h"
#include "angle.h"
#include "real.h"
#include "vector.h"
#include "angle.h"
#include "real.h"
@@
-72,6
+73,10
@@
synfig::ValueNode_Add::ValueNode_Add(const ValueBase &value):
set_link("lhs",ValueNode_Const::create(value.get(Color())));
set_link("rhs",ValueNode_Const::create(Color(0,0,0,0)));
break;
set_link("lhs",ValueNode_Const::create(value.get(Color())));
set_link("rhs",ValueNode_Const::create(Color(0,0,0,0)));
break;
+ case ValueBase::TYPE_GRADIENT:
+ set_link("lhs",ValueNode_Const::create(value.get(Gradient())));
+ set_link("rhs",ValueNode_Const::create(Gradient()));
+ break;
case ValueBase::TYPE_INTEGER:
set_link("lhs",ValueNode_Const::create(value.get(int())));
set_link("rhs",ValueNode_Const::create(int(0)));
case ValueBase::TYPE_INTEGER:
set_link("lhs",ValueNode_Const::create(value.get(int())));
set_link("rhs",ValueNode_Const::create(int(0)));
@@
-122,6
+127,8
@@
synfig::ValueNode_Add::operator()(Time t)const
return ((*ref_a)(t).get(Angle())+(*ref_b)(t).get(Angle()))*(*scalar)(t).get(Real());
case ValueBase::TYPE_COLOR:
return ((*ref_a)(t).get(Color())+(*ref_b)(t).get(Color()))*(*scalar)(t).get(Real());
return ((*ref_a)(t).get(Angle())+(*ref_b)(t).get(Angle()))*(*scalar)(t).get(Real());
case ValueBase::TYPE_COLOR:
return ((*ref_a)(t).get(Color())+(*ref_b)(t).get(Color()))*(*scalar)(t).get(Real());
+ case ValueBase::TYPE_GRADIENT:
+ return ((*ref_a)(t).get(Gradient())+(*ref_b)(t).get(Gradient()))*(*scalar)(t).get(Real());
case ValueBase::TYPE_INTEGER:
return round_to_int(((*ref_a)(t).get(int())+(*ref_b)(t).get(int()))*(*scalar)(t).get(Real()));
case ValueBase::TYPE_REAL:
case ValueBase::TYPE_INTEGER:
return round_to_int(((*ref_a)(t).get(int())+(*ref_b)(t).get(int()))*(*scalar)(t).get(Real()));
case ValueBase::TYPE_REAL:
@@
-141,6
+148,7
@@
bool
ValueNode_Add::set_link_vfunc(int i,ValueNode::Handle value)
{
assert(i>=0 && i<link_count());
ValueNode_Add::set_link_vfunc(int i,ValueNode::Handle value)
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: CHECK_TYPE_AND_SET_VALUE(ref_a, get_type());
switch(i)
{
case 0: CHECK_TYPE_AND_SET_VALUE(ref_a, get_type());
@@
-154,6
+162,7
@@
ValueNode::LooseHandle
ValueNode_Add::get_link_vfunc(int i)const
{
assert(i>=0 && i<link_count());
ValueNode_Add::get_link_vfunc(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return ref_a;
switch(i)
{
case 0: return ref_a;
@@
-173,6
+182,7
@@
String
ValueNode_Add::link_local_name(int i)const
{
assert(i>=0 && i<link_count());
ValueNode_Add::link_local_name(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return _("LHS");
switch(i)
{
case 0: return _("LHS");
@@
-186,6
+196,7
@@
String
ValueNode_Add::link_name(int i)const
{
assert(i>=0 && i<link_count());
ValueNode_Add::link_name(int i)const
{
assert(i>=0 && i<link_count());
+
switch(i)
{
case 0: return "lhs";
switch(i)
{
case 0: return "lhs";
@@
-221,6
+232,7
@@
ValueNode_Add::check_type(ValueBase::Type type)
{
return type==ValueBase::TYPE_ANGLE
|| type==ValueBase::TYPE_COLOR
{
return type==ValueBase::TYPE_ANGLE
|| type==ValueBase::TYPE_COLOR
+ || type==ValueBase::TYPE_GRADIENT
|| type==ValueBase::TYPE_INTEGER
|| type==ValueBase::TYPE_REAL
|| type==ValueBase::TYPE_TIME
|| type==ValueBase::TYPE_INTEGER
|| type==ValueBase::TYPE_REAL
|| type==ValueBase::TYPE_TIME