[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24017] trunk/blender/source/blender/ editors/space_view3d/drawvolume.c: Smoke:

Daniel Genrich daniel.genrich at gmx.net
Tue Oct 20 21:22:19 CEST 2009


Revision: 24017
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24017
Author:   genscher
Date:     2009-10-20 21:22:19 +0200 (Tue, 20 Oct 2009)

Log Message:
-----------
Smoke:
* Revert "speedup" through not using GL_POLYGON - wasn't helping at all, only confusing the source

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/drawvolume.c

Modified: trunk/blender/source/blender/editors/space_view3d/drawvolume.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawvolume.c	2009-10-20 19:14:55 UTC (rev 24016)
+++ trunk/blender/source/blender/editors/space_view3d/drawvolume.c	2009-10-20 19:22:19 UTC (rev 24017)
@@ -463,57 +463,14 @@
 				}
 			}
 
-			if(numpoints==3)
-			{
-				glBegin(GL_TRIANGLES);
-				glColor3f(1.0, 1.0, 1.0);
-				for (i = 0; i < numpoints; i++) {
-					glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]);
-					glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]);
-				}
-				glEnd();
-			}
-			else if(numpoints == 4)
-			{
-				glBegin(GL_QUADS);
-				glColor3f(1.0, 1.0, 1.0);
-				for (i = 0; i < numpoints; i++) {
-					glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]);
-					glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]);
-				}
-				glEnd();
-			}
-			else if(numpoints == 5)
-			{
-				glBegin(GL_TRIANGLES);
-				glColor3f(1.0, 1.0, 1.0);
-				for (i = 0; i < 3; i++) {
-					glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]);
-					glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]);
-				}
-				glEnd();
-				glBegin(GL_QUADS);
-				glColor3f(1.0, 1.0, 1.0);
-				for (i = 2; i < numpoints; i++) {
-					glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]);
-					glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]);
-				}
-				i = 0;
+			// printf("numpoints: %d\n", numpoints);
+			glBegin(GL_POLYGON);
+			glColor3f(1.0, 1.0, 1.0);
+			for (i = 0; i < numpoints; i++) {
 				glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]);
-					glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]);
-				glEnd();
+				glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]);
 			}
-			else
-			{
-				// printf("numpoints: %d\n", numpoints);
-				glBegin(GL_POLYGON);
-				glColor3f(1.0, 1.0, 1.0);
-				for (i = 0; i < numpoints; i++) {
-					glTexCoord3d((points[i * 3 + 0] - min[0] )*cor[0]/size[0], (points[i * 3 + 1] - min[1])*cor[1]/size[1], (points[i * 3 + 2] - min[2])*cor[2]/size[2]);
-					glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]);
-				}
-				glEnd();
-			}
+			glEnd();
 		}
 		n++;
 	}





More information about the Bf-blender-cvs mailing list