X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Fmod_particle%2Fplant.cpp;h=7c8d5ac53794c76e777ec29ce78704b672c19745;hb=c3ad95144d148602f672e95ddda1f18fc35502f8;hp=1d987f6a163af6bfe19cce74e02e15ef20660e9b;hpb=9093e33285284e16d07db1569b47d29fa9b4b3ab;p=synfig.git diff --git a/synfig-core/trunk/src/modules/mod_particle/plant.cpp b/synfig-core/trunk/src/modules/mod_particle/plant.cpp index 1d987f6..7c8d5ac 100644 --- a/synfig-core/trunk/src/modules/mod_particle/plant.cpp +++ b/synfig-core/trunk/src/modules/mod_particle/plant.cpp @@ -130,8 +130,10 @@ Plant::branch(int n,int depth,float t, float stunt_growth, synfig::Point positio synfig::Real sin_v=synfig::Angle::cos(split_angle).get(); synfig::Real cos_v=synfig::Angle::sin(split_angle).get(); - synfig::Vector velocity1(vel[0]*sin_v-vel[1]*cos_v+random_factor*random(2,30+n+depth,t*splits,0.0f,0.0f),vel[0]*cos_v+vel[1]*sin_v+random_factor*random(2,32+n+depth,t*splits,0.0f,0.0f)); - synfig::Vector velocity2(vel[0]*sin_v+vel[1]*cos_v+random_factor*random(2,31+n+depth,t*splits,0.0f,0.0f),-vel[0]*cos_v+vel[1]*sin_v+random_factor*random(2,33+n+depth,t*splits,0.0f,0.0f)); + synfig::Vector velocity1(vel[0]*sin_v - vel[1]*cos_v + random_factor*random(2, 30+n+depth, t*splits, 0.0f, 0.0f), + vel[0]*cos_v + vel[1]*sin_v + random_factor*random(2, 32+n+depth, t*splits, 0.0f, 0.0f)); + synfig::Vector velocity2(vel[0]*sin_v + vel[1]*cos_v + random_factor*random(2, 31+n+depth, t*splits, 0.0f, 0.0f), + -vel[0]*cos_v + vel[1]*sin_v + random_factor*random(2, 33+n+depth, t*splits, 0.0f, 0.0f)); Plant::branch(n,depth+1,t,stunt_growth,position,velocity1); Plant::branch(n,depth+1,t,stunt_growth,position,velocity2); @@ -145,7 +147,7 @@ Plant::calc_bounding_rect()const bounding_rect=Rect::zero(); // Bline must have at least 2 points in it - if(bline.size()<=2) + if(bline.size()<2) return; next=bline.begin(); @@ -177,7 +179,7 @@ Plant::sync()const bounding_rect=Rect::zero(); // Bline must have at least 2 points in it - if(bline.size()<=2) + if(bline.size()<2) return; std::vector::const_iterator iter,next; @@ -413,7 +415,7 @@ Plant::accelerated_render(Context context,Surface *surface,int quality, const Re std::vector::reverse_iterator iter; const float size_factor(1); - float radius(size_factor*size*sqrt(1.0f/(abs(pw)*abs(ph)))); + float radius(size_factor*size*sqrt(1.0f/(abs(pw)*abs(ph)))), temp_radius; if(radius>1.0f) { @@ -421,7 +423,8 @@ Plant::accelerated_render(Context context,Surface *surface,int quality, const Re int x1,y1,x2,y2; for(iter=particle_list.rbegin();iter!=particle_list.rend();++iter) { - float radius(radius); + temp_radius = radius; + float radius(temp_radius); Color color(iter->color); if(size_as_alpha) { @@ -469,7 +472,8 @@ Plant::accelerated_render(Context context,Surface *surface,int quality, const Re float a,b,c,d; for(iter=particle_list.rbegin();iter!=particle_list.rend();++iter) { - float radius(radius); + temp_radius = radius; + float radius(temp_radius); Color color(iter->color); if(size_as_alpha) {