projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add "Loop" link to the "Gradient Color" ValueNode.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
modules
/
mod_noise
/
valuenode_random.cpp
diff --git
a/synfig-core/trunk/src/modules/mod_noise/valuenode_random.cpp
b/synfig-core/trunk/src/modules/mod_noise/valuenode_random.cpp
index
0488189
..
fdfa331
100644
(file)
--- a/
synfig-core/trunk/src/modules/mod_noise/valuenode_random.cpp
+++ b/
synfig-core/trunk/src/modules/mod_noise/valuenode_random.cpp
@@
-67,6
+67,9
@@
ValueNode_Random::ValueNode_Random(const ValueBase &value):
case ValueBase::TYPE_ANGLE:
set_link("link",ValueNode_Const::create(value.get(Angle())));
break;
case ValueBase::TYPE_ANGLE:
set_link("link",ValueNode_Const::create(value.get(Angle())));
break;
+ case ValueBase::TYPE_BOOL:
+ set_link("link",ValueNode_Const::create(value.get(bool())));
+ break;
case ValueBase::TYPE_COLOR:
set_link("link",ValueNode_Const::create(value.get(Color())));
break;
case ValueBase::TYPE_COLOR:
set_link("link",ValueNode_Const::create(value.get(Color())));
break;
@@
-124,6
+127,10
@@
ValueNode_Random::operator()(Time t)const
return ((*link_)(t).get( Angle()) +
Angle::deg(random(Smooth(smooth), 0, 0, 0, speed) * radius));
return ((*link_)(t).get( Angle()) +
Angle::deg(random(Smooth(smooth), 0, 0, 0, speed) * radius));
+ case ValueBase::TYPE_BOOL:
+ return round_to_int((*link_)(t).get( bool()) +
+ random(Smooth(smooth), 0, 0, 0, speed) * radius) > 0;
+
case ValueBase::TYPE_COLOR:
return (((*link_)(t).get( Color()) +
Color(random(Smooth(smooth), 0, 0, 0, speed),
case ValueBase::TYPE_COLOR:
return (((*link_)(t).get( Color()) +
Color(random(Smooth(smooth), 0, 0, 0, speed),
@@
-258,6
+265,7
@@
ValueNode_Random::check_type(ValueBase::Type type)
{
return
type==ValueBase::TYPE_ANGLE ||
{
return
type==ValueBase::TYPE_ANGLE ||
+ type==ValueBase::TYPE_BOOL ||
type==ValueBase::TYPE_COLOR ||
type==ValueBase::TYPE_INTEGER ||
type==ValueBase::TYPE_REAL ||
type==ValueBase::TYPE_COLOR ||
type==ValueBase::TYPE_INTEGER ||
type==ValueBase::TYPE_REAL ||