From: Carlos Lopez Date: Sun, 29 Aug 2010 08:17:42 +0000 (+0200) Subject: Add parameter static option for more layers X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=5b3df3ead91e215171cca0d379e84e6405d6e4ea;p=synfig.git Add parameter static option for more layers --- diff --git a/synfig-core/src/modules/lyr_std/clamp.cpp b/synfig-core/src/modules/lyr_std/clamp.cpp index 14b4c41..eafb048 100644 --- a/synfig-core/src/modules/lyr_std/clamp.cpp +++ b/synfig-core/src/modules/lyr_std/clamp.cpp @@ -68,6 +68,8 @@ Layer_Clamp::Layer_Clamp(): ceiling(1.0f), floor(0.0f) { + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } inline Color diff --git a/synfig-core/src/modules/lyr_std/julia.cpp b/synfig-core/src/modules/lyr_std/julia.cpp index ad2478e..4061b28 100644 --- a/synfig-core/src/modules/lyr_std/julia.cpp +++ b/synfig-core/src/modules/lyr_std/julia.cpp @@ -118,6 +118,8 @@ Julia::Julia():color_shift(angle::degrees(0)) bailout=4; lp=log(log(bailout)); + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } bool @@ -144,6 +146,7 @@ Julia::set_param(const String & param, const ValueBase &value) IMPORT(smooth_outside); IMPORT(broken); +// TODO: Use IMPORT_PLUS if(param=="iterations" && value.same_type_as(iterations)) { iterations=value.get(iterations); @@ -151,6 +154,7 @@ Julia::set_param(const String & param, const ValueBase &value) iterations=0; if(iterations>500000) iterations=500000; + set_param_static(param, value.get_static()); return true; } if(param=="bailout" && value.same_type_as(bailout)) @@ -158,6 +162,7 @@ Julia::set_param(const String & param, const ValueBase &value) bailout=value.get(bailout); bailout*=bailout; lp=log(log(bailout)); + set_param_static(param, value.get_static()); return true; } @@ -188,7 +193,11 @@ Julia::get_param(const String & param)const EXPORT(broken); if(param=="bailout") - return sqrt(bailout); + { + ValueBase ret(sqrt(bailout)); + ret.set_static(get_param_static(param)); + return ret; + } EXPORT_NAME(); EXPORT_VERSION(); diff --git a/synfig-core/src/modules/lyr_std/mandelbrot.cpp b/synfig-core/src/modules/lyr_std/mandelbrot.cpp index bacbbda..9e7e4bd 100644 --- a/synfig-core/src/modules/lyr_std/mandelbrot.cpp +++ b/synfig-core/src/modules/lyr_std/mandelbrot.cpp @@ -119,6 +119,9 @@ Mandelbrot::Mandelbrot(): bailout=4; lp=log(log(bailout)); + + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } bool @@ -147,6 +150,7 @@ Mandelbrot::set_param(const String & param, const ValueBase &value) IMPORT(gradient_inside); IMPORT(gradient_outside); +// TODO: Use IMPORT_PLUS if(param=="iterations" && value.same_type_as(iterations)) { iterations=value.get(iterations); @@ -154,6 +158,7 @@ Mandelbrot::set_param(const String & param, const ValueBase &value) iterations=0; if(iterations>500000) iterations=500000; + set_param_static(param, value.get_static()); return true; } if(param=="bailout" && value.same_type_as(bailout)) @@ -161,6 +166,7 @@ Mandelbrot::set_param(const String & param, const ValueBase &value) bailout=value.get(bailout); bailout*=bailout; lp=log(log(bailout)); + set_param_static(param, value.get_static()); return true; } @@ -195,7 +201,11 @@ Mandelbrot::get_param(const String & param)const EXPORT(gradient_outside); if(param=="bailout") - return sqrt(bailout); + { + ValueBase ret(sqrt(bailout)); + ret.set_static(get_param_static(param)); + return ret; + } EXPORT_NAME(); EXPORT_VERSION(); diff --git a/synfig-core/src/modules/mod_filter/lumakey.cpp b/synfig-core/src/modules/mod_filter/lumakey.cpp index 9b30808..f468c2a 100644 --- a/synfig-core/src/modules/mod_filter/lumakey.cpp +++ b/synfig-core/src/modules/mod_filter/lumakey.cpp @@ -67,6 +67,8 @@ LumaKey::LumaKey(): Layer_Composite (1.0,Color::BLEND_STRAIGHT) { set_blend_method(Color::BLEND_STRAIGHT); + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } diff --git a/synfig-core/src/modules/mod_geometry/checkerboard.cpp b/synfig-core/src/modules/mod_geometry/checkerboard.cpp index d195bc0..2389e01 100644 --- a/synfig-core/src/modules/mod_geometry/checkerboard.cpp +++ b/synfig-core/src/modules/mod_geometry/checkerboard.cpp @@ -68,7 +68,10 @@ CheckerBoard::CheckerBoard(): color (Color::black()), origin (Point(0.125,0.125)), size (Point(0.25,0.25)) -{} +{ + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); +} inline bool CheckerBoard::point_test(const synfig::Point& getpos)const diff --git a/synfig-core/src/modules/mod_geometry/outline.cpp b/synfig-core/src/modules/mod_geometry/outline.cpp index e84effb..17e7867 100644 --- a/synfig-core/src/modules/mod_geometry/outline.cpp +++ b/synfig-core/src/modules/mod_geometry/outline.cpp @@ -161,6 +161,9 @@ Outline::Outline() bline=bline_point_list; needs_sync=true; + + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } diff --git a/synfig-core/src/modules/mod_geometry/rectangle.cpp b/synfig-core/src/modules/mod_geometry/rectangle.cpp index ef096f7..ee50b80 100644 --- a/synfig-core/src/modules/mod_geometry/rectangle.cpp +++ b/synfig-core/src/modules/mod_geometry/rectangle.cpp @@ -82,6 +82,8 @@ Rectangle::Rectangle(): expand(0), invert(false) { + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } bool diff --git a/synfig-core/src/synfig/layer_polygon.cpp b/synfig-core/src/synfig/layer_polygon.cpp index 299bbbf..8c92f8f 100644 --- a/synfig-core/src/synfig/layer_polygon.cpp +++ b/synfig-core/src/synfig/layer_polygon.cpp @@ -74,6 +74,8 @@ Layer_Polygon::Layer_Polygon(): vector_list.push_back(Point(-0.333333,0)); vector_list.push_back(Point(0.333333,0)); sync(); + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } Layer_Polygon::~Layer_Polygon() diff --git a/synfig-core/src/synfig/layer_solidcolor.cpp b/synfig-core/src/synfig/layer_solidcolor.cpp index 9b9c2b7..be1ffdc 100644 --- a/synfig-core/src/synfig/layer_solidcolor.cpp +++ b/synfig-core/src/synfig/layer_solidcolor.cpp @@ -67,6 +67,8 @@ Layer_SolidColor::Layer_SolidColor(): Layer_Composite(1.0,Color::BLEND_COMPOSITE), color(Color::black()) { + Layer::Vocab voc(get_param_vocab()); + Layer::fill_static(voc); } bool