Author: Carlos Lopez <[email protected]>
Date:   Thu Oct 20 19:31:37 2011 +0200

Reuse variables

---

 .../src/gui/workarearenderer/renderer_ducks.cpp    |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp 
b/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp
index dade31b..147fe69 100644
--- a/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp
+++ b/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp
@@ -496,10 +496,12 @@ Renderer_Ducks::render_vfunc(
                                        
wplist=synfig::ValueNode_WPList::Handle::cast_dynamic(value_desc.get_parent_value_node());
                                if(wplist)
                                {
+                                       bool wplistloop(wplist->get_loop());
                                        synfig::ValueNode_BLine::Handle 
bline(synfig::ValueNode_BLine::Handle::cast_dynamic(wplist->get_bline()));
                                        
wpoint_composite=ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node());
                                        if(bline && wpoint_composite)
                                        {
+                                               bool 
blineloop(bline->get_loop());
                                                bool homogeneous=false;
                                                // Retrieve the homogeneous 
layer parameter
                                                Layer::Handle layer_parent;
@@ -515,7 +517,6 @@ Renderer_Ducks::render_vfunc(
                                                                }
                                                        }
                                                WidthPoint 
wp((*wpoint_composite)(time));
-                                               bool 
wplistloop(wplist->get_loop());
                                                if(wplistloop)
                                                {
                                                        // The wplist is 
looped. This may require a position parameter
@@ -524,9 +525,9 @@ Renderer_Ducks::render_vfunc(
                                                        // First normalise the 
current position
                                                        Real 
value_old(wp.get_norm_position(wplistloop));
                                                        // If it is homogeneous 
then convert it to standard
-                                                       
value_old=homogeneous?hom_to_std((*bline)(time), value_old, wplist->get_loop(), 
bline->get_loop()):value_old;
+                                                       
value_old=homogeneous?hom_to_std((*bline)(time), value_old, wplistloop, 
blineloop):value_old;
                                                        // grab a new position 
given by duck's position on the bline
-                                                       Real value_new = 
synfig::find_closest_point((*bline)(time), p , radius, bline->get_loop());
+                                                       Real value_new = 
synfig::find_closest_point((*bline)(time), p , radius, blineloop);
                                                        // calculate the 
difference between old and new positions
                                                        Real difference = fmod( 
fmod(value_new - value_old, 1.0) + 1.0 , 1.0);
                                                        //fmod is called twice 
to avoid negative values
@@ -535,16 +536,16 @@ Renderer_Ducks::render_vfunc(
                                                        // calculate a new 
value for the position
                                                        
new_value=value_old+difference;
                                                        // restore the 
homogeneous value if needed
-                                                       new_value = 
homogeneous?std_to_hom((*bline)(time), new_value, wplist->get_loop(), 
bline->get_loop()):new_value;
+                                                       new_value = 
homogeneous?std_to_hom((*bline)(time), new_value, wplistloop, 
blineloop):new_value;
                                                        // convert the 
new_value in terms of current boundaries
                                                        new_value = 
wp.get_lower_bound()+new_value*(wp.get_upper_bound()-wp.get_lower_bound());
                                                }
                                                else
                                                {
                                                        // grab a new position 
given by duck's position on the bline
-                                                       new_value = 
synfig::find_closest_point((*bline)(time), p , radius, bline->get_loop());
+                                                       new_value = 
synfig::find_closest_point((*bline)(time), p , radius, blineloop);
                                                        // if it is homogeneous 
then convert to it
-                                                       
new_value=homogeneous?std_to_hom((*bline)(time), new_value, wplist->get_loop(), 
bline->get_loop()):new_value;
+                                                       
new_value=homogeneous?std_to_hom((*bline)(time), new_value, wplistloop, 
blineloop):new_value;
                                                        // convert the value 
inside the boundaries
                                                        new_value = 
wp.get_lower_bound()+new_value*(wp.get_upper_bound()-wp.get_lower_bound());
                                                }


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to