remove redundant code & use GL_LINE_STRIP for object spiral drawing.
authorCampbell Barton <ideasman42@gmail.com>
Thu, 22 Sep 2011 18:42:16 +0000 (18:42 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 22 Sep 2011 18:42:16 +0000 (18:42 +0000)
doc/manpage/blender.1
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/render/intern/source/shadeinput.c
source/blender/windowmanager/intern/wm_window.c

index ddf3a79b104cd23a968ec493b3706f464a2b2c88..20cd40e32ee42ca4f71c3fd5e413c117c069de6b 100644 (file)
@@ -1,4 +1,4 @@
-.TH "BLENDER" "1" "June 03, 2011" "Blender Blender 2\&.57 (sub 1)"
+.TH "BLENDER" "1" "September 22, 2011" "Blender Blender 2\&.59 (sub 3)"
 
 .SH NAME
 blender \- a 3D modelling and rendering package
 
 .SH NAME
 blender \- a 3D modelling and rendering package
@@ -15,7 +15,7 @@ Use Blender to create TV commercials, to make technical visualizations, business
 http://www.blender.org
 .SH OPTIONS
 
 http://www.blender.org
 .SH OPTIONS
 
-Blender 2.57 (sub 1)
+Blender 2.59 (sub 3)
 Usage: blender [args ...] [file] [args ...]
 .br
 .SS "Render Options:"
 Usage: blender [args ...] [file] [args ...]
 .br
 .SS "Render Options:"
index 44d68ded67916f3546c232406d0e384e81c90c21..65267bb481a38e8f8504cca0206d7ef82105de4a 100644 (file)
@@ -5112,6 +5112,7 @@ static void drawspiral(const float cent[3], float rad, float tmat[][4], int star
        const float tot_inv= (1.0f / (float)CIRCLE_RESOL);
        int a;
        char inverse= FALSE;
        const float tot_inv= (1.0f / (float)CIRCLE_RESOL);
        int a;
        char inverse= FALSE;
+       float x, y, fac;
 
        if (start < 0) {
                inverse = TRUE;
 
        if (start < 0) {
                inverse = TRUE;
@@ -5121,38 +5122,56 @@ static void drawspiral(const float cent[3], float rad, float tmat[][4], int star
        mul_v3_v3fl(vx, tmat[0], rad);
        mul_v3_v3fl(vy, tmat[1], rad);
 
        mul_v3_v3fl(vx, tmat[0], rad);
        mul_v3_v3fl(vy, tmat[1], rad);
 
-       copy_v3_v3(vec, cent);
+       glBegin(GL_LINE_STRIP);
 
        if (inverse==0) {
 
        if (inverse==0) {
+               copy_v3_v3(vec, cent);
+               glVertex3fv(vec);
+
                for(a=0; a<CIRCLE_RESOL; a++) {
                for(a=0; a<CIRCLE_RESOL; a++) {
-                       if (a+start>31)
+                       if (a+start>=CIRCLE_RESOL)
                                start=-a + 1;
                                start=-a + 1;
-                       glBegin(GL_LINES);                                                      
-                       glVertex3fv(vec);
-                       vec[0]= cent[0] + sinval[a+start] * (vx[0] * (float)a * tot_inv) + cosval[a+start] * (vy[0] * (float)a * tot_inv);
-                       vec[1]= cent[1] + sinval[a+start] * (vx[1] * (float)a * tot_inv) + cosval[a+start] * (vy[1] * (float)a * tot_inv);
-                       vec[2]= cent[2] + sinval[a+start] * (vx[2] * (float)a * tot_inv) + cosval[a+start] * (vy[2] * (float)a * tot_inv);
+
+                       fac= (float)a * tot_inv;
+                       x= sinval[a+start] * fac;
+                       y= cosval[a+start] * fac;
+
+                       vec[0]= cent[0] + (x * vx[0] + y * vy[0]);
+                       vec[1]= cent[1] + (x * vx[1] + y * vy[1]);
+                       vec[2]= cent[2] + (x * vx[2] + y * vy[2]);
+
                        glVertex3fv(vec);
                        glVertex3fv(vec);
-                       glEnd();
                }
        }
        else {
                }
        }
        else {
-               a=0;
-               vec[0]= cent[0] + sinval[a+start] * (vx[0] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[0] * (float)(-a+31) * tot_inv);
-               vec[1]= cent[1] + sinval[a+start] * (vx[1] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[1] * (float)(-a+31) * tot_inv);
-               vec[2]= cent[2] + sinval[a+start] * (vx[2] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[2] * (float)(-a+31) * tot_inv);
+               a= 0;
+
+               fac= (float)(CIRCLE_RESOL-1) * tot_inv;
+               x= sinval[start] * fac;
+               y= cosval[start] * fac;
+
+               vec[0]= cent[0] + (x * vx[0] + y * vy[0]);
+               vec[1]= cent[1] + (x * vx[1] + y * vy[1]);
+               vec[2]= cent[2] + (x * vx[2] + y * vy[2]);
+
+               glVertex3fv(vec);
+
                for(a=0; a<CIRCLE_RESOL; a++) {
                for(a=0; a<CIRCLE_RESOL; a++) {
-                       if (a+start>31)
+                       if (a+start>=CIRCLE_RESOL)
                                start=-a + 1;
                                start=-a + 1;
-                       glBegin(GL_LINES);                                                      
-                       glVertex3fv(vec);
-                       vec[0]= cent[0] + sinval[a+start] * (vx[0] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[0] * (float)(-a+31) * tot_inv);
-                       vec[1]= cent[1] + sinval[a+start] * (vx[1] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[1] * (float)(-a+31) * tot_inv);
-                       vec[2]= cent[2] + sinval[a+start] * (vx[2] * (float)(-a+31) * tot_inv) + cosval[a+start] * (vy[2] * (float)(-a+31) * tot_inv);
+
+                       fac= (float)(-a+(CIRCLE_RESOL-1)) * tot_inv;
+                       x= sinval[a+start] * fac;
+                       y= cosval[a+start] * fac;
+
+                       vec[0]= cent[0] + (x * vx[0] + y * vy[0]);
+                       vec[1]= cent[1] + (x * vx[1] + y * vy[1]);
+                       vec[2]= cent[2] + (x * vx[2] + y * vy[2]);
                        glVertex3fv(vec);
                        glVertex3fv(vec);
-                       glEnd();
                }