Added my "Copyright (c) 2007" notices, for files I edited in 2007.
[synfig.git] / synfig-core / trunk / src / modules / mod_noise / noise.cpp
index 1bfa73c..4558624 100644 (file)
@@ -1,11 +1,12 @@
 /* === S Y N F I G ========================================================= */
 /*!    \file noise.cpp
-**     \brief blehh
+**     \brief Implementation of the "Noise Gradient" layer
 **
 **     $Id$
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2007 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
@@ -52,8 +53,8 @@ using namespace etl;
 
 SYNFIG_LAYER_INIT(Noise);
 SYNFIG_LAYER_SET_NAME(Noise,"noise");
-SYNFIG_LAYER_SET_LOCAL_NAME(Noise,_("Noise Gradient"));
-SYNFIG_LAYER_SET_CATEGORY(Noise,_("Gradients"));
+SYNFIG_LAYER_SET_LOCAL_NAME(Noise,N_("Noise Gradient"));
+SYNFIG_LAYER_SET_CATEGORY(Noise,N_("Gradients"));
 SYNFIG_LAYER_SET_VERSION(Noise,"0.0");
 SYNFIG_LAYER_SET_CVS_ID(Noise,"$Id$");
 
@@ -98,7 +99,7 @@ Noise::color_func(const Point &point, float pixel_size,Context /*context*/)const
        time=speed*curr_time;
        Random::SmoothType smooth((!speed && Noise::smooth == Random::SMOOTH_SPLINE) ? Random::SMOOTH_FAST_SPLINE : Noise::smooth);
 
-       float t(time);
+       float ftime(time);
 
        {
                float amount=0.0f;
@@ -107,15 +108,15 @@ Noise::color_func(const Point &point, float pixel_size,Context /*context*/)const
                float alpha=0.0f;
                for(i=0;i<detail;i++)
                {
-                       amount=random(smooth,0+(detail-i)*5,x,y,t)+amount*0.5;
+                       amount=random(smooth,0+(detail-i)*5,x,y,ftime)+amount*0.5;
                        if(amount<-1)amount=-1;if(amount>1)amount=1;
 
                        if(super_sample&&pixel_size)
                        {
-                               amount2=random(smooth,0+(detail-i)*5,x2,y,t)+amount2*0.5;
+                               amount2=random(smooth,0+(detail-i)*5,x2,y,ftime)+amount2*0.5;
                                if(amount2<-1)amount2=-1;if(amount2>1)amount2=1;
 
-                               amount3=random(smooth,0+(detail-i)*5,x,y2,t)+amount3*0.5;
+                               amount3=random(smooth,0+(detail-i)*5,x,y2,ftime)+amount3*0.5;
                                if(amount3<-1)amount3=-1;if(amount3>1)amount3=1;
 
                                if(turbulent)
@@ -130,7 +131,7 @@ Noise::color_func(const Point &point, float pixel_size,Context /*context*/)const
 
                        if(do_alpha)
                        {
-                               alpha=random(smooth,3+(detail-i)*5,x,y,t)+alpha*0.5;
+                               alpha=random(smooth,3+(detail-i)*5,x,y,ftime)+alpha*0.5;
                                if(alpha<-1)alpha=-1;if(alpha>1)alpha=1;
                        }
 
@@ -142,7 +143,7 @@ Noise::color_func(const Point &point, float pixel_size,Context /*context*/)const
 
                        x*=0.5f;
                        y*=0.5f;
-                       //t*=0.5f;
+                       //ftime*=0.5f;
                }
 
                if(!turbulent)